Skip to content
AdCrunch
Esc
↑↓navigate↵open⌘Jpreview

Create a Skill

Creates a Skill in your organization. The body is the playbook itself, and the description is what an agent reads to choose it. AdCrunch makes the slug from the name. To set a different slug, send one. The answer is 409 if the slug already exists in your organization.

POST/context/skills
Authorization
AuthorizationBearer token · headerrequired

Send Authorization: Bearer <credential>.

Use an API key (acr_…), from the AdCrunch console under Settings → API keys.

The credential names the organization, and no operation takes an organization parameter.

See https://docs.adcrunch.dev/api/authentication.

Request body
requiredapplication/json
bodystringrequired

The playbook instructions (markdown).

min length 1
descriptionstringrequired

When to use this Skill — what agents read to discover it.

min length 1 · max length 500
namestringrequired

Display name.

min length 1 · max length 120
slugstring

Optional explicit slug handle; normalized to kebab-case. Defaults to one derived from the name.

max length 120
Responses
201

The Skill as created, at revision 1. Send that revision back as base_revision on your first edit.

bodystringrequired

The agent instructions themselves — the SKILL.md-equivalent, in markdown.

createdAtnumberrequired

Milliseconds since the Unix epoch, UTC.

createdBystringrequired
descriptionstringrequired
idstringrequired
namestringrequired
revisionnumberrequired

Increments on every write. Send it back as base_revision to edit; a stale one answers 409.

slugstringrequired
updatedAtnumber | nullrequired

Milliseconds since the Unix epoch, UTC.

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.

issuesobject[]required

One entry for each field that does not match.

Show properties
Array of object
instringrequired

The part of the request that holds the field.

Allowed:bodycookieheadersparamsquery
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

pathstringrequired

A JSON Pointer into that part of the request, such as /filename. An empty string is the whole part.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:invalid_request
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

401

No API key, or one that does not resolve. See the security scheme. error is unauthorized.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:unauthorized
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

403

The caller does not hold skill:write. error is forbidden.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:forbidden
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

409

Another Skill in this organization already holds that slug. error is slug_conflict.

slugstringrequired

The slug that is already taken.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

Allowed:slug_conflict
messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

422

The name and slug together contain no letter or digit, so no handle can be derived. error is invalid_slug. A body that fails the schema answers with the framework shape instead.

errorstringrequired

A stable code for the failure. This is the field to branch on. It does not change for a given failure.

messagestringrequired

A sentence to show a person. Written to say what to do next. Reworded whenever it can be said better, so never branch on it.

Request
curl -X POST "https://api.pr-701.adcrunch.dev/context/skills" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "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.",
  "description": "Use this every Monday to move budget towards the campaigns that reach the target cost per action.",
  "name": "Weekly budget review",
  "slug": "weekly-budget-review"
}'
Response
{
  "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 to move budget towards the campaigns that reach the target cost per action.",
  "id": "skl_2d7e14",
  "name": "Weekly budget review",
  "revision": 1,
  "slug": "weekly-budget-review",
  "updatedAt": null
}