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

# List templates

> List task templates accessible to the user (own + global by default).

```
GET https://www.wiseyield.co/api/v1/templates
```

### Authentication

Requires a key with the `tasks:read` scope. See [Authentication](/authentication).

### Query parameters

<ParamField query="page" type="integer" default="1">Page number (≥ 1).</ParamField>
<ParamField query="limit" type="integer" default="20">Results per page (1–100).</ParamField>
<ParamField query="farmId" type="string">Limit to templates either bound to this farm OR farm-agnostic.</ParamField>
<ParamField query="category" type="string">Filter by category (one of the 10 task categories).</ParamField>
<ParamField query="includeGlobal" type="string" default="true">`"false"` to exclude global templates and only return user-owned ones.</ParamField>

### Response

<ResponseField name="data" type="array">
  Array of template objects.

  <Expandable title="Template">
    <ResponseField name="id" type="string">UUID.</ResponseField>
    <ResponseField name="name" type="string">Template name.</ResponseField>
    <ResponseField name="description" type="string | null">Free text.</ResponseField>
    <ResponseField name="farmId" type="string | null">Parent farm UUID. `null` = farm-agnostic.</ResponseField>
    <ResponseField name="category" type="string">One of `planting`, `irrigation`, `fertilization`, `pest_control`, `harvesting`, `soil_management`, `maintenance`, `planning`, `inspection`, `other`.</ResponseField>
    <ResponseField name="priority" type="string">Default priority for tasks created from this template.</ResponseField>
    <ResponseField name="estimatedDuration" type="string | null">Free text.</ResponseField>
    <ResponseField name="defaultAssignee" type="string | null">Default assignee for new tasks.</ResponseField>
    <ResponseField name="isGlobal" type="boolean">Visible to all users when `true`.</ResponseField>
    <ResponseField name="isActive" type="boolean">Templates that are inactive can't be applied.</ResponseField>
    <ResponseField name="createdBy" type="string">Creator user ID.</ResponseField>
    <ResponseField name="createdAt" type="string">ISO 8601.</ResponseField>
    <ResponseField name="updatedAt" type="string">ISO 8601.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object">Offset pagination envelope.</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl 'https://www.wiseyield.co/api/v1/templates?category=irrigation' \
    -H "Authorization: Bearer $WISEYIELD_API_KEY"
  ```
</RequestExample>

## Errors

| Status                    | When                                            |
| ------------------------- | ----------------------------------------------- |
| `401`                     | Missing, malformed, expired, or revoked API key |
| `403 INSUFFICIENT_SCOPE`  | Key lacks `tasks:read` scope                    |
| `429 RATE_LIMIT_EXCEEDED` | Per-user rate limit reached                     |
| `5xx`                     | Server error                                    |
