# POST /v1/notebooks/{notebook_id}/documents

> Add a document, as a file or as text.

In [Notebooks API](https://vestra.ai/developers/reference/api/notebooks.md): Knowledge Bash reads before it answers: notebooks, and the documents in them.

Send `Authorization: Bearer vk_test_...` on every call.

Add a document, as a file or as text.

Your API key, scope `setup` or `all`. On the card: [`deploy`](https://vestra.ai/developers/deploy.md). Over HTTP it is made from the contract: fill in each {…} and every value.

## Request

Path:

- `notebook_id` (`string`, required): The notebook's id (`nb_...`).

Headers:

- `Idempotency-Key` (`string`): Send the same key to retry this call safely for 24 hours.

Body:

- `title` (`string`, required): Its title, 1 to 200 characters. Limits: 1 to 200 characters. Example: `Refunds for cancelled flights`.
- `text` (`string`, required): Its text, up to 512 KB. Limits: 1 to 524288 characters.

## Answers 201

- `object` (`"document"`): Always `document`.
- `id` (`string`): The document's id.
- `notebook_id` (`string`): The notebook it is in.
- `title` (`string`): Its title.
- `content_type` (`string`): The type of its text, such as `text/markdown` or `text/plain`.
- `bytes` (`integer`): Its size, in bytes.
- `sha256` (`string`): A hash of its text.
- `created_at` (`string`): When it was added, as an ISO 8601 date and time in UTC.

## Code

**HTTP**

```bash
curl -X POST "$VESTRA_BASE_URL/v1/notebooks/{notebook_id}/documents" \
  -H "Authorization: Bearer $VESTRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Refunds for cancelled flights",
    "text": "..."
  }'
```

**TypeScript, Python, CLI, MCP**: No sample in your language for this route, so here it is over HTTP.
