> ## Documentation Index
> Fetch the complete documentation index at: https://docs.promptlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Save Skill Collection Version

Create a new saved version of a skill collection.

### Request formats

Use `application/json` to send `file_updates`, `moves`, `deletes`, `commit_message`, and `release_label` directly.

Use `multipart/form-data` to upload a ZIP archive plus metadata encoded as a JSON string in `metadata` or `json`.


## OpenAPI

````yaml POST /api/public/v2/skill-collections/{identifier}/versions
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security:
  - ApiKeyAuth: []
paths:
  /api/public/v2/skill-collections/{identifier}/versions:
    post:
      tags:
        - skill-collections
      summary: Save Skill Collection Version
      operationId: saveSkillCollectionVersionPublic
      parameters:
        - name: identifier
          in: path
          required: true
          schema:
            type: string
          description: Skill collection UUID, name, or root_path.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaveSkillCollectionVersionRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SaveSkillCollectionVersionMultipartRequest'
      responses:
        '201':
          description: Skill collection version created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SaveSkillCollectionVersionResponse'
        '400':
          description: Validation or business rule error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillCollectionErrorResponse'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillCollectionErrorResponse'
        '403':
          description: Invalid workspace_id or plan limit reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillCollectionErrorResponse'
        '404':
          description: Skill collection not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillCollectionErrorResponse'
        '415':
          description: Unsupported content type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillCollectionErrorResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    SaveSkillCollectionVersionRequest:
      type: object
      properties:
        file_updates:
          type: array
          items:
            $ref: '#/components/schemas/FileUpdate'
          default: []
        moves:
          type: array
          items:
            $ref: '#/components/schemas/FileMove'
          default: []
        deletes:
          type: array
          items:
            type: string
          default: []
        commit_message:
          type: string
          nullable: true
        release_label:
          type: string
          nullable: true
    SaveSkillCollectionVersionMultipartRequest:
      type: object
      properties:
        metadata:
          type: string
          description: >-
            JSON string metadata containing `moves`, `deletes`,
            `commit_message`, `release_label`, and `file_updates`.
        json:
          type: string
          description: Alternative metadata JSON string.
        archive:
          type: string
          format: binary
          description: Optional ZIP archive upload.
        zip:
          type: string
          format: binary
          description: Optional ZIP archive upload alias.
    SaveSkillCollectionVersionResponse:
      type: object
      required:
        - success
        - version
      properties:
        success:
          type: boolean
          enum:
            - true
        version:
          $ref: '#/components/schemas/SkillCollectionVersion'
    SkillCollectionErrorResponse:
      type: object
      description: Error response format returned by the public skill collection endpoints.
      properties:
        success:
          type: boolean
          enum:
            - false
          description: Indicates that the request failed.
        message:
          type: string
          description: Error message explaining why the request failed.
      required:
        - success
        - message
    FileUpdate:
      type: object
      required:
        - path
      properties:
        path:
          type: string
        content:
          type: string
          default: ''
    FileMove:
      type: object
      required:
        - old_path
        - new_path
      properties:
        old_path:
          type: string
        new_path:
          type: string
    SkillCollectionVersion:
      type: object
      description: A saved version of a skill collection.
      properties:
        id:
          type: string
          format: uuid
        skill_collection_id:
          type: string
          format: uuid
        workspace_id:
          type: integer
        number:
          type: integer
        root_path_at_version:
          type: string
        provider:
          type: string
          nullable: true
        file_paths:
          type: array
          items:
            type: string
        commit_message:
          type: string
          nullable: true
        release_label:
          type: string
          nullable: true
        archived:
          type: boolean
        created_by:
          type: integer
          nullable: true
        user_email:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          default: false
          description: Indicates that the request failed.
        message:
          type: string
          description: Human-readable error message.
        error:
          type: string
          description: Machine-readable or fallback error message.
      additionalProperties: true
      description: >-
        Standard error response. Some legacy endpoints may return either message
        or error.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  responses:
    ValidationError:
      description: Validation error - request parameters or body are invalid.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/HTTPValidationError'
              - $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````