Docs/API/Documents

Documents API.

A document on wrxstack is structured prose with versioning, comments, and graph relationships. Differs from File (a binary blob) and Note (a free-text annotation).

Endpoints

MethodPathDescription
POST/v1/documentsCreate
GET/v1/documents/{id}Get
PATCH/v1/documents/{id}Update body / metadata
GET/v1/documents/{id}/versionsVersion history
POST/v1/documents/{id}/commentsAppend a comment

Create

curl -X POST https://api.wrxstack.com/v1/documents   -H "Authorization: Bearer $WRX_API_KEY"   -H "Idempotency-Key: $(uuidgen)"   -H "Content-Type: application/json"   -d '{
    "title":  "Acme renewal one-pager",
    "body":   "# Executive summary\nAcme will renew at $1.2M ARR…",
    "format": "markdown",
    "about":  ["acc_01HQ3K..."]
  }'

Versions

Every PATCH that changes the body creates a new version. Versions are immutable and addressable.

curl https://api.wrxstack.com/v1/documents/doc_01HQ3K.../versions   -H "Authorization: Bearer $WRX_API_KEY"
{
  "data": [
    {"version": 7, "author": "priya@acme.com", "at": "2026-05-17T15:01Z"},
    {"version": 6, "author": "asst_triage",    "at": "2026-05-16T22:48Z"}
  ]
}

Python

from wrxstack import Client
client = Client()

doc = client.documents.create(
    title="Acme renewal one-pager",
    body="# Executive summary…",
    format="markdown",
    about=["acc_01HQ3K..."],
)

# Update
client.documents.update(doc.id, body=doc.body + "\n\n## Risks…")

# Diff between two versions
diff = client.documents.diff(doc.id, from_=6, to=7)
print(diff.unified)

Errors

CodeHTTPMeaning
document_not_found404No such id
format_unsupported400Only markdown and html are accepted today
version_conflict409Use If-Match with the version you read