---
title: "Activate Skill Endpoint"
method: POST
path: "/v1/skills/{skill_id}/activate"
tags: ["Skills"]
---

# Activate Skill Endpoint

`POST /v1/skills/{skill_id}/activate`

## Request

- Base URL: `https://api.pharia.example.com`
- URL: `https://api.pharia.example.com/v1/skills/{skill_id}/activate`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/aleph-alpha/apis/stateful-responses/docs/v1/skills/:skill_id/activate/post.ts> (a function with typed inputs; its response is checked against the schema)

Toggle the caller's activation of a skill (turn it on or off).

``{"active": true}`` enables the skill for the authenticated caller (an
idempotent upsert); ``{"active": false}`` disables it (an idempotent
delete). The user is always the authenticated caller, never client-supplied.

Authorization is view-only: the caller must be able to *view* the skill
(owned or shared into their scope). ``get_skill_metadata`` enforces that and
yields the skill for the response — a caller who cannot view it gets the
existing 404 ``skill_not_found`` path (no existence leak). A viewer may
always toggle their own activation; the owner may disable their own skill.

## Path parameters

- `skill_id` string, required

## Request body

- SkillActivateRequest: Request body for ``POST /v1/skills/{skill_id}/activate``. ``active=True`` turns the skill on for the authenticated caller (an idempotent upsert of the ``(user_id, skill_id)`` activation row); ``active=False`` turns it off (an idempotent delete). The user is always the authenticated caller, never client-supplied.
  - `active` boolean, required

## Response `200`

Successful Response

- SkillResponse: API response schema for a skill (excludes internal ownership fields). ``metadata`` mirrors the ``default_version`` manifest's ``metadata`` map so callers can read per-skill flags from the list without an extra request per skill to fetch the version manifest.
  - `id` string, required
  - `object` 'skill'
  - `name` string, required
  - `description` string, required
  - `metadata` object
  - `default_version` integer, required
  - `latest_version` integer, required
  - `created_at` integer, required
  - `is_active` boolean

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `413`: Content Too Large
- `422`: Validation errors are returned as 400, not 422. This entry exists because FastAPI generates it automatically.
- `425`: Too Early
- `500`: Internal Server Error
- `501`: Not Implemented
- `502`: Bad Gateway
- `504`: Gateway Timeout

---

[API](https://skmtc.dev/aleph-alpha/apis/stateful-responses.md) - [All operations](https://skmtc.dev/aleph-alpha/apis/stateful-responses/llms.txt) - [OpenAPI document](https://skmtc.dev/aleph-alpha/apis/stateful-responses/revisions/2747297acb54?raw)
