Skip to main content
The Knowledge Files API lets you manage the customer-authored files that Traversal agents use during investigations. You can upload runbooks and reference documents, define reusable agent skills, replace those files, or delete them. All endpoints require authentication — see Authentication to create an API key. For the base URL and error envelope, see the API overview.

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 the member 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 and Content-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 the PUT 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.
Without a conditional header, PUT creates a missing file or completely replaces an existing file. An unconditional replacement returns 200 OK.

Write files safely

Create only if the path is unused

Use If-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 its etag value:
Then send the saved value in If-Match:
If the file changed or moved after you retrieved it, Traversal returns 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

A successful delete returns 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:
A stale 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 under skills/ with a SKILL.md file. The file starts with YAML frontmatter containing a unique name and a description, followed by the instructions:
Upload the main skill file:
Upload supporting files to the same directory with separate requests:
Traversal validates 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:
Use prefix to list one subtree:
Files are ordered by path. If you omit pagination parameters, 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

Downloads stream the original bytes and return the stored 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:
An unchanged file returns 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.

Knowledge-specific errors

In addition to the generic status codes, these responses are common: