---
title: "Edit a skill as a draft"
method: POST
path: "/api/v1/skills/{skill_id}/revisions"
tags: ["authed"]
---

# Edit a skill as a draft

`POST /api/v1/skills/{skill_id}/revisions`

## Request

- Base URL: `https://api.teaflask.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.teaflask.com/api/v1/skills/{skill_id}/revisions`
- Auth: none declared

Save an edit to a skill's SKILL.md as a draft revision; it isn't
live until published with publish_skill. Read the skill with get_skill
just before editing and pass its latest_revision.id as
parent_revision_id and latest_revision.content_version as
parent_content_version. If anyone changed the skill since that read,
nothing is stored and you're told so: read it again, reapply your
edit, and save again.

## Path parameters

- `skill_id` string, uuid, required: The skill's id, as list_skills returns it.

## Request body

- CreateSkillRevisionRequest: Saving an edit: the revision the editor started from becomes the parent — lineage is how history and future diffs work.
  - `content` string, required: The whole SKILL.md, shaped like get_skill's latest_revision.content; its frontmatter name must stay the skill's.
  - `parent_revision_id` string, uuid, required: latest_revision.id from get_skill, read just before editing.
  - `parent_content_version` integer, required: latest_revision.content_version from the same read.
  - `amend_working_draft` boolean: Leave false unless re-saving a draft you just saved. When true and latest_revision is your own unpublished draft saved in the last 30 minutes, that draft is updated in place and keeps its id; otherwise a new draft revision is added with a new id.

## Response `200`

The editor's open working draft was amended in place

- SkillRevisionResponse
  - `id` string, uuid, required: The revision's id.
  - `skill_id` string, uuid, required: The skill it belongs to.
  - `parent_revision_id` string, uuid, nullable, required: The revision this one was edited from; null for the first.
  - `content` string, required: The whole SKILL.md as written: frontmatter, then the instructions.
  - `description` string, required: What the skill is for, from the frontmatter; agents read it to decide when to load the skill.
  - `metadata` object, required: The frontmatter's metadata map, as written.
  - `license` string, nullable, required: The license the frontmatter names; null when none.
  - `instructions` string, required: The instructions an agent follows once it loads the skill: the SKILL.md body after the frontmatter.
  - `content_format` 'skill/v1', required: Versions of the SKILL.md dialect; evolves additively, never in place. skill/v1 is the agentskills.io shape the skillv1 write gate enforces.
  - `status` 'draft' | 'published' | 'superseded', required
  - `authored_by_user_id` string, uuid, required: The member who wrote it.
  - `content_version` integer, required: Changes each time this revision is edited in place; send it back as parent_content_version.
  - `created_at` string, date-time, required: When the revision was created.
  - `updated_at` string, date-time, required: When the revision last changed: an edited draft or a status change.

## Other responses

- `201`: Successful Response
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `405`: Method not allowed
- `422`: Validation error
- `500`: Internal server error

## Changes

- **2026-11-03** `c6ac9fd6657f`: 6 info
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `401`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `403`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `404`
  - removed the `STEEP_LEARNING_DISABLED` enum value from the `error/code` response property for the response status `405`
  - …2 more

[Operation history](https://skmtc.dev/teaflask/apis/teaflask-api/changes/api/v1/skills/:skill_id/revisions/post.md)

---

[API](https://skmtc.dev/teaflask/apis/teaflask-api.md) - [All operations](https://skmtc.dev/teaflask/apis/teaflask-api/llms.txt) - [OpenAPI document](https://skmtc.dev/teaflask/apis/teaflask-api/revisions/c6ac9fd6657f?raw)
