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

# Get Job Status

> Check the status of a content generation job

## Endpoint

```
GET /api/job-status/:jobId
```

## Authentication

No authentication required.

## Path Parameters

<ParamField path="jobId" type="string" required>
  The unique identifier of the job returned from the content generation endpoint
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="id" type="string">
      The job identifier
    </ResponseField>

    <ResponseField name="status" type="string">
      Current job status: `pending`, `processing`, `completed`, `failed`
    </ResponseField>

    <ResponseField name="type" type="string">
      Job type: `text` or `pdf`
    </ResponseField>

    <ResponseField name="format" type="string">
      Content format: `image`, `carousel`, or `reel`
    </ResponseField>

    <ResponseField name="filename" type="string">
      Original filename (for PDF jobs) or null
    </ResponseField>

    <ResponseField name="progress" type="number">
      Completion percentage (0-100)
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO timestamp when job was created
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      ISO timestamp of last update
    </ResponseField>

    <ResponseField name="errorMessage" type="string">
      Error message if status is `failed`, otherwise null
    </ResponseField>
  </Expandable>
</ResponseField>

## Example Request

```bash theme={null}
curl https://api.distylia.com/api/job-status/550e8400-e29b-41d4-a716-446655440000
```

## Example Response

```json theme={null}
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "processing",
    "type": "text",
    "format": "carousel",
    "filename": null,
    "progress": 45,
    "createdAt": "2024-01-08T10:30:00.000Z",
    "updatedAt": "2024-01-08T10:30:45.000Z",
    "errorMessage": null
  }
}
```

## Status Values

| Status       | Description                        |
| ------------ | ---------------------------------- |
| `pending`    | Job is queued and waiting to start |
| `processing` | Job is currently being processed   |
| `completed`  | Job finished successfully          |
| `failed`     | Job encountered an error           |

## Polling Recommendations

* Poll every 5-10 seconds for status updates
* Stop polling once status is `completed` or `failed`
* Use exponential backoff if implementing automatic polling

## Error Responses

<ResponseExample>
  ```json 400 - Job ID Required theme={null}
  {
    "error": "Job ID is required"
  }
  ```

  ```json 404 - Job Not Found theme={null}
  {
    "success": false,
    "error": "Job with ID abc123 not found"
  }
  ```
</ResponseExample>
