---
title: "Save a knowledge document"
method: POST
path: "/api/v1/topics/{ref}/documents"
---

# Save a knowledge document

`POST /api/v1/topics/{ref}/documents`

## Request

- Base URL: `https://myagentda.com`
- URL: `https://myagentda.com/api/v1/topics/{ref}/documents`
- Auth: API key in header `Authorization`

Saves a new markdown document into the topic (max 4 MB). Requires write access (topic admin or writer). Rate limit: 120 documents/hour per user.

## Path parameters

- `ref` string, required

## Request body

- object: Markdown document.
  - `title` string, required: Document title.
  - `content_md` string, required: Markdown content (max 4 MB).
  - `source` string: Where this came from (meeting, URL, research session).

## Response `201`

The document was saved.

- object: Saved document reference.
  - `document` object: Saved document.
    - `id` string: Document ID.
    - `title` string: Title.
    - `version` integer: Version after this save.
    - `topic` string: Topic number, e.g. T-3.

## Other responses

- `400`: The request was invalid.
- `401`: The access token is missing or invalid.
- `403`: The caller's role does not allow this action.
- `404`: Not found — or not visible to the caller (no existence leak).

---

[API](https://skmtc.dev/myagentda/apis/agentda.md) · [All operations](https://skmtc.dev/myagentda/apis/agentda/llms.txt) · [OpenAPI document](https://skmtc.dev/myagentda/apis/agentda/revisions/66a449ab49dc?raw)
