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

# List Templates

> Get available artifact type templates

# List Templates

Retrieve all artifact type templates available to you.

## Endpoint

```
GET /templates
```

## Request

### Headers

| Header         | Required | Description     |
| -------------- | -------- | --------------- |
| `X-API-Key`    | Yes      | Your API key    |
| `X-API-Secret` | Yes      | Your API secret |

### Query Parameters

| Parameter | Type    | Required | Description                                                              |
| --------- | ------- | -------- | ------------------------------------------------------------------------ |
| `status`  | string  | No       | Filter by status: `draft`, `pending_approval`, `published`, `deprecated` |
| `page`    | integer | No       | Page number (default: 1)                                                 |
| `limit`   | integer | No       | Items per page (default: 20, max: 100)                                   |

## Example Request

```bash theme={null}
curl -X GET "https://api.docyard.io/v1/templates?status=published&limit=10" \
  -H "X-API-Key: dk_live_dist_aaaaaaaa" \
  -H "X-API-Secret: dk_secret_dist_bbbbbbbb"
```

## Response

### Success (200 OK)

```json theme={null}
{
  "templates": [
    {
      "template_id": "tmpl-ins-dec-001",
      "name": "Insurance Declaration Page",
      "description": "Standard insurance declaration document",
      "status": "published",
      "owner": {
        "id": "dist-abc123",
        "name": "Acme Insurance"
      },
      "locks_count": 6,
      "required_locks_count": 3,
      "created_at": "2026-03-10T09:00:00Z",
      "published_at": "2026-03-12T14:00:00Z"
    },
    {
      "template_id": "tmpl-ins-end-001",
      "name": "Insurance Endorsement",
      "description": "Policy endorsement document",
      "status": "published",
      "owner": {
        "id": "dist-abc123",
        "name": "Acme Insurance"
      },
      "locks_count": 5,
      "required_locks_count": 2,
      "created_at": "2026-03-11T10:00:00Z",
      "published_at": "2026-03-13T11:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 2,
    "total_pages": 1
  }
}
```

### Response Fields

| Field                  | Type    | Description                                 |
| ---------------------- | ------- | ------------------------------------------- |
| `template_id`          | string  | Unique template identifier                  |
| `name`                 | string  | Template name                               |
| `description`          | string  | Template description                        |
| `status`               | string  | Current status                              |
| `owner`                | object  | Template owner information                  |
| `locks_count`          | integer | Total number of locks                       |
| `required_locks_count` | integer | Number of required locks                    |
| `created_at`           | string  | Creation timestamp                          |
| `published_at`         | string  | When template was published (if applicable) |

## Error Responses

### Unauthorized (401)

```json theme={null}
{
  "error": "invalid_api_key",
  "message": "The provided API key is invalid",
  "request_id": "req-abc123xyz"
}
```

### Forbidden (403)

```json theme={null}
{
  "error": "access_denied",
  "message": "You do not have permission to view templates",
  "request_id": "req-abc123xyz"
}
```

## Code Examples

### Node.js

```javascript theme={null}
const templates = await client.templates.list({
  status: 'published',
  limit: 10
});

console.log(templates.data);
```

### Python

```python theme={null}
templates = client.templates.list(
    status='published',
    limit=10
)

print(templates['templates'])
```

### Go

```go theme={null}
templates, err := client.Templates.List(&docyard.ListTemplatesOptions{
    Status: "published",
    Limit: 10,
})
```

***

## Related Endpoints

* [Create Template](/api-reference/artifact-types/create) - Create a new template
* [Get Template](/api-reference/artifact-types/get) - Get template details
