Skill Files

Write skill file

Creates or replaces the file at a path. Parent directories are created automatically.

put/skills/{skill_id}/files

Request

  • Base URL
    https://api.metorial.com
  • Auth
    HTTP bearer

Path parameters

skill_idstring required

Unique identifier of the skill.

Headers

Metorial-Versionstring
Example:2025-01-01

Pin the dated API version for this request, e.g. 2025-01-01. Defaults to the version configured for the environment.

Request body

pathstring required

Path of the file inside the skill. A leading "/" is optional. Paths may contain letters, numbers, spaces and the characters . _ - ( ) $.

contentstring

The new text content of the file. Markdown files are stored as documents, other files as plain text files.

file_idstring

The ID of a previously uploaded file to place at the path. Use this for binary files. Files that belong to a document cannot be attached; use content to write markdown documents.

if_matchstring nullable

Only apply the change if the file still has this etag. Pass null to require that no file exists at the path yet. Omit to skip the check.

Example request

{
  "path": "/SKILL.md"
}

Response

Successful response

object'skill.file_change' required

String representing the object's type

type'put' | 'delete' | 'move' required

The kind of change that was applied.

pathstring required

The resulting path of the file. For moves, this is the new path.

previous_pathstring nullable required

The path the file was moved from. Only set for moves.

Example response

{
  "file": {
    "path": "/SKILL.md"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.