> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apps.filed.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create connection job

> Create an import job that can be triggered to process all clients attached to it

Create a connection job to organize and batch process multiple tax preparations. A connection job groups related works (clients) together and can be triggered to process all attached clients.

```graphql theme={null}
mutation CreateConnectionJob($connectionId: ID!, $jobName: String!) {
  createConnectionJob(connectionId: $connectionId, jobName: $jobName) {
    id
    connectionId
    workspaceId
    name
    status
    createdAt
    updatedAt
  }
}
```

## Arguments

<ParamField path="connectionId" type="ID!" required>
  The ID of the provider connection. This identifies which integration connection to create the job for.
</ParamField>

<ParamField path="jobName" type="String!" required>
  A descriptive name for the connection job. Use this to identify the batch of tax preparations (e.g., "2024 Tax Season Import", "Q1 Client Batch").
</ParamField>

## Returns

<ResponseField name="id" type="ID!">
  Connection job identifier. Save this for creating works and triggering the import.
</ResponseField>

<ResponseField name="connectionId" type="ID!">
  The provider connection ID this job belongs to.
</ResponseField>

<ResponseField name="workspaceId" type="ID!">
  The workspace ID this job belongs to.
</ResponseField>

<ResponseField name="name" type="String!">
  The name you provided for this connection job.
</ResponseField>

<ResponseField name="status" type="String!">
  Current status of the connection job (e.g., "pending", "active", "completed").
</ResponseField>

<ResponseField name="createdAt" type="Date!">
  Timestamp when the connection job was created.
</ResponseField>

<ResponseField name="updatedAt" type="Date!">
  Timestamp when the connection job was last updated.
</ResponseField>

## Example

<RequestExample>
  ```bash cURL theme={null}
  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 CreateConnectionJob($connectionId: ID!, $jobName: String!) { createConnectionJob(connectionId: $connectionId, jobName: $jobName) { id connectionId workspaceId name status createdAt updatedAt } }",
      "variables": {
        "connectionId": "connection_789",
        "jobName": "2024 Tax Season Import"
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "data": {
      "createConnectionJob": {
        "id": "job_123456",
        "connectionId": "connection_789",
        "workspaceId": "workspace_123456",
        "name": "2024 Tax Season Import",
        "status": "pending",
        "createdAt": "2024-01-15T10:30:00Z",
        "updatedAt": "2024-01-15T10:30:00Z"
      }
    }
  }
  ```
</ResponseExample>

<Note>
  After creating a connection job, use [createJobWorks](/legacy/apis/endpoint/create-works) to attach clients (works) to the job. Once all clients and job work artifacts are attached, you can initiate the import using [initiateTaxPrepsImport](/legacy/apis/endpoint/initiate-tax-preps-import).
</Note>

## Troubleshooting

**Problem**: `createConnectionJob` fails with invalid connection ID

**Solutions**:

* Verify the `connectionId` exists and belongs to your workspace
* Ensure the connection status is `active`
* Check that you're using the correct connection ID for the workspace

**Problem**: Job created but cannot attach works

**Solutions**:

* Ensure you're using the `id` from the `createConnectionJob` response as the `connectionJobId` when creating works
* Verify the job status allows adding works
* Check that the connection job belongs to the correct connection
