← Back to home

Documents

Store docs, sheets, slides, and drafts for your agent.

List Documents

GET /api/v1/docs

Returns documents belonging to the authenticated agent. Supports pagination.

Auth: Bearer API Key

Query params (all optional):

  • limit — default 100, max 500
  • offset — default 0

Response:

{
  "documents": [
    {
      "id": "uuid",
      "agentId": "uuid",
      "title": "Meeting Notes",
      "type": "markdown",
      "content": "# Notes\n...",
      "createdAt": "2025-01-15T09:00:00Z",
      "updatedAt": "2025-01-15T09:30:00Z"
    }
  ]
}

Get Document

GET /api/v1/docs/:id

Returns a single document.

Auth: Bearer API Key

Response:

{
  "document": {
    "id": "uuid",
    "agentId": "uuid",
    "title": "Meeting Notes",
    "type": "markdown",
    "content": "# Notes\n...",
    "createdAt": "2025-01-15T09:00:00Z",
    "updatedAt": "2025-01-15T09:30:00Z"
  }
}

Create Document

POST /api/v1/docs

Creates a new document.

Auth: Bearer API Key

Body:

FieldTypeRequired
titlestringYes
type"markdown" | "sheet" | "slide" | "draft"No (default: "markdown")
contentstringNo (see format by type below)

Response:

{ "document": { ... } }

Update Document

PUT /api/v1/docs/:id

Updates one or more fields of a document.

Auth: Bearer API Key

Body:

FieldTypeRequired
titlestringNo
contentstringNo (see format by type below)

Response:

{ "document": { ... } }

Delete Document

DELETE /api/v1/docs/:id

Permanently deletes the document.

Auth: Bearer API Key

Response:

{ "deleted": true }

Document Types

markdown (default)

Standard markdown text. Used for notes, letters, reports, etc.

sheet

Tabular data stored as a JSON array of row objects. Each object is one row, keys are column headers.

[
  { "Name": "Alice", "Age": 30, "City": "Paris" },
  { "Name": "Bob", "Age": 25, "City": "London" }
]

slide

Presentation slides written in markdown, separated by \n---\n. Each section becomes one slide.

# Welcome to Japan
Your dream vacation awaits
---
## Day 1 — Tokyo
- Shibuya crossing
- Meiji shrine
---
## Day 2 — Kyoto
- Fushimi Inari
- Bamboo grove

draft

Real-time collaborative document. You and the user co-edit simultaneously with provenance tracking. GET returns live content from the editor. PUT writes with agent attribution. Use POST /api/v1/docs/:id/draft-token to get a WebSocket token for direct real-time connection.

Field Constraints

FieldConstraint
title1–500 characters
type"markdown" | "sheet" | "slide" | "draft" (default: "markdown")
contentUp to 100,000 characters. Must be valid JSON array for sheets.