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

# Update Task

> Updates one or more fields on an existing task.

### Headers

<ParamField header="Authorization" type="string" required>
  `Bearer YOUR_API_KEY`
</ParamField>

### Path Parameters

<ParamField path="id" type="string" required>
  UUID of the task to update.
</ParamField>

### Body

Send only the fields you want to change. At least one field is required.

<ParamField body="name" type="string">Updated task name.</ParamField>
<ParamField body="description" type="string">Updated description.</ParamField>
<ParamField body="status" type="string">New status. One of: `todo`, `in_progress`, `done`.</ParamField>
<ParamField body="estimated_hours" type="number">Updated estimated hours.</ParamField>
<ParamField body="billable" type="boolean">Updated billable flag.</ParamField>
<ParamField body="rate" type="number">Updated hourly rate.</ParamField>
<ParamField body="phase_id" type="string">UUID of a project phase to assign the task to, or `null` to unassign.</ParamField>

### Response

<ResponseField name="success" type="boolean">`true` on update.</ResponseField>
<ResponseField name="data" type="object">The updated task object.</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://kliio.app/api/v1/tasks/task-uuid-... \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "status": "done" }'
  ```

  ```js JavaScript theme={null}
  const res = await fetch('https://kliio.app/api/v1/tasks/task-uuid-...', {
    method: 'PATCH',
    headers: {
      Authorization: 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ status: 'done' })
  })
  const { data } = await res.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "data": {
      "id": "task-uuid-...",
      "name": "Design homepage mockup",
      "status": "done",
      "estimated_hours": 8,
      "billable": true,
      "rate": 120,
      "total_seconds": 28800,
      "phase_id": "phase-uuid-...",
      "created_at": "2025-03-20T09:00:00.000Z"
    }
  }
  ```

  ```json 400 theme={null}
  { "error": "No valid fields to update" }
  ```

  ```json 404 theme={null}
  { "error": "Task not found or access denied" }
  ```
</ResponseExample>
