---
title: "Create Document"
method: POST
path: "/agents/documents"
tags: ["Documents"]
---

# Create Document

`POST /agents/documents`

Upload a document into a [knowledge base](/line/knowledge-base) folder

## Headers

- `Cartesia-Version` '2026-03-01', date, required

## Request body

- CreateDocumentBody
  - `folder_id` string, required — The folder to upload the document into.
  - `content` string, required — The document text. Maximum 1 MB.
  - `name` string, nullable — An optional display name for the document.
  - `metadata` object — User-defined string-keyed metadata. Used to filter retrieval at query time.

## Response `201`

Document created.

- DocumentResponse
  - `id` string, required — The ID of the document.
  - `name` string, nullable, required — The document's display name, or `null` if unnamed.
  - `content` string, required — The full document text.
  - `created_at` string, date-time, required — When the document was uploaded.
  - `metadata` object, required — User-defined string-keyed metadata.

## Other responses

- `404` — Folder not found (`error_code: kb_folder_not_found`).
- `413` — Document content exceeds the 1 MB limit.

---

[API](https://skmtc.net/cartesia/apis/cartesia-api.md) · [All operations](https://skmtc.net/cartesia/apis/cartesia-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cartesia/cartesia-api/revisions/8910812440d3/schema)
