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

# Create a skill

> Creates a skill in a project. You can create a skill from the fields in the request body or from a built-in skill. If the project already has a skill from the same built-in skill, the API returns that skill unchanged.



## OpenAPI

````yaml https://api-trial.cognigy.ai/swagger/openapi.json post /skills
openapi: 3.0.3
info:
  contact:
    email: support@example.com
    name: API Support
  description: API for managing agents and related resources
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://swagger.io/terms/
  title: Agents API
  version: '1.0'
servers:
  - url: https://api-trial.cognigy.ai/v1
security:
  - ApiKey: []
tags:
  - name: Agents
  - name: Brand personas
  - name: Tools
  - name: Built-in tools
  - name: Skills
  - name: Built-in skills
  - name: MCP servers
  - description: >-
      Remote agents that speak the A2A (Agent2Agent) protocol. Available only
      while FEATURE_ENABLE_A2A_TOOLS is on; every route answers 404 otherwise.
    name: A2A agents
  - name: Tool references
paths:
  /skills:
    post:
      tags:
        - Skills
      summary: Create a skill
      description: >-
        Creates a skill in a project. You can create a skill from the fields in
        the request body or from a built-in skill. If the project already has a
        skill from the same built-in skill, the API returns that skill
        unchanged.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/internal_skills.CreateSkillRequest'
        description: The skill to create.
        required: true
        x-originalParamName: skill
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/internal_skills.CreateAndReadSkillResponse
          description: Returns the created skill.
        '400':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailBadRequest
          description: Invalid request body or validation error.
        '403':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailForbidden
          description: Access denied.
        '409':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailConflict
          description: A skill with this name already exists in this project.
        '500':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailInternalError
          description: Internal server error.
components:
  schemas:
    internal_skills.CreateSkillRequest:
      properties:
        builtinSlug:
          description: >-
            The unique identifier for the built-in skill. It contains only
            lowercase

            letters, numbers, and hyphens. It's required if `source` is
            `builtin`.
          example: my-skill-slug
          type: string
        bundledTools:
          description: >-
            The `referenceId` values of the tools that are bundled with the
            skill.

            Each value must be a valid UUID, and the list can't contain
            duplicates.
          items:
            type: string
          type: array
        compatibility:
          description: The compatibility information for the skill, up to 500 bytes.
          type: string
        description:
          description: >-
            A description of the skill, from 1 to 1024 bytes. It's required
            unless

            `source` is `builtin`.
          type: string
        instructions:
          description: >-
            The instructions of the skill. The value can't be empty. It's
            required

            unless `source` is `builtin`.
          type: string
        license:
          description: The license of the skill.
          type: string
        metadata:
          additionalProperties: {}
          description: Custom key-value metadata for the skill.
          type: object
        name:
          description: >-
            The name of the skill. The name must be unique in the project, from
            1 to

            64 characters long, and contain only lowercase letters, numbers, and

            hyphens. It can't start or end with a hyphen. It's required unless

            `source` is `builtin`.
          type: string
        projectId:
          description: The unique identifier for the project that the skill belongs to.
          type: string
        resources:
          description: The files that are bundled with the skill.
          items:
            $ref: '#/components/schemas/internal_skills.SkillResourceRequest'
          type: array
        source:
          description: >-
            The way the skill is created. The allowed values are `user` and

            `builtin`. If you omit it or set it to `user`, the skill is created
            from

            the fields in the request body. If you set it to `builtin`, the
            skill is

            created from the built-in skill that `builtinSlug` identifies, and
            the API

            ignores the name, description, instructions, and other values in the
            body.
          enum:
            - user
            - builtin
          example: user
          type: string
      required:
        - projectId
      type: object
    internal_skills.CreateAndReadSkillResponse:
      properties:
        builtinSlug:
          description: >-
            The unique identifier for the built-in skill that this skill was
            created

            from. The field is present only if `source` is `builtin`.
          type: string
        bundledTools:
          description: >-
            The `referenceId` values of the tools that are bundled with the
            skill.
          items:
            type: string
          type: array
        compatibility:
          description: The compatibility information for the skill.
          type: string
        createdAt:
          description: The time when the skill was created, as a Unix timestamp in seconds.
          type: integer
        createdBy:
          description: The unique identifier for the user who created the skill.
          example: 507f1f77bcf86cd799439011
          type: string
        description:
          description: A description of the skill.
          type: string
        id:
          description: The unique identifier for the skill.
          example: 507f1f77bcf86cd799439011
          type: string
        instructions:
          description: The instructions of the skill.
          type: string
        lastChangedAt:
          description: >-
            The time when the skill was last changed, as a Unix timestamp in
            seconds.
          type: integer
        lastChangedBy:
          description: The unique identifier for the user who last changed the skill.
          example: 507f1f77bcf86cd799439011
          type: string
        license:
          description: The license of the skill.
          type: string
        metadata:
          additionalProperties: {}
          description: Custom key-value metadata for the skill.
          type: object
        name:
          description: The name of the skill.
          type: string
        organisationId:
          description: >-
            The unique identifier for the organization that the skill belongs
            to.
          example: 507f1f77bcf86cd799439011
          type: string
        projectId:
          description: The unique identifier for the project that the skill belongs to.
          example: 507f1f77bcf86cd799439011
          type: string
        referenceId:
          description: >-
            The UUID that identifies the skill in references, for example in the

            `skillReferenceIds` of an agent. The API generates it when the skill
            is

            created.
          type: string
        resources:
          description: The files that are bundled with the skill.
          items:
            $ref: '#/components/schemas/internal_skills.SkillResourceResponse'
          type: array
        source:
          description: >-
            The origin of the skill. The possible values are `user` and
            `builtin`.
          enum:
            - user
            - builtin
          example: user
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailBadRequest:
      properties:
        code:
          description: |-
            Code is a stable machine-readable reason, present on some 400s only
            (for example "reserved_tool_name").
          example: reserved_tool_name
          type: string
        detail:
          example: request body validation failed
          type: string
        errors:
          items:
            $ref: >-
              #/components/schemas/github_com_cognigy_ai-agents-v2_internal_middleware.FieldError
          type: array
        instance:
          example: /v1/{resource}
          type: string
        status:
          example: 400
          type: integer
        title:
          example: Bad Request
          type: string
        traceId:
          example: api--a4d2f126-bec4-4544-a049-7c0cf08524ed
          type: string
        type:
          example: about:blank
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailForbidden:
      properties:
        detail:
          example: 'access denied: insufficient permissions'
          type: string
        instance:
          example: /v1/{resource}/{id}
          type: string
        status:
          example: 403
          type: integer
        title:
          example: Forbidden
          type: string
        traceId:
          example: api--a4d2f126-bec4-4544-a049-7c0cf08524ed
          type: string
        type:
          example: about:blank
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailConflict:
      properties:
        detail:
          example: a resource with this identifier already exists
          type: string
        instance:
          example: /v1/{resource}
          type: string
        status:
          example: 409
          type: integer
        title:
          example: Conflict
          type: string
        traceId:
          example: api--a4d2f126-bec4-4544-a049-7c0cf08524ed
          type: string
        type:
          example: about:blank
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.ProblemDetailInternalError:
      properties:
        detail:
          example: internal server error
          type: string
        instance:
          example: /v1/{resource}
          type: string
        status:
          example: 500
          type: integer
        title:
          example: Internal Server Error
          type: string
        traceId:
          example: api--a4d2f126-bec4-4544-a049-7c0cf08524ed
          type: string
        type:
          example: about:blank
          type: string
      type: object
    internal_skills.SkillResourceRequest:
      properties:
        content:
          description: >-
            The content of the resource, in the encoding that `encoding`
            specifies.
          type: string
        contentType:
          description: The content type of the resource.
          type: string
        encoding:
          description: >-
            The encoding of `content`. The allowed values are `utf-8` and
            `base64`.
          enum:
            - utf-8
            - base64
          type: string
        path:
          description: >-
            The relative path of the resource within the skill. The path can't
            be

            empty, contain `..`, or start with `/`.
          type: string
      required:
        - content
        - encoding
        - path
      type: object
    internal_skills.SkillResourceResponse:
      properties:
        content:
          description: >-
            The content of the resource, in the encoding that `encoding`
            specifies.
          type: string
        contentType:
          description: The content type of the resource.
          type: string
        encoding:
          description: >-
            The encoding of `content`. The allowed values are `utf-8` and
            `base64`.
          enum:
            - utf-8
            - base64
          type: string
        path:
          description: The relative path of the resource within the skill.
          type: string
      type: object
    github_com_cognigy_ai-agents-v2_internal_middleware.FieldError:
      properties:
        field:
          type: string
        message:
          type: string
      type: object
  securitySchemes:
    ApiKey:
      description: '[Production] API key for production authentication'
      in: header
      name: X-API-Key
      type: apiKey

````