> ## 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 template

> Update mutable fields on a template. Only own templates can be updated; global templates owned by other users are read-only.

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

### Authentication

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

### Path parameters

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

### Request body

All fields optional.

<ParamField body="name" type="string">1–200 characters.</ParamField>
<ParamField body="description" type="string">Up to 2,000 characters. Pass `null` to clear.</ParamField>
<ParamField body="farmId" type="string">UUID. Pass `null` to make farm-agnostic.</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="estimatedDuration" type="string">Pass `null` to clear.</ParamField>
<ParamField body="defaultAssignee" type="string">Pass `null` to clear.</ParamField>
<ParamField body="isActive" type="boolean">Setting `false` disables the template (`/apply` will 404 it).</ParamField>

### Response

Returns the updated template wrapped under `data`.

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT 'https://www.wiseyield.co/api/v1/templates/aaaaaaaa.../...' \
    -H "Authorization: Bearer $WISEYIELD_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "isActive": false }'
  ```
</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`           | Template doesn't exist or wasn't created by you |
| `429 RATE_LIMIT_EXCEEDED` | Per-user rate limit reached                     |
| `5xx`                     | Server error                                    |
