Ingestion

Document ingestion endpoints. TamaDB uses upsert semantics — there is no separate create vs update. If the document exists, incoming fields are merged.

Quick Reference

MethodPathSummary
POST /api/v1/ingest/{documentType} Direct ingestion via Document_Type
POST /api/v1/ingest/{documentType}/{channelId} Channel ingestion (with enrichment)
POST

/api/v1/ingest/{documentType}

Ingest a document directly via its Document_Type. Uses upsert semantics — creates the document if new, merges fields if it already exists.

Request Body

FieldTypeRequiredDescription
documentobjectYesThe document payload to ingest
versionNonumberNoExpected version for optimistic concurrency control
ttlnumber | "infinite"NoPer-document TTL override (seconds)

Response — New Document

201 Created
{
  "dId": "LIVING-ROOM-01",
  "versionNo": 1,
  "created": true
}

Response — Updated Document

200 OK
{
  "dId": "LIVING-ROOM-01",
  "versionNo": 2,
  "created": false
}

Errors

400 Bad Request 404 Document_Type not found 409 Version conflict 422 Schema validation failed
Note: D-Id is extracted from the document using the schema's identityKind annotations. For composed D-Ids (parent-key + primary-key), the response returns an array.
POST

/api/v1/ingest/{documentType}/{channelId}

Ingest a document via a specific channel. Enrichment bindings are applied to the payload before validation.

Request Body

FieldTypeRequiredDescription
documentobjectYesThe document payload to ingest
versionNonumberNoExpected version for optimistic concurrency control
ttlnumber | "infinite"NoPer-document TTL override (seconds)

Response — New Document

201 Created
{
  "dId": "LIVING-ROOM-01",
  "versionNo": 1,
  "created": true
}

Response — Updated Document

200 OK
{
  "dId": "LIVING-ROOM-01",
  "versionNo": 2,
  "created": false
}

Errors

400 Bad Request 403 Channel inactive or blocked 404 Document_Type or channel not found 409 Enrichment or version conflict 422 Schema validation failed
Note: Enrichment bindings are applied to the payload before validation. The channel must be in active status — inactive or blocked channels return 403.