---
title: "Replace a skill’s files"
---

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

# Replace a skill’s files

Path: CloudRaker Workspace API › Playbooks

`PATCH /skills/{slug}`

A skill is instructions the agent reads on demand — it never executes, never dispatches and is never approval-gated (actions are the executable, gated layer). `files` replaces the whole map (same validation and caps as create) and bumps `version`. The slug IS the storage key, so this route never renames: a rename is a create plus a delete. `scope`/`playbookId` select which tier is edited (`org` by default); platform skills are code and cannot be edited here. Authorization: organization administrators only. Response `{ data: Skill }`.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `slug` (`updateSkill.path.slug`; string, required)

## Request body

_Required._

- `files` (`updateSkill.files`; map<string>, required) — Markdown files keyed by filename. `SKILL.md` is required and carries the frontmatter (`name`, `description`, optional `requires:` action slugs); siblings are progressive-disclosure references the agent reads on demand.
- `scope` (`updateSkill.scope`; string, optional)
  - one of `"org"`, `"agent"`
- `playbookId` (`updateSkill.playbookId`; string, optional, nullable)

## Example request

```json
{
  "scope": "org",
  "playbookId": "string",
  "files": {
    "property1": "string",
    "property2": "string"
  }
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.cloudraker.com/skills/<slug>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "scope": "org",
  "playbookId": "string",
  "files": {
    "property1": "string",
    "property2": "string"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/skills/<slug>';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    scope: 'org',
    playbookId: 'string',
    files: {property1: 'string', property2: 'string'}
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/skills/<slug>"

payload = {
    "scope": "org",
    "playbookId": "string",
    "files": {
        "property1": "string",
        "property2": "string"
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

The updated skill.

#### Example

```json
{
  "data": {
    "slug": "string",
    "name": "string",
    "description": "string",
    "version": "string",
    "tier": "platform",
    "requires": {
      "actions": [
        "string"
      ]
    },
    "files": {
      "property1": "string",
      "property2": "string"
    }
  }
}
```

- `data` (`updateSkill.response.200.data`; object, required)
  - `slug` (`updateSkill.response.200.data.slug`; string, required)
  - `name` (`updateSkill.response.200.data.name`; string, required)
  - `description` (`updateSkill.response.200.data.description`; string, required)
  - `version` (`updateSkill.response.200.data.version`; string, required)
  - `tier` (`updateSkill.response.200.data.tier`; string, required) — Which tier won this slug. Higher tiers win the whole skill, reference files included.
    - one of `"platform"`, `"org"`, `"agent"`
  - `files` (`updateSkill.response.200.data.files`; map<string>, required) — Markdown files keyed by filename. `SKILL.md` is required and carries the frontmatter (`name`, `description`, optional `requires:` action slugs); siblings are progressive-disclosure references the agent reads on demand.
  - `requires` (`updateSkill.response.200.data.requires`; object, optional) — Action slugs the guidance assumes. Purely informational: a missing action adds a "not available here" banner to what the agent reads — it never gates the read.
    - `actions` (`updateSkill.response.200.data.requires.actions`; array<string>, required)


Source: https://docs.cloudraker.com/workspace/api/playbooks/update-skill/index.md
