Skip to main content
PUT
Create or replace a knowledge file

Authorizations

Authorization
string
header
required

Bearer token in the Authorization header — for example, Authorization: Bearer trv_ak_your_api_key_here. Each key is bound to a specific user and organization.

Headers

If-Match
string

Strong ETag from the current file metadata. The update returns 412 Precondition Failed if the validator is stale. Use * to require that the path already exists.

If-None-Match
string

Send * to create the file only when the path does not already exist. If the path exists or is created concurrently, the request returns 412 Precondition Failed.

Path Parameters

file_path
string
required

Slash-delimited path under user_generated/ or skills/. Maximum length is 900 UTF-8 bytes, with at most 255 bytes per path segment.

Body

Raw file bytes, limited to 10 MiB (10,485,760 bytes).

The body is of type file.

Response

Existing knowledge file replaced.

path
string
required

POSIX path under user_generated/ or skills/.

Example:

"user_generated/runbooks/checkout.md"

content_type
string
required

Stored media type.

Example:

"text/markdown"

size_bytes
integer
required

File size in bytes.

Required range: x >= 0
sha256
string
required

Hex SHA-256 digest of the file bytes.

Pattern: ^[0-9a-f]{64}$
etag
string
required

Opaque version token for conditional requests.

Example:

"\"d50c991679d03c2a7392b123eb748b4f\""

created_at
string<date-time>
required
updated_at
string<date-time>
required
created
boolean
required

True when this request created a new path.