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

# Update task

> Update mutable fields on a task. Only provided fields are touched.

```
PUT https://www.wiseyield.co/api/v1/tasks/{id}
```

### Authentication

Requires a key with the `tasks:write` scope.

### Path parameters

<ParamField path="id" type="string" required>Task UUID.</ParamField>

### Request body

All fields optional. Only provided fields are updated. Setting `status` to `completed` auto-populates `completedDate` if not already set.

<ParamField body="farmId" type="string">UUID. Must be owned by the user. Reparents the task.</ParamField>
<ParamField body="title" type="string">1–200 characters.</ParamField>
<ParamField body="description" type="string">Pass `null` to clear.</ParamField>
<ParamField body="status" type="string">One of `pending`, `in_progress`, `completed`, `overdue`, `cancelled`.</ParamField>
<ParamField body="priority" type="string">One of `low`, `medium`, `high`, `urgent`.</ParamField>
<ParamField body="category" type="string">One of the 10 task categories.</ParamField>
<ParamField body="dueDate" type="string">ISO 8601. Pass `null` to clear.</ParamField>
<ParamField body="startDate" type="string">ISO 8601. Pass `null` to clear.</ParamField>
<ParamField body="completedDate" type="string">ISO 8601. Pass `null` to clear (also resets status if desired).</ParamField>
<ParamField body="assignedTo" type="string">Free text. Pass `null` to clear.</ParamField>
<ParamField body="fieldName" type="string">Pass `null` to clear.</ParamField>
<ParamField body="estimatedDuration" type="string">Pass `null` to clear.</ParamField>
<ParamField body="actualDuration" type="string">Pass `null` to clear.</ParamField>
<ParamField body="notes" type="string">Pass `null` to clear.</ParamField>
<ParamField body="cropId" type="string">UUID. Pass `null` to clear.</ParamField>
<ParamField body="fieldId" type="string">UUID. Pass `null` to clear.</ParamField>
<ParamField body="blockId" type="string">UUID. Pass `null` to clear.</ParamField>

### Response

Returns the updated task wrapped under `data`.

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT 'https://www.wiseyield.co/api/v1/tasks/aaaaaaaa.../...' \
    -H "Authorization: Bearer $WISEYIELD_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "status": "in_progress", "actualDuration": "45m" }'
  ```
</RequestExample>

## Errors

| Status                    | When                                                          |
| ------------------------- | ------------------------------------------------------------- |
| `400 INVALID_ID`          | `{id}` is not a valid UUID                                    |
| `400 VALIDATION_ERROR`    | Body validation failed                                        |
| `401`                     | Missing, malformed, expired, or revoked API key               |
| `403 INSUFFICIENT_SCOPE`  | Key lacks `tasks:write` scope                                 |
| `404 NOT_FOUND`           | Task or new `farmId` doesn't exist or belongs to another user |
| `429 RATE_LIMIT_EXCEEDED` | Per-user rate limit reached                                   |
| `5xx`                     | Server error                                                  |
