Document_Types

Document_Type registration and lifecycle. Every document belongs to exactly one Document_Type, which defines its schema, model, TTL, and channel configuration.

Quick Reference

MethodPathSummary
POST /api/v1/config/document-types Register a Document_Type
GET /api/v1/config/document-types List all Document_Types
GET /api/v1/config/document-types/{documentType} Get a Document_Type configuration
PUT /api/v1/config/document-types/{documentType}/ttl Set per-Document_Type TTL
DELETE /api/v1/config/document-types/{documentType} Delete a Document_Type
POST

/api/v1/config/document-types

Register a new Document_Type. Associates a schema, model, and optional TTL with a named type.

Request Body

FieldTypeRequiredDescription
namestringYesUnique Document_Type name
masterSchemastringYesSchema reference to validate documents against
modelstringYesDocument model — "closed" in Increment 1
ttlnumber | "infinite"NoTime-to-live in seconds. Default: instance TTL

Response

201 Created 400 Bad Request 409 Conflict (name exists)
{
  "name": "temperature-readings",
  "masterSchema": "temperature-sensor-v1",
  "model": "closed",
  "ttl": 3600,
  "channels": [],
  "createdAt": "2026-07-17T10:00:00.000Z",
  "updatedAt": "2026-07-17T10:00:00.000Z"
}
GET

/api/v1/config/document-types

List all registered Document_Types.

Response

200 OK
[
  { ...Document_Type object },
  { ...Document_Type object }
]
GET

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

Get the full configuration of a specific Document_Type.

Response

200 OK 404 Not Found
{
  "name": "temperature-readings",
  "masterSchema": "temperature-sensor-v1",
  "model": "closed",
  "ttl": 3600,
  "channels": ["garage-sensor", "kitchen-sensor"],
  "createdAt": "2026-07-17T10:00:00.000Z",
  "updatedAt": "2026-07-17T10:00:00.000Z"
}
PUT

/api/v1/config/document-types/{documentType}/ttl

Set or update the TTL for a specific Document_Type. Overrides the instance-level default.

Request Body

FieldTypeRequiredDescription
ttlnumber | "infinite"YesNew TTL value in seconds, or "infinite"

Response

200 OK 404 Not Found
{
  "name": "temperature-readings",
  "ttl": 7200
}
DELETE

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

Delete a Document_Type registration. Only succeeds if no documents of this type exist.

Response

200 OK 404 Not Found 409 Conflict (documents still exist)
{
  "deleted": true
}
Note: Requires no documents of this type exist, including soft-deleted documents. Remove all documents first before deleting the Document_Type.