---
title: "Create or replace a knowledge file"
method: PUT
path: "/v1/knowledge/files/{file_path}"
tags: ["External API"]
---

# Create or replace a knowledge file

`PUT /v1/knowledge/files/{file_path}`

## Request

- Base URL: `https://api.traversal.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.traversal.com/v1/knowledge/files/{file_path}`
- Auth: HTTP bearer

Send the file bytes as the request body. Set Content-Type to match the file extension, or use application/octet-stream to infer it. The maximum file size is 10 MB.

## Path parameters

- `file_path` string, required

## Headers

- `If-Match` string, nullable
- `If-None-Match` string, nullable

## Request body

- string, binary

## Response `200`

The existing file was replaced.

- UpsertKnowledgeFileResponse
  - `path` string, required: POSIX path under `user_generated/` or `skills/`.
  - `content_type` string, required: Stored content type.
  - `size_bytes` integer, required: File size in bytes.
  - `sha256` string, required: Hex SHA-256 of the file bytes.
  - `etag` string, required: Opaque version token for conditional requests.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `created` boolean, required: True when the path did not already exist.

## Other responses

- `201`: Successful Response
- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `412`: Precondition Failed
- `413`: Request Entity Too Large
- `415`: Unsupported Media Type
- `500`: Internal Server Error
- `503`: Service Unavailable
- `4XX`: Client error returned in the V1 error envelope.

## Changes

> 66 revisions in range; 9 not diffed.

- **2026-08-26** `6ee9e975dda2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/traversal/apis/traversal-api/changes/v1/knowledge/files/:file_path/put.md)

---

[API](https://skmtc.dev/traversal/apis/traversal-api.md) - [All operations](https://skmtc.dev/traversal/apis/traversal-api/llms.txt) - [OpenAPI document](https://skmtc.dev/traversal/apis/traversal-api/revisions/31e1a8b7cf89?raw)
