> ## 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 Time Entry

> Updates one or more fields on an existing time entry.

### Headers

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

### Path Parameters

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

### Body

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

<ParamField body="hours" type="number">Updated hours. Must be greater than `0`.</ParamField>
<ParamField body="hourly_rate" type="number">Updated hourly rate.</ParamField>
<ParamField body="date" type="string">Updated date in `YYYY-MM-DD` format.</ParamField>
<ParamField body="description" type="string">Updated description.</ParamField>

### Response

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

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://kliio.app/api/v1/time-entries/te-uuid-... \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "hours": 4.5, "description": "Wireframing + revisions" }'
  ```

  ```js JavaScript theme={null}
  const res = await fetch('https://kliio.app/api/v1/time-entries/te-uuid-...', {
    method: 'PATCH',
    headers: {
      Authorization: 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ hours: 4.5, description: 'Wireframing + revisions' })
  })
  const { data } = await res.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "data": {
      "id": "te-uuid-...",
      "hours": 4.5,
      "hourly_rate": 120,
      "date": "2025-03-20",
      "description": "Wireframing + revisions",
      "created_at": "2025-03-20T18:00:00.000Z"
    }
  }
  ```

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

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