> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-beta.getzep.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-beta.getzep.com/_mcp/server.

# Create Agent Skill Version

POST https://api.getzep.com/api/v4/agents/{agent_uuid}/skills/{skill_uuid}/versions
Content-Type: application/json

Reference: https://docs-beta.getzep.com/sdk-reference/agent/skill/create-version

## Authentication

- `Authorization` header (required) (prefixed with ` Api-Key  `) — Type "Api-Key" followed by a space and the project API key.

## Request

### Path parameters

- `agent_uuid` (string, required) — Agent UUID
- `skill_uuid` (string, required) — Skill UUID

### Body (application/json)

This endpoint expects a v4.CreateAgentSkillVersionRequest.

- `definition` (v4.SkillDefinition, required)
- `expected_version` (integer, required)

## Response

### 200

OK

- `contract` (map from string to any, optional)
- `created_at` (string, optional)
- `definition` (v4.SkillDefinition, optional)
- `markdown` (string, optional) — Markdown is the agent view of the Skill unless the request selects `markdown_format=full`.
- `self_contained` (boolean, optional)
- `version` (integer, optional)

### 201

Created

- `contract` (map from string to any, optional)
- `created_at` (string, optional)
- `definition` (v4.SkillDefinition, optional)
- `markdown` (string, optional) — Markdown is the agent view of the Skill unless the request selects `markdown_format=full`.
- `self_contained` (boolean, optional)
- `version` (integer, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `error` (v4.ErrorBody, optional)

### 401 Unauthorized Error

Unauthorized

- `error` (v4.ErrorBody, optional)

### 403 Forbidden Error

Forbidden

- `error` (v4.ErrorBody, optional)

### 404 Not Found Error

Not Found

- `error` (v4.ErrorBody, optional)

### 409 Conflict Error

Conflict

- `error` (v4.ErrorBody, optional)

### 503 Service Unavailable Error

Service Unavailable

- `error` (v4.ErrorBody, optional)

## Types

### v4.SkillDefinition

- `agent_versions` (list of string, optional)
- `aliases` (list of string, optional)
- `description` (string, optional)
- `do_not_use_when` (list of string, optional)
- `done_when` (list of string, optional)
- `environments` (list of v4.SkillResource, optional)
- `failures` (list of v4.SkillFailure, optional)
- `kind` (string, optional)
- `name` (string, optional)
- `outputs` (list of string, optional)
- `package_name` (string, optional)
- `preconditions` (list of string, optional)
- `procedure` (list of v4.SkillProcedureStep, optional)
- `related_skills` (list of v4.SkillRelation, optional)
- `sections` (list of v4.SkillDefinitionSection, optional)
- `stop_when` (list of string, optional)
- `task_family` (string, optional)
- `tools` (list of v4.SkillResource, optional)
- `use_when` (list of string, optional)

### v4.ErrorBody

- `code` (string, optional)
- `details` (map from string to any, optional)
- `message` (string, optional)
- `param` (string, optional)
- `request_id` (string, optional)

### v4.SkillResource

- `aliases` (list of string, optional)
- `name` (string, optional)
- `version` (string, optional)

### v4.SkillFailure

- `recover` (list of string, optional)
- `when` (string, optional)

### v4.SkillProcedureStep

- `decision` (string, optional)
- `expect` (list of string, optional)
- `instruction` (string, optional)

### v4.SkillRelation

- `relation` (string, optional)
- `skill` (string, optional)
- `version` (string, optional)

### v4.SkillDefinitionSection

- `heading` (string, optional)
- `id` (string, optional)
- `markdown` (string, optional)

## Examples

### Example 1

**Request**

```json
{
  "definition": {},
  "expected_version": 1
}
```

**Response**

```json
{
  "contract": {},
  "created_at": "string",
  "definition": {
    "agent_versions": [
      "string"
    ],
    "aliases": [
      "string"
    ],
    "description": "string",
    "do_not_use_when": [
      "string"
    ],
    "done_when": [
      "string"
    ],
    "environments": [
      {
        "aliases": [
          "string"
        ],
        "name": "string",
        "version": "string"
      }
    ],
    "failures": [
      {
        "recover": [
          "string"
        ],
        "when": "string"
      }
    ],
    "kind": "string",
    "name": "string",
    "outputs": [
      "string"
    ],
    "package_name": "string",
    "preconditions": [
      "string"
    ],
    "procedure": [
      {
        "decision": "string",
        "expect": [
          "string"
        ],
        "instruction": "string"
      }
    ],
    "related_skills": [
      {
        "relation": "string",
        "skill": "string",
        "version": "string"
      }
    ],
    "sections": [
      {
        "heading": "string",
        "id": "string",
        "markdown": "string"
      }
    ],
    "stop_when": [
      "string"
    ],
    "task_family": "string",
    "tools": [
      {
        "aliases": [
          "string"
        ],
        "name": "string",
        "version": "string"
      }
    ],
    "use_when": [
      "string"
    ]
  },
  "markdown": "string",
  "self_contained": true,
  "version": 1
}
```

### Example 2

**Request**

```json
{
  "definition": {},
  "expected_version": 1
}
```

**Response**

```json
{
  "contract": {},
  "created_at": "string",
  "definition": {
    "agent_versions": [
      "string"
    ],
    "aliases": [
      "string"
    ],
    "description": "string",
    "do_not_use_when": [
      "string"
    ],
    "done_when": [
      "string"
    ],
    "environments": [
      {
        "aliases": [
          "string"
        ],
        "name": "string",
        "version": "string"
      }
    ],
    "failures": [
      {
        "recover": [
          "string"
        ],
        "when": "string"
      }
    ],
    "kind": "string",
    "name": "string",
    "outputs": [
      "string"
    ],
    "package_name": "string",
    "preconditions": [
      "string"
    ],
    "procedure": [
      {
        "decision": "string",
        "expect": [
          "string"
        ],
        "instruction": "string"
      }
    ],
    "related_skills": [
      {
        "relation": "string",
        "skill": "string",
        "version": "string"
      }
    ],
    "sections": [
      {
        "heading": "string",
        "id": "string",
        "markdown": "string"
      }
    ],
    "stop_when": [
      "string"
    ],
    "task_family": "string",
    "tools": [
      {
        "aliases": [
          "string"
        ],
        "name": "string",
        "version": "string"
      }
    ],
    "use_when": [
      "string"
    ]
  },
  "markdown": "string",
  "self_contained": true,
  "version": 1
}
```