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

# Add a task

> Add a task

### Path parameters

<ParamField path="id" type="string" required>
  Work order ID
</ParamField>

### Request body

`CreateWorkOrderTaskRequest`

<ParamField body="assigned_to" type="string,null" />

<ParamField body="estimated_hours" type="string,null">
  Decimal estimated hours as a string.
</ParamField>

<ParamField body="notes" type="string,null" />

<ParamField body="sequence" type="integer,null (int32)" />

<ParamField body="task_name" type="string" required />

### Responses

<ResponseField name="201" type="WorkOrderTaskResponse" />

<ResponseField name="400" type="ErrorBody" />

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.stateset.com/api/v1/work-orders/{id}/tasks' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "assigned_to": null,
    "estimated_hours": null,
    "notes": null,
    "sequence": null,
    "task_name": "string"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "actual_hours": null,
    "estimated_hours": null,
    "id": "string",
    "notes": null,
    "sequence": 1,
    "status": "string",
    "task_name": "string",
    "work_order_id": "string"
  }
  ```
</ResponseExample>
