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

# Task status, results, and errors

POST /tasks is asynchronous. Save the returned id and call GET /tasks/\{id}. Pending, Created, and Running mean the job is still processing. Succeeded means complete. Failed and Cancelled are terminal without a result. Read output for the result and errorMessage for failure details.

```bash Get job status theme={null}
curl "https://customer.lululab.ai/tasks/TASK_ID" \
  -H "Authorization: $LULULAB_API_KEY"
```

### Response examples

Created means the request was accepted, not that generation is finished. Use id to query the task. The exact output fields vary by workflow.

| Field / type | Required | Values and description |
| - | - | - |
| `id` (`string`) | Yes | Task ID; save it immediately for GET /tasks/\{id}. |
| `workflowId` (`string`) | Yes | Workflow ID that ran. |
| `status` (`string`) | Yes | Created · Pending · Running · Succeeded · Failed · Cancelled · Task status; only Succeeded means the result is ready. |
| `output` (`JSON \| null`) | No | Plan or generation result after success; shape depends on workflowId. |
| `errorMessage` (`string \| null`) | No | Failure detail when available. |
| `credits` (`integer \| null`) | No | Credits consumed when available. |

```json Newly created task theme={null}
{
  "id": "TASK_ID",
  "workflowId": "ImageGenV2",
  "status": "Created",
  "output": null,
  "errorMessage": null
}
```

```json Completed task theme={null}
{
  "id": "TASK_ID",
  "workflowId": "ImageGenV2",
  "status": "Succeeded",
  "output": { "...": "Workflow-specific result; inspect the returned JSON" },
  "errorMessage": null
}
```

| HTTP status | What to do |
| - | - |
| `400` | Check the workflowId, model settings, and request fields. |
| `401 / 403` | Check the API key and account access. |
| `402` | Insufficient credits; top up and estimate again. |
| `429` | Too many requests; retry later. |
| `5xx` | Service unavailable; check any submitted job before retrying. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.