Endpoints
See the Endpoints section in the sidebar for the full API reference, generated from the OpenAPI spec. API keys inherit the role of the user who created them. Every Knowledge Files endpoint requires themember role or higher. Requests use the organization bound to the API key — you cannot read or modify another organization’s files.
File organization
Every path must start with one of these roots:
The API does not expose Traversal-generated knowledge or agent memories.
Paths are case-sensitive and must:
- Use
/separators - Be relative, not absolute
- Exclude
.and..segments - Exclude control characters
- Use at most 900 UTF-8 bytes in total and 255 bytes per segment
Supported file formats
Each upload request can contain at most 10 MiB (10,485,760 bytes). The file extension andContent-Type must describe the same format.
You can send
application/octet-stream to infer the stored content type from the extension.
Upload a file
Send the file bytes directly as thePUT request body. Do not wrap the content in JSON or multipart form data.
If-None-Match: * prevents an existing file from being overwritten. A successful create returns 201 Created with file metadata, ETag, and Location.
Write files safely
Create only if the path is unused
UseIf-None-Match: *, as shown in the upload example, whenever you intend to create a new file. Traversal returns 412 Precondition Failed if the path already exists or another request creates it concurrently.
Replace only the version you retrieved
First retrieve the current metadata and save itsetag value:
If-Match:
412 Precondition Failed. Retrieve the latest metadata before deciding whether to retry.
You can also send If-Match: * to replace the file only if the path already exists.
An unconditional PUT retries one concurrent replacement, then returns 409 Conflict if the file still changed underneath the request. Retry the write after fetching the latest metadata.
Delete a file
204 No Content. A missing or hidden path returns 404 Not Found.
To delete only the version you retrieved, send its etag in If-Match:
If-Match returns 412 Precondition Failed. An unconditional DELETE retries one concurrent delete, then returns 409 Conflict if another request still wins the race.
Create an agent skill
An agent skill is a directory underskills/ with a SKILL.md file. The file starts with YAML frontmatter containing a unique name and a description, followed by the instructions:
SKILL.md when you upload it. Invalid frontmatter or a duplicate skill name returns 400 Bad Request.
List files
List files under both customer-managed roots:prefix to list one subtree:
page defaults to 1 and limit defaults to 50; the maximum limit is 100. The response includes count, total, prev, and next.
Download a file
Content-Type, Content-Length, Content-Disposition, and ETag. Responses also include Cache-Control: private, no-cache, must-revalidate and X-Content-Type-Options: nosniff.
To avoid downloading an unchanged file, send its previous ETag in If-None-Match:
304 Not Modified with no body and includes the current ETag and Cache-Control headers. Replace your local copy only when the response is 200 OK.