Documents

Document retrieval, search, deletion, and per-document TTL management.

Quick Reference

MethodPathSummary
GET /api/v1/documents/{documentType}/{glob} List/glob documents
GET /api/v1/documents/{documentType}/{dId} Retrieve a document by D-Id
GET /api/v1/documents/{documentType}/{dId}?path={fieldPath} Retrieve a specific field
POST /api/v1/documents/{documentType}/search Search documents by field value
DELETE /api/v1/documents/{documentType}/{dId} Soft-delete a document
PUT /api/v1/documents/{documentType}/{dId}/ttl Set per-document TTL
GET

/api/v1/documents/{documentType}/{glob}

Use * for all documents, or glob patterns like GARAGE-* to match subsets. Supports * and ? wildcards.

Response

200 OK
{
  "matches": [...document objects],
  "count": 2
}
GET

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

Retrieve a single document. For composed D-Ids, use : as delimiter in URL.

Response

200 OK 404 Not Found
{
  ...document fields
}
GET

/api/v1/documents/{documentType}/{dId}?path={fieldPath}

Retrieve a single field from a document by dot-path.

Query Parameters

FieldTypeRequiredDescription
pathstringYesDot-path to the field

Response

200 OK 404 Not Found
{
  "_value": 19.1
}
POST

/api/v1/documents/{documentType}/search

Search documents by field value.

Request Body

FieldTypeRequiredDescription
fieldstringYesField name to search on
valueanyYesValue to match

Response

200 OK
{
  "matches": [...],
  "count": 1
}
DELETE

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

Soft-delete a document.

Response

200 OK 404 Not Found
{
  "deleted": true
}
Note: Data and history preserved for audit but document is never served again.
PUT

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

Set per-document TTL.

Request Body

FieldTypeRequiredDescription
ttlnumber | "infinite"YesTTL in seconds, or "infinite" for no expiry

Response

200 OK 404 Not Found
{
  "dId": "GARAGE-TEMP-01",
  "ttl": 1800
}
Note: TTL hierarchy (most specific wins): Document > Document_Type > Instance. TTL=0 means transient (process and deliver, don't cache).