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

# Snippets API

> CRUD endpoints for context snippets

## List Snippets

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

Returns all context snippets for a project.

```json theme={null}
[
  {
    "id": 1,
    "projectId": 1,
    "name": "Code Style",
    "content": "Use TypeScript strict mode...",
    "enabled": true,
    "createdAt": "2025-01-15T10:00:00Z"
  }
]
```

## Get Snippet

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

## Create Snippet

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

```json theme={null}
{
  "name": "Code Style",
  "content": "Use TypeScript strict mode.\nPrefer functional components.\nUse named exports.",
  "enabled": true
}
```

| Field     | Required | Default | Description                        |
| --------- | -------- | ------- | ---------------------------------- |
| `name`    | Yes      | —       | Display name for the snippet       |
| `content` | Yes      | —       | Text injected into Claude's prompt |
| `enabled` | No       | `true`  | Whether to include in prompts      |

## Update Snippet

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

Accepts the same fields as Create. Only included fields are updated.

<Tip>Toggle a snippet off by sending `{ "enabled": false }` — this preserves the content while excluding it from future prompts.</Tip>

## Delete Snippet

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

<Note>Deleting a snippet is permanent. If you want to temporarily remove it from prompts, disable it instead.</Note>
