Skip to content

Delete a skill

DELETE /v1/skills/{skill_id}

Deletes a skill, its versions and their files.

The skill is also removed from every agent it is assigned to. A built-in skill can’t be deleted. The key’s owner must be able to edit the skill. The delete can’t be undone. In some organizations the skill’s files are kept in Drive trash until the trash is emptied.

The key must be a personal key with the skills:write capability. For what each capability allows, see Keys.

Path parameters

NameTypeRequiredDefaultDescription
skill_idstringYesThe ID of the skill to delete.

Response

Returns 200 with an object that holds the skill’s id and a type of skill_deleted.

{
"id": "8b3f6c1e-2a4d-4f7b-9c1e-5d6a7b8c9d0e",
"type": "skill_deleted"
}

Errors

This endpoint can return these errors as well as the common errors.

Statuserror.typeCause and fix
400invalid_request_errorThe skill is a built-in skill, which is read-only. Check that the ID is a custom skill’s.
403permission_errorThe key lacks skills:write, is not a personal key, or its owner can’t edit this skill. Use a personal key with skills:write whose owner can edit the skill.
404not_found_errorNo skill with this ID exists, or the key’s owner can’t read it. Check the ID.

Example

cURL
curl -sS -X DELETE "$CONTEXT_BASE_URL/v1/skills/8b3f6c1e-2a4d-4f7b-9c1e-5d6a7b8c9d0e" -H "x-api-key: $CONTEXT_API_KEY"
Python
client.beta.skills.delete("8b3f6c1e-2a4d-4f7b-9c1e-5d6a7b8c9d0e")
TypeScript
await client.beta.skills.delete("8b3f6c1e-2a4d-4f7b-9c1e-5d6a7b8c9d0e")