Skip to content
AdCrunch
Esc
navigateopen⌘Jpreview

Update a Skill

Updates a Skill. Send every field, and send the base_revision you read. The answer is 409 with error=revision_mismatch if the Skill changed after you read it. It is 409 with error=slug_conflict if the new name gives a slug that already exists.

PATCH/context/skills/{slug}
Authorization
AuthorizationBearer token · headerrequired

Send Authorization: Bearer <credential>. Two credentials work.

An API key (acr_…) is what a server integration uses. Create one in the AdCrunch console under Settings → API keys — see https://docs.adcrunch.dev/account/api-keys. A key is bound to the organization that was active when you created it, and it keeps acting on that organization whatever you do later. It carries the permissions of the member who created it.

A session issued by the AdCrunch sign-in flow also works, which is how the console calls this service from the browser.

Either way the organization comes from the credential. There is no organization parameter.

Path parameters
slugstringrequired
Request body
requiredapplication/json
base_revisionintegerrequired

The revision last read via GET — guards concurrent edits.

min -9007199254740991 · max 9007199254740991
bodystring
min length 1
descriptionstring
min length 1 · max length 500
namestring
min length 1 · max length 120
slugstring

Optional new slug handle (a deliberate rename).

max length 120
Responses
200

The Skill as it now stands.

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.

401

No credential, or one that does not resolve. Send an API key or a session. 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.

404

No Skill with that slug. error is not_found.

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.

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.

Any of:
object
currentRevisionnumberrequired

The revision the row holds now. Re-read, re-apply your edit on top, and send this back as base_revision.

errorstringrequired

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

Allowed:revision_mismatch
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.

object
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 new slug contains no letter or digit. error is invalid_slug.

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 PATCH "https://api.adcrunch.dev/context/skills/string" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "base_revision": -9007199254740991,
  "body": "string",
  "description": "string",
  "name": "string",
  "slug": "string"
}'
Response
{
  "body": "string",
  "createdAt": 0,
  "createdBy": "string",
  "description": "string",
  "id": "string",
  "name": "string",
  "revision": 0,
  "slug": "string",
  "updatedAt": 0
}