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

# Bot Skills API

> List, create, update, restore and delete a bot's skills over REST, for example to keep them in version control

[Bot skills](https://docs.chatbotplatform.io/bots/channels/user-skills.md#bot-skills-and-customisation) are processes every person who chats with a bot gets. Everything the **Skills** page of the dashboard does is also available over REST, so you can keep a bot's skills next to your code and sync them on deploy.

## Authentication

Create an API token under **API Tokens** in your account menu and tick the **skills** permission. Send it as a bearer token:

```bash theme={null}
Authorization: Bearer YOUR_API_TOKEN
```

* A token without the **skills** permission gets `403` on every endpoint.
* The bot must belong to one of your teams. Any other bot id answers `404 bot_not_found`, whether it exists or not.
* **Reading** is open to every member of the bot's team. **Writing** (create, update, delete, restore) also needs a team role with the `update` permission (Administrator or Editor), else `403 team_permission_required`.

Keep the token on your server. Never put it in a web page or the widget.

## Base URL

```
https://app.chatbotplatform.io/api/v1
```

`{bot}` is the bot's numeric id (shown in the dashboard URL, `/bots/{id}`). `{name}` is the skill's name, the slug you gave it (`weekly-report`); upper-case letters are lower-cased.

## The skill object

```json theme={null}
{
  "id": "9d1c6f1e-6a3b-4c62-9b2a-0f4f6b0c2a11",
  "name": "weekly-report",
  "summary": "Build and post the weekly sales report",
  "content": "1. Fetch last week's orders with the CRM tools.\n2. Summarise them per region.\n3. Present a table, totals last.",
  "version": 3,
  "enabled": true,
  "use_count": 42,
  "last_used_at": "2026-11-10T09:12:44+00:00",
  "override_count": 2,
  "created_at": "2026-11-01T14:00:00+00:00",
  "updated_at": "2026-11-09T16:30:12+00:00"
}
```

| Field | Meaning |
| - | - |
| `name` | Slug, 2 to 64 lowercase letters, digits and dashes. **Cannot change** after creation |
| `summary` | The one line the agent sees in its prompt, up to 200 characters |
| `content` | The process itself, up to 20 000 characters. Left out of the list endpoint |
| `version` | Goes up by one whenever `summary` or `content` changes. Send it back as `expected_version` to avoid overwriting someone else's change |
| `enabled` | `false` hides the skill from every conversation without deleting it |
| `use_count`, `last_used_at` | How often the agent fetched this skill's steps |
| `override_count` | How many people have their own version of a skill with this name, which replaces this one for them |

## Endpoints

| Method | Path | What it does |
| - | - | - |
| `GET` | `/bots/{bot}/skills` | List the skills |
| `POST` | `/bots/{bot}/skills` | Create a skill |
| `GET` | `/bots/{bot}/skills/{name}` | One skill, with its content |
| `PATCH` | `/bots/{bot}/skills/{name}` | Change summary, content or `enabled` |
| `DELETE` | `/bots/{bot}/skills/{name}` | Delete a skill |
| `GET` | `/bots/{bot}/skills/{name}/revisions` | The kept versions |
| `POST` | `/bots/{bot}/skills/{name}/revisions/{version}/restore` | Restore an old version |

### List skills

`GET /bots/{bot}/skills` returns the bot's enabled skills by name, without `content`. Add `?include_disabled=1` to include switched-off ones.

```bash theme={null}
curl https://app.chatbotplatform.io/api/v1/bots/42/skills?include_disabled=1 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
```

```json theme={null}
{
  "data": [
    { "id": "…", "name": "weekly-report", "summary": "Build and post the weekly sales report", "version": 3, "enabled": true, "use_count": 42, "last_used_at": "…", "override_count": 2, "created_at": "…", "updated_at": "…" }
  ]
}
```

### Create a skill

`POST /bots/{bot}/skills` with `name`, `summary`, `content` and optionally `enabled` (default `true`). Answers `201` with the skill at version 1. Every conversation of the bot lists it from the next reply on.

```bash theme={null}
curl -X POST https://app.chatbotplatform.io/api/v1/bots/42/skills \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "weekly-report",
    "summary": "Build and post the weekly sales report",
    "content": "1. Fetch last week'\''s orders with the CRM tools.\n2. Summarise them per region.\n3. Present a table, totals last."
  }'
```

A name that is already in use answers `422 skill_name_taken`; the 51st skill of a bot answers `422 skill_limit_reached`.

### Get a skill

`GET /bots/{bot}/skills/{name}` returns the skill with its `content`.

### Update a skill

`PATCH /bots/{bot}/skills/{name}` takes any of:

| Field | |
| - | - |
| `summary` | New summary |
| `content` | New content |
| `enabled` | `true` / `false`. Changing only this does not create a new version |
| `expected_version` | The version you last read. If the skill has moved on since, nothing is saved and you get `409` |

```bash theme={null}
curl -X PATCH https://app.chatbotplatform.io/api/v1/bots/42/skills/weekly-report \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{ "content": "1. Fetch last week'\''s orders.\n2. Summarise per region, with totals.", "expected_version": 3 }'
```

A version conflict carries the current skill so you can compare and retry:

```json theme={null}
{
  "message": "This skill changed since you read it (you sent version 3, it is now version 4). Nothing was saved. Compare with the current skill and send again.",
  "code": "version_mismatch",
  "skill": { "name": "weekly-report", "version": 4, "...": "…" }
}
```

A `name` in the body is refused with `422 skill_name_immutable`: create a skill under the new name and delete the old one.

> [!NOTE]
>
> Changing a bot skill never changes the versions people customised for themselves. Their copy stays as it is; the dashboard marks it with **bot default changed**.

### Delete a skill

`DELETE /bots/{bot}/skills/{name}` answers `204`. The skill leaves every conversation from the next reply on and its name is free again. People's own skills of the same name stay as their own skills.

### List revisions

`GET /bots/{bot}/skills/{name}/revisions` returns the newest 10 versions, newest first:

```json theme={null}
{
  "data": [
    { "version": 4, "summary": "…", "content": "…", "changed_by": { "id": 7, "name": "Alex" }, "created_at": "…" },
    { "version": 3, "summary": "…", "content": "…", "changed_by": null, "created_at": "…" }
  ]
}
```

### Restore a revision

`POST /bots/{bot}/skills/{name}/revisions/{version}/restore` copies what that version said into the skill and saves it as a **new** version (nothing changes when the skill already says it). Returns the skill. A version that is not kept answers `404 revision_not_found`.

## Errors

Errors are JSON with a human-readable `message` and a stable `code`:

```json theme={null}
{ "message": "This bot has no skill named `weekly-reprot`.", "code": "skill_not_found" }
```

| Status | `code` | When |
| - | - | - |
| `401` | | No token, or an invalid one |
| `403` | | The token lacks the **skills** permission |
| `403` | `team_permission_required` | A write with a team role that cannot `update` |
| `404` | `bot_not_found` | The bot is not in any of your teams |
| `404` | `skill_not_found` | No live skill of that name on this bot |
| `404` | `revision_not_found` | That version is not kept |
| `409` | `version_mismatch` | `expected_version` is out of date; `skill` holds the current one |
| `422` | `validation_failed` | A field is missing or of the wrong type; `errors` lists them per field |
| `422` | `skill_invalid` | The name is not a valid slug, or the summary / content is too long |
| `422` | `skill_name_taken` | Another live skill of this bot has that name |
| `422` | `skill_limit_reached` | The bot already has 50 skills |
| `422` | `skill_name_immutable` | A `name` was sent to `PATCH` |

## Next steps

> [card] [Skills](https://docs.chatbotplatform.io/bots/channels/user-skills.md)
>
> How bot skills and personal skills work together

> [card] [Bot skills and customisation](https://docs.chatbotplatform.io/bots/channels/user-skills.md#bot-skills-and-customisation)
>
> How people customise a bot skill and revert


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.