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

# Templates API

> CRUD endpoints for prompt templates

## List Templates

```http theme={null}
GET /api/projects/:projectId/templates
```

Returns all prompt templates for a project.

```json theme={null}
[
  {
    "id": 1,
    "projectId": 1,
    "name": "Feature Template",
    "content": "You are working on {{project_name}}...",
    "taskType": "feature",
    "model": "sonnet",
    "thinkingEffort": "medium",
    "createdAt": "2025-01-15T10:00:00Z"
  }
]
```

## Get Template

```http theme={null}
GET /api/projects/:projectId/templates/:id
```

## Create Template

```http theme={null}
POST /api/projects/:projectId/templates
Content-Type: application/json
```

```json theme={null}
{
  "name": "Feature Template",
  "content": "You are working on {{project_name}}.\nTask: {{task_title}}\nType: {{task_type}}\n\nWrite clean, tested code.",
  "taskType": "feature",
  "model": "sonnet",
  "thinkingEffort": "medium"
}
```

| Field            | Required | Default | Description                                 |
| ---------------- | -------- | ------- | ------------------------------------------- |
| `name`           | Yes      | —       | Template display name                       |
| `content`        | Yes      | —       | Template text with optional `{{variables}}` |
| `taskType`       | No       | —       | Auto-apply to this task type                |
| `model`          | No       | —       | Default model when template is used         |
| `thinkingEffort` | No       | —       | Default thinking effort                     |

### Template Variables

| Variable           | Resolves To                       |
| ------------------ | --------------------------------- |
| `{{project_name}}` | Project name                      |
| `{{task_title}}`   | Task title                        |
| `{{task_type}}`    | Task type (feature, bugfix, etc.) |
| `{{priority}}`     | Priority level                    |
| `{{model}}`        | Selected model                    |

## Update Template

```http theme={null}
PUT /api/projects/:projectId/templates/:id
Content-Type: application/json
```

Accepts the same fields as Create.

## Delete Template

```http theme={null}
DELETE /api/projects/:projectId/templates/:id
```
