manage_document
Create, read, update, delete, or cancel individual documents. Uses PUT for upsert. Supply external_id (and optional external_source) for idempotent writes from external systems — the internal UUID is auto-generated. Use document_id (internal UUID) for get/delete/cancel or to update a known document. Documents may be archived (_archived: true in response) — archived documents are read-only and cannot be upserted, but can be cancelled or deleted.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
action | enum: upsert | get | delete | cancel | Yes | |
database_id | string | Yes | Target database ID |
collection | string | Yes | Collection name or ID |
document_id | string | No | Internal document ID (UUID). Required for get/delete. For upsert, use to update a known document by internal ID. |
external_id | string | No | External/agent-supplied ID for upsert. Enables idempotent upsert by external identity (e.g. stripe_inv_123). |
external_source | string | No | Source system for external_id (e.g. 'stripe', 'salesforce'). Scopes uniqueness of external_id. |
data | object | No | Document data conforming to collection schema |