Download a skill version
GET /v1/skills/{skill_id}/versions/{version}/content
Returns a version’s files as one zip archive.
The archive holds SKILL.md and the supporting files under one folder named after the skill’s name, the same layout that Create a skill version accepts. The zip file has the same name. If a skill made in the Context app has a name with other characters than lowercase letters, digits and hyphens, the folder name is rewritten in those characters, so Q3 / Q4 report becomes q3-q4-report. If no letters or digits are left, the folder is named after the skill’s ID. Pass latest as version for the newest version.
The key must have the skills:read capability. For what each capability allows, see Keys.
Path parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
skill_id | string | Yes | The ID of the skill, or a built-in skill’s slug. | |
version | string | Yes | The version’s ID, or latest. |
Response
Returns 200 with a zip archive. The content-type response header is application/zip, and content-disposition names the file after the skill, such as pr-summary.zip.
Errors
This endpoint can return these errors as well as the common errors.
| Status | error.type | Cause and fix |
|---|---|---|
| 400 | invalid_request_error | The version was saved before your deployment stored skill file contents, so the server has no files to return. Download a later version. If none exists, upload the skill’s files again as a new version. |
| 404 | not_found_error | No skill with this ID or slug exists, the key’s owner can’t read it, or the version is not one of this skill’s. Check skill_id and version, and that the key’s owner can read the skill. |
Example
curl -sS "$CONTEXT_BASE_URL/v1/skills/8b3f6c1e-2a4d-4f7b-9c1e-5d6a7b8c9d0e/versions/latest/content" -H "x-api-key: $CONTEXT_API_KEY" -o pr-summary.zipclient.beta.skills.versions.download("latest", skill_id="8b3f6c1e-2a4d-4f7b-9c1e-5d6a7b8c9d0e").write_to_file("pr-summary.zip")import { writeFile } from "node:fs/promises"
const response = await client.beta.skills.versions.download("latest", { skill_id: "8b3f6c1e-2a4d-4f7b-9c1e-5d6a7b8c9d0e" })await writeFile("pr-summary.zip", Buffer.from(await response.arrayBuffer()))