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

# Roles API

> CRUD endpoints for agent roles (system prompts)

Roles define custom system prompts that shape how Claude agents behave when working on tasks. A role can be assigned to individual tasks to customize agent behavior.

## List Roles

```javascript theme={null}
invoke('get_roles', { projectId: 1 })
```

Returns all roles for a project.

```json theme={null}
[
  {
    "id": 1,
    "projectId": 1,
    "name": "Backend Developer",
    "systemPrompt": "You are a senior backend developer...",
    "isGlobal": false,
    "createdAt": "2025-01-15T10:00:00Z"
  }
]
```

## List Global Roles

```javascript theme={null}
invoke('get_global_roles')
```

Returns all roles not tied to a specific project. Global roles are available across all projects.

## Create Role

```javascript theme={null}
invoke('create_role', {
  projectId: 1,
  name: "Backend Developer",
  systemPrompt: "You are a senior backend developer specializing in Rust and TypeScript...",
  isGlobal: false
})
```

| Field          | Required | Default | Description                                  |
| -------------- | -------- | ------- | -------------------------------------------- |
| `projectId`    | Yes      | --      | Project to associate the role with           |
| `name`         | Yes      | --      | Role display name                            |
| `systemPrompt` | Yes      | --      | System prompt injected into Claude's context |
| `isGlobal`     | No       | `false` | Make role available across all projects      |

## Update Role

```javascript theme={null}
invoke('update_role', {
  id: 1,
  name: "Senior Backend Developer",
  systemPrompt: "Updated system prompt...",
  isGlobal: false
})
```

Accepts the same fields as Create. All fields are required on update.

## Delete Role

```javascript theme={null}
invoke('delete_role', { id: 1 })
```

<Warning>Deleting a role does not affect tasks that were previously assigned to it. Those tasks will continue to work without a role-specific system prompt.</Warning>
