---
search:
  tags:
    - Skills
    - PATCH
seo:
  description: >-
    Updates a Skill. Send only the fields you change, with the base_revision
    you… Reference for the PATCH /context/skills/{slug} endpoint in the AdCrunch
    API.
sidebar:
  label: Update a Skill
  badge: PATCH
title: Update a Skill
type: openapi-operation
---
Updates a Skill. Send only the fields you change, with the `base_revision` you read. A field you omit keeps its value. The slug changes only when you send a `slug`: a new `name` alone never moves the handle. The answer is `409` with `error=revision_mismatch` if the Skill changed after you read it. It is `409` with `error=slug_conflict` if another Skill already holds the `slug` you send. An update keeps the `source` of an imported Skill.

`PATCH /context/skills/{slug}`

**Request body** (`application/json`, required)

- `base_revision` (integer, required) — The revision last read via GET — guards concurrent edits.
- `body` (string) — The whole new playbook (markdown), at most 50,000 characters. It replaces the old one.
- `description` (string)
- `name` (string)
- `slug` (string) — Optional new slug handle (a deliberate rename).

Request body example:

```json
{
  "base_revision": 3,
  "description": "Use this every Monday, and after any change of budget, to move spend towards the campaigns that reach the target cost per action."
}
```

**Responses**

- `200` — The Skill as it now stands, at the next \`revision\`. Send that one back on your next edit.
- `400` — The request does not match the schema of this operation: a field is missing or has the wrong type, or the body is not valid JSON. \`error\` is \`invalid\_request\`, and \`issues\` names each field. Nothing was changed.
- `401` — No API key, or one that does not resolve. See the security scheme. \`error\` is \`unauthorized\`.
- `402` — The organization has no active subscription. An owner subscribes at \`paywallUrl\`. \`error\` is \`organization\_unentitled\`.
- `403` — The caller does not hold \`skill:write\`. \`error\` is \`forbidden\`.
- `404` — No Skill with that slug. \`error\` is \`not\_found\`.
- `409` — Two different conflicts share this status, and \`error\` tells them apart. \`revision\_mismatch\` means somebody else wrote first — re-read, re-apply your edit, and send the \`currentRevision\` back. \`slug\_conflict\` means the rename collides with another Skill.
- `422` — The new slug contains no letter or digit. \`error\` is \`invalid\_slug\`.

Response example, 200:

```json
{
  "body": "## When to run\n\nEvery Monday, before the week starts.\n\n## Steps\n\n1. Read the last seven days of spend for each live campaign.\n2. Move budget to the campaigns under the target cost per action.\n3. Write down what you changed, and why.",
  "createdAt": 1790000000000,
  "createdBy": "usr_4d8b12",
  "description": "Use this every Monday, and after any change of budget, to move spend towards the campaigns that reach the target cost per action.",
  "id": "skl_2d7e14",
  "name": "Weekly budget review",
  "revision": 4,
  "slug": "weekly-budget-review",
  "source": null,
  "updatedAt": 1790086400000
}
```
