> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/stackai-api/rest-api-v2/skills-and-versions/post-v2-skills-skill_id-versions.md).

# POST /v2/skills/{skill\_id}/versions

## Create Skill Version

> Publish a new version, optionally carrying files from a previous version.\
> \
> \*\*How to use\*\*\
> \
> Publish a new revision. Repeat carry\_paths for files to keep; base\_version selects the source version (current by default). Supplying a different name can rename the skill. Review the assembled bundle before publishing.\
> \
> \*\*Authentication and permissions\*\*\
> \
> Required permissions: \`skills.update\`. Resource and owner access checks also apply.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"tags":[{"name":"endpoint-createSkillVersionV2"}],"servers":[{"url":"https://api.stack-ai.com","description":"Hosted API. Use your deployment-specific origin for private installations."}],"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer","description":"Personal API key (sk_...) or supported user access JWT. See Authentication and authorization for endpoint restrictions and scopes. Use exactly one Authorization header."}},"schemas":{"Body_createSkillVersionV2":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files","description":"Bundle files; each part's filename is its relative POSIX path inside the bundle (optionally under one shared root folder). A single .zip is accepted as an alternative."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Skill name (form mode); a changed name renames the skill when published."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Skill description (form mode)."},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"SKILL.md body (form mode)."},"actions":{"items":{"type":"string"},"type":"array","title":"Actions","description":"Action refs; repeat the field per item."},"carry_paths":{"items":{"type":"string"},"type":"array","title":"Carry Paths","description":"File paths to carry over unchanged from the current files; repeat the field per item."},"base_version":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Base Version","description":"Version to copy carry_paths from; defaults to the current version."}},"type":"object","title":"Body_createSkillVersionV2"},"StackAIAPIDataResponse_SkillVersionResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided."},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{}},"data":{"$ref":"#/components/schemas/SkillVersionResponseV2","description":"Data returned by the API service"}},"type":"object","required":["data"],"title":"StackAIAPIDataResponse[SkillVersionResponseV2]"},"SkillVersionResponseV2":{"properties":{"version":{"type":"integer","title":"Version"},"description":{"type":"string","title":"Description"},"created_by_user_profile":{"anyOf":[{"$ref":"#/components/schemas/SkillCreatorResponseV2"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"instructions":{"type":"string","title":"Instructions"},"frontmatter":{"additionalProperties":true,"type":"object","title":"Frontmatter"},"actions":{"items":{"type":"string"},"type":"array","title":"Actions"},"files":{"items":{"$ref":"#/components/schemas/SkillFileResponseV2"},"type":"array","title":"Files"}},"type":"object","required":["version","description","created_by_user_profile","created_at","instructions"],"title":"SkillVersionResponse"},"SkillCreatorResponseV2":{"properties":{"id":{"type":"string","title":"Id"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"}},"type":"object","required":["id","full_name"],"title":"SkillCreatorResponse"},"SkillFileResponseV2":{"properties":{"path":{"type":"string","title":"Path"},"content_type":{"type":"string","title":"Content Type"},"size":{"type":"integer","title":"Size"}},"type":"object","required":["path","content_type","size"],"title":"SkillFileResponse"},"StackAIAPIErrorResponse":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided."},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{}},"errors":{"items":{"$ref":"#/components/schemas/StackAIAPIError"},"type":"array","title":"Errors","description":"List of errors"},"detail":{"items":{"type":"string"},"type":"array","title":"Detail","description":"Human-readable error messages. Use the HTTP status and error metadata to decide how to handle the failure.","readOnly":true}},"type":"object","required":["detail"],"title":"StackAIAPIErrorResponse","description":"Error response model with status code and error list."},"StackAIAPIError":{"properties":{"message":{"type":"string","title":"Message","description":"Message describing the error"}},"type":"object","required":["message"],"title":"StackAIAPIError","description":"Error detail model."}}},"paths":{"/v2/skills/{skill_id}/versions":{"post":{"tags":["endpoint-createSkillVersionV2"],"summary":"Create Skill Version","description":"Publish a new version, optionally carrying files from a previous version.\n\n**How to use**\n\nPublish a new revision. Repeat carry_paths for files to keep; base_version selects the source version (current by default). Supplying a different name can rename the skill. Review the assembled bundle before publishing.\n\n**Authentication and permissions**\n\nRequired permissions: `skills.update`. Resource and owner access checks also apply.","operationId":"createSkillVersionV2","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"ID of the skill.","title":"Skill Id"},"description":"ID of the skill."}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_createSkillVersionV2"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIDataResponse_SkillVersionResponseV2_"}}},"headers":{"Location":{"description":"URL of the created resource","schema":{"type":"string"}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"401":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"403":{"description":"Permission denied; insufficient API-key scope includes meta.required_scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"404":{"description":"Skill or version not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"409":{"description":"Name or version conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"422":{"description":"Invalid skill bundle, including oversized uploads","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"500":{"description":"Skill persistence failed; internal details are not exposed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"4XX":{"description":"Other client errors use the same public error envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/stackai-api/rest-api-v2/skills-and-versions/post-v2-skills-skill_id-versions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
