Subscriptions

Webhook subscription management. Consumers register callback URLs and receive real-time POSTs whenever matching documents are stored or updated.

Quick Reference

MethodPathSummary
POST /api/v1/subscriptions Subscribe (register webhook)
GET /api/v1/document-types/{documentType}/subscriptions List subscriptions by Document_Type
GET /api/v1/documents/{documentType}/{dId}/subscriptions List subscriptions by D-Id
DELETE /api/v1/subscriptions/{subscriptionId} Cancel a subscription
POST

/api/v1/subscriptions

Subscribe (register webhook).

Request Body

FieldTypeRequiredDescription
scopestringYes"document_type" or "document_id"
documentTypestringYesTarget Document_Type
dIdstringIf scope=document_idTarget D-Id (required when scope is "document_id")
callbackUrlstringYesURL to receive webhook POSTs
optionsobjectNoDelivery options (see below)

Options Sub-fields

FieldTypeRequiredDescription
deliveryModestringNo"fire-and-forget" | "retry" (default: fire-and-forget)
payloadFormatstringNo"envelope" | "raw" (default: envelope)
retrievalModestringNo"full" | "partial" (default: full)

Response

201 Created 400 Bad Request 404 Document_Type not found
{
  "id": "sub-abc123-0001",
  "scope": "document_type",
  "documentType": "temperature-readings",
  "callbackUrl": "https://my-dashboard.example.com/webhook",
  "options": {
    "deliveryMode": "retry",
    "payloadFormat": "envelope",
    "retrievalMode": "full"
  },
  "active": true,
  "createdAt": "2026-07-17T10:15:00Z"
}
Note: The webhook payload is snapshotted at the moment of update — delivery is decoupled from the store operation.
GET

/api/v1/document-types/{documentType}/subscriptions

List subscriptions by Document_Type.

Response

200 OK
[
  ...subscription objects
]
GET

/api/v1/documents/{documentType}/{dId}/subscriptions

List subscriptions by D-Id.

Response

200 OK
[
  ...subscription objects
]
DELETE

/api/v1/subscriptions/{subscriptionId}

Cancel a subscription.

Response

200 OK 404 Not Found
{
  "cancelled": true
}
Note: Delivery stops immediately upon cancellation.