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

# Create or replace a skill file

> Create a new text file in the skill's folder or fully replace an existing one. Parent folders are created implicitly by the path. Writing to `SKILL.md` replaces the whole file including its frontmatter; when the new frontmatter contains a valid `description`, the skill's metadata is synced to it. Prefer [Update a skill](/api-reference/skills/update-a-skill) with `instructions` for SKILL.md changes — it keeps the frontmatter consistent automatically. Only text files can be written; binary assets are not supported via the API.



## OpenAPI

````yaml /openapi.yaml put /api/v1/spaces/{spaceId}/skills/{skillId}/files/{path}
openapi: 3.1.0
info:
  title: Nuwacom API
  description: API for Nuwacom application
  version: 1.0.0
servers:
  - url: https://{customer-tenant}.nuwacom.ai
    description: Nuwacom API
security:
  - bearerAuth: []
paths:
  /api/v1/spaces/{spaceId}/skills/{skillId}/files/{path}:
    put:
      tags:
        - Skills
      summary: Create or replace a skill file
      description: >-
        Create a new text file in the skill's folder or fully replace an
        existing one. Parent folders are created implicitly by the path. Writing
        to `SKILL.md` replaces the whole file including its frontmatter; when
        the new frontmatter contains a valid `description`, the skill's metadata
        is synced to it. Prefer [Update a
        skill](/api-reference/skills/update-a-skill) with `instructions` for
        SKILL.md changes — it keeps the frontmatter consistent automatically.
        Only text files can be written; binary assets are not supported via the
        API.
      operationId: putApiV1SpacesBySpaceIdSkillsBySkillIdFilesByPath
      parameters:
        - in: path
          name: spaceId
          schema:
            anyOf:
              - type: string
                minLength: 2
                maxLength: 6
              - type: string
                minLength: 21
                maxLength: 21
            description: ID of the space the skill belongs to.
          required: true
        - in: path
          name: skillId
          schema:
            type: string
            format: uuid
            description: Unique ID of the skill.
          required: true
        - in: path
          name: path
          schema:
            type: string
            minLength: 1
            maxLength: 512
            pattern: ^[a-zA-Z0-9_\-./]+$
            description: >-
              Relative path of the file within the skill folder. Text files only
              — the extension must be one of: .md, .py, .txt, .json, .yaml,
              .yml, .csv, .html, .svg.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
                  description: >-
                    Full text content of the file (UTF-8). The provided content
                    fully replaces the file.
              required:
                - content
      responses:
        '200':
          description: File written successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  path:
                    type: string
                    description: Relative path of the file within the skill folder.
                  size:
                    type: number
                    description: File size in bytes.
                  mimeType:
                    type: string
                    description: MIME type derived from the file extension.
                required:
                  - path
                  - size
                  - mimeType
        '400':
          description: >-
            Invalid path or body, a binary file extension, content that does not
            match the extension, or an oversized file.
        '403':
          description: >-
            The caller lacks permission to update skills in this space, or the
            skills feature is disabled.
        '404':
          description: Skill not found in the provided space.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````