Skip to main content
Attach one or more files (artifacts) to a job work. Artifacts represent documents, forms, or other files associated with a tax preparation. You can create multiple artifacts in a single request.
mutation CreateJobWorkArtifacts($jobWorkId: ID!, $inputs: [CreateJobWorkArtifactsInput!]!) {
  createJobWorkArtifacts(jobWorkId: $jobWorkId, inputs: $inputs) {
    id
    createdAt
    updatedAt
    workspaceId
    artifactId
    connectionJobId
    workArtifact {
      id
      externalId
    }
  }
}

Arguments

jobWorkId
ID!
required
The ID of the job work returned from createJobWorks. This identifies which client/tax preparation to attach files to.
inputs
[CreateJobWorkArtifactsInput!]!
required
Array of artifact inputs. Each input represents one file to attach to the job work.

Returns

id
ID!
Job artifact identifier.
createdAt
Date!
Timestamp when the job artifact was created.
updatedAt
Date!
Timestamp when the job artifact was last updated.
workspaceId
ID!
The workspace ID this job artifact belongs to.
artifactId
ID!
The artifact ID this job artifact references.
connectionJobId
ID!
The connection job ID this job artifact belongs to.
workArtifact
WorkArtifact!
The work artifact associated with this job artifact.

Example

curl -X POST https://gateway.filed.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <accessToken>" \
  -H "source-platform: my-sample-platform" \
  -d '{
    "query": "mutation CreateJobWorkArtifacts($jobWorkId: ID!, $inputs: [CreateJobWorkArtifactsInput!]!) { createJobWorkArtifacts(jobWorkId: $jobWorkId, inputs: $inputs) { id createdAt updatedAt workspaceId artifactId connectionJobId workArtifact { id externalId } } }",
    "variables": {
      "jobWorkId": "job_work_789",
      "inputs": [
        {
          "name": "W-2 Form 2024",
          "type": "w2",
          "url": "https://api.example.com/files/w2-2024.pdf",
          "externalId": "file-12345",
          "metadata": {
            "fileSize": 245678,
            "mimeType": "application/pdf",
            "uploadDate": "2024-01-10T08:00:00Z"
          }
        },
        {
          "name": "1099-INT Statement",
          "type": "1099",
          "url": "https://api.example.com/files/1099-int.pdf",
          "externalId": "file-67890",
          "metadata": {
            "fileSize": 189234,
            "mimeType": "application/pdf"
          }
        }
      ]
    }
  }'
{
  "data": {
    "createJobWorkArtifacts": [
      {
        "id": "job_artifact_456",
        "createdAt": "2024-01-15T10:40:00Z",
        "updatedAt": "2024-01-15T10:40:00Z",
        "workspaceId": "workspace_123456",
        "artifactId": "artifact_456",
        "connectionJobId": "job_123456",
        "workArtifact": {
          "id": "artifact_456",
          "externalId": "file-12345"
        }
      }
    ]
  }
}
File URL Accessibility: Ensure the URLs you provide are accessible to Filed. If your files require authentication, Filed will use the connection credentials provided during the connection setup. Test that Filed can access the URLs using those credentials.
The url field should point to a file that Filed can download. Filed will fetch the file from this URL when processing the work. Ensure the URL is valid and the file is accessible at the time of import.

Troubleshooting

Problem: Artifacts created but files cannot be accessed Solutions:
  • Verify the URLs are publicly accessible or accessible with the connection credentials
  • Test the URLs manually to ensure they return the expected files
  • Check that file URLs haven’t expired or been moved
  • Ensure the connection credentials have permission to access the file URLs
Problem: Invalid URL format Solutions:
  • Ensure URLs use valid protocols (https:// or http://)
  • Verify URLs are properly encoded if they contain special characters
  • Check that URLs point to actual files, not directories or API endpoints that require additional parameters