Skip to content

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

NameTypeRequiredDefaultDescription
skill_idstringYesThe ID of the skill, or a built-in skill’s slug.
versionstringYesThe 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.

Statuserror.typeCause and fix
400invalid_request_errorThe 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.
404not_found_errorNo 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
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.zip
Python
client.beta.skills.versions.download("latest", skill_id="8b3f6c1e-2a4d-4f7b-9c1e-5d6a7b8c9d0e").write_to_file("pr-summary.zip")
TypeScript
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()))