Create or replace a knowledge file
Sends the file bytes directly as the request body. Do not wrap the
content in JSON or multipart form data. The extension and Content-Type
must describe the same supported file format. Send
application/octet-stream to infer the type from the extension.
The request body can contain at most 10 MiB (10,485,760 bytes).
A new path returns 201 Created; replacing an existing path returns
200 OK. Use If-Match with the current metadata ETag to prevent a
concurrent update from being overwritten.
Authorizations
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
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.
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
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.
POSIX path under user_generated/ or skills/.
"user_generated/runbooks/checkout.md"
Stored media type.
"text/markdown"
File size in bytes.
x >= 0Hex SHA-256 digest of the file bytes.
^[0-9a-f]{64}$Opaque version token for conditional requests.
"\"d50c991679d03c2a7392b123eb748b4f\""
True when this request created a new path.