> ## 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.

# Create Skill Collection

Create a new skill collection using either a JSON body or a multipart form upload with a ZIP archive.

### Request formats

Use `application/json` when sending file contents inline through the `files` array.

Use `multipart/form-data` when uploading a ZIP archive. Pass metadata as a JSON string in `metadata` or `json`, and include the file in `archive` or `zip`.


## OpenAPI

````yaml POST /api/public/v2/skill-collections
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security:
  - ApiKeyAuth: []
paths:
  /api/public/v2/skill-collections:
    post:
      tags:
        - skill-collections
      summary: Create Skill Collection
      operationId: createSkillCollectionPublic
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSkillCollectionRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateSkillCollectionMultipartRequest'
      responses:
        '201':
          description: Skill collection created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSkillCollectionResponse'
        '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'
        '409':
          description: External ID conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalIdErrorResponse'
        '415':
          description: Unsupported content type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkillCollectionErrorResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    CreateSkillCollectionRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
        folder_id:
          type: integer
          nullable: true
        provider:
          type: string
          nullable: true
        files:
          type: array
          items:
            $ref: '#/components/schemas/InitialFileUpdate'
          default: []
        commit_message:
          type: string
          nullable: true
        external_ids:
          type: array
          items:
            $ref: '#/components/schemas/ExternalId'
          description: Identifiers from other systems.
    CreateSkillCollectionMultipartRequest:
      type: object
      properties:
        metadata:
          type: string
          description: >-
            JSON string metadata containing `name`, `folder_id`, `provider`,
            `files`, and `commit_message`.
        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.
    CreateSkillCollectionResponse:
      type: object
      required:
        - success
        - skill_collection
        - external_ids
      properties:
        success:
          type: boolean
          enum:
            - true
        skill_collection:
          $ref: '#/components/schemas/SkillCollection'
        external_ids:
          type: array
          items:
            $ref: '#/components/schemas/ExternalId'
          description: External ID mappings for the skill collection.
    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
    ExternalIdErrorResponse:
      properties:
        success:
          type: boolean
          const: false
          default: false
          title: Success
        message:
          type: string
          title: Message
      type: object
      required:
        - message
      title: ExternalIdErrorResponse
    InitialFileUpdate:
      type: object
      required:
        - path
      properties:
        path:
          type: string
        content:
          type: string
          default: ''
    ExternalId:
      properties:
        source:
          type: string
          maxLength: 128
          minLength: 1
          title: Source
          description: The external system or namespace that owns the ID.
        external_id:
          type: string
          maxLength: 512
          minLength: 1
          title: External Id
          description: The identifier for this entity in the external system.
      type: object
      required:
        - source
        - external_id
      additionalProperties: false
      title: ExternalId
      description: >-
        Customer-defined mapping between a PromptLayer entity and an external
        system identifier.
    SkillCollection:
      type: object
      description: A skill collection container in the public API.
      properties:
        id:
          type: string
          format: uuid
        workspace_id:
          type: integer
        folder_id:
          type: integer
          nullable: true
        root_path:
          type: string
        name:
          type: string
        provider:
          type: string
          nullable: true
        is_deleted:
          type: boolean
        created_by:
          type: integer
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_by:
          type: integer
          nullable: true
        updated_at:
          type: string
          format: date-time
        external_ids:
          type: array
          items:
            $ref: '#/components/schemas/ExternalId'
          description: External ID mappings attached to this skill collection.
    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

````