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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
skill_id | string | Yes | The 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.
| Status | error.type | Cause and fix |
|---|---|---|
| 400 | invalid_request_error | The skill is a built-in skill, which is read-only. Check that the ID is a custom skill’s. |
| 403 | permission_error | The 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. |
| 404 | not_found_error | No skill with this ID exists, or the key’s owner can’t read it. Check the ID. |
Example
curl -sS -X DELETE "$CONTEXT_BASE_URL/v1/skills/8b3f6c1e-2a4d-4f7b-9c1e-5d6a7b8c9d0e" -H "x-api-key: $CONTEXT_API_KEY"client.beta.skills.delete("8b3f6c1e-2a4d-4f7b-9c1e-5d6a7b8c9d0e")await client.beta.skills.delete("8b3f6c1e-2a4d-4f7b-9c1e-5d6a7b8c9d0e")