TTL — MDDB API

Document time-to-live management

Set document TTL #

POST /v1/set-ttl

Set a time-to-live (TTL) on a document. After the TTL expires, the document will be automatically deleted. This is a write-protected endpoint.

Set ttl to 0 to remove the TTL and make the document permanent again.

Authorization: BearerAuth or APIKeyAuth or none

Request body #

Required.

Content type application/json: SetTTLRequest

{
  "collection": "blog",
  "key": "hello-world",
  "lang": "en_US",
  "ttl": 3600
}

Responses #

Status Description Body
200 TTL set successfully Document (application/json)
400 Invalid request ErrorResponse (application/json)
404 Document not found (v2.18.8; was 400 before, DOC-018) ErrorResponse (application/json)
403 Read-only mode ErrorResponse (application/json)