Skip to content

Custom Documents API ​

Create, manage, and bind custom documents to stored prompts for context injection.

See the full API reference: Custom Documents API

Endpoints ​

MethodPathDescription
GET/api/v1/custom-documentsList documents
POST/api/v1/custom-documentsCreate a document
GET/api/v1/custom-documents/:idGet document detail
PATCH/api/v1/custom-documents/:idUpdate a document
DELETE/api/v1/custom-documents/:idDelete a document
GET/api/v1/custom-documents/:id/bindingsList prompt bindings
POST/api/v1/custom-documents/:id/bindingsBind to a prompt
DELETE/api/v1/custom-documents/:id/bindings/:bindingIdRemove a binding

Quick Example ​

bash
# Create a document
curl -X POST http://localhost:3000/api/v1/custom-documents \
  -H "Cookie: $SESSION_COOKIE" \
  -H "Content-Type: application/json" \
  -d '{
    "typeId": "clx123...",
    "name": "My Agent Config",
    "content": "# Agent\n\n## Tools\n- Read\n- Write",
    "metadata": {"runtime": "claude-code"},
    "tags": ["agent", "claude"]
  }'

# Bind document to a prompt
curl -X POST http://localhost:3000/api/v1/custom-documents/DOC_ID/bindings \
  -H "Cookie: $SESSION_COOKIE" \
  -H "Content-Type: application/json" \
  -d '{"storedPromptId": "PROMPT_ID", "injectionMode": "prepend"}'