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

# Get job failed files

> Retrieve the list of any failed files for a specific job, and why those files failed.

## Path parameters

<ParamField path="job_id" type="string" required>
  The unique identifier of the job.
</ParamField>

## Response

<ResponseField name="failed_files" type="array" required>
  List of failed files. Each object includes `document` (the file path or identifier) and `error` (the failure reason).
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url "${UNSTRUCTURED_API_URL}/api/v1/jobs/b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e/failed-files" \
    --header "unstructured-api-key: ${UNSTRUCTURED_API_KEY}"
  ```

  ```python Python SDK theme={null}
  import os
  from unstructured_client import UnstructuredClient
  from unstructured_client.models.operations import GetJobFailedFilesRequest

  client = UnstructuredClient(
      api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
      server_url=os.getenv("UNSTRUCTURED_API_URL"),
  )

  response = client.jobs.get_job_failed_files(
      request=GetJobFailedFilesRequest(
          job_id="b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e"
      )
  )
  print(response)
  ```

  ```python Python SDK (async) theme={null}
  import asyncio
  import os
  from unstructured_client import UnstructuredClient
  from unstructured_client.models.operations import GetJobFailedFilesRequest

  async def get_job_failed_files():
      client = UnstructuredClient(
          api_key_auth=os.getenv("UNSTRUCTURED_API_KEY"),
          server_url=os.getenv("UNSTRUCTURED_API_URL"),
      )
      response = await client.jobs.get_job_failed_files_async(
          request=GetJobFailedFilesRequest(
              job_id="b2c3d4e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e"
          )
      )
      print(response)

  asyncio.run(get_job_failed_files())
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "failed_files": [
      {
        "document": "s3://my-bucket/input/corrupted-file.pdf",
        "error": "Failed to parse document: unexpected end of file"
      }
    ]
  }
  ```
</ResponseExample>
