> ## 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.

# Initiate tax preps import

> Trigger the tax prep import process for a connection job after works and work artifacts are created

After creating a connection job, attaching works (clients), and adding work artifacts (files), initiate the tax prep import to process all clients in the connection job. This mutation triggers Filed to parse and import all tax preparations associated with the connection job.

```graphql theme={null}
mutation InitiateTaxPrepsImport($connectionJobId: ID!) {
  initiateTaxPrepsImport(connectionJobId: $connectionJobId) {
    id
    connectionId
    workspaceId
    name
    status
    createdAt
    updatedAt
    metadata
  }
}
```

## Arguments

<ParamField path="connectionJobId" type="ID!" required>
  The ID of the connection job returned from [createConnectionJob](/legacy/apis/endpoint/create-connection-job). This identifies which connection job to initiate the import for.
</ParamField>

## Returns

<ResponseField name="id" type="ID!">
  Connection job identifier.
</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 of the connection job.
</ResponseField>

<ResponseField name="status" type="String!">
  Current status of the connection job. The status will be updated as the import progresses (e.g., "pending", "processing", "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>

<ResponseField name="metadata" type="JSON">
  Optional metadata associated with the connection job. May include import progress, error information, or other relevant details.
</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 InitiateTaxPrepsImport($connectionJobId: ID!) { initiateTaxPrepsImport(connectionJobId: $connectionJobId) { id connectionId workspaceId name status createdAt updatedAt metadata } }",
      "variables": {
        "connectionJobId": "job_123456"
      }
    }'
  ```
</RequestExample>

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

<Warning>
  **Prerequisites**: Before calling `initiateTaxPrepsImport`, ensure you have:

  1. Created a connection job using [createConnectionJob](/legacy/apis/endpoint/create-connection-job)
  2. Attached works (clients) to the job using [createJobWorks](/legacy/apis/endpoint/create-works)
  3. Attached work artifacts (files) to each job work using [createJobWorkArtifacts](/legacy/apis/endpoint/create-job-work-artifacts)

  The import process will process all works and their associated artifacts in the connection job.
</Warning>

<Note>
  After initiating the import, monitor the connection job status to track import progress. The `status` field will update as the import progresses, and any errors or progress information may be available in the `metadata` field.
</Note>

## Troubleshooting

**Problem**: `initiateTaxPrepsImport` fails with invalid connection job ID

**Solutions**:

* Verify the `connectionJobId` exists and belongs to your connection
* Ensure you're using the `id` from the `createConnectionJob` response
* Check that the connection job has works and work artifacts attached

**Problem**: Import initiated but no works are processed

**Solutions**:

* Verify that job works have been created using [createJobWorks](/legacy/apis/endpoint/create-works)
* Ensure job work artifacts have been attached using [createJobWorkArtifacts](/legacy/apis/endpoint/create-job-work-artifacts)
* Check that file URLs in artifacts are accessible and valid
* Review the connection job status and metadata for error details

**Problem**: Import status remains "pending" or "processing" for extended time

**Solutions**:

* Check the connection job `metadata` field for progress information or error details
* Verify that all file URLs in work artifacts are accessible
* Ensure the connection credentials have permission to access the file URLs
* Contact support if the import appears stuck
