Push data with the API

v1.0 Updated 2026-11-26 2 min read

The documents API accepts one or many documents per request. Use it from a backend job with a key that has documents:write.

Upsert a document

curl -X PUT "https://api.tengence.com/v1/apps/$TENGENCE_APP/documents/help-1024" 
  -H "Authorization: Bearer $TENGENCE_KEY" 
  -H "Content-Type: application/json" 
  -d '{
    "title": "Reset your password",
    "body": "Open Settings, then Security, then Reset password.",
    "url": "https://example.com/help/password",
    "tags": ["account","security"]
  }'

Batch upsert

POST /v1/apps/{app_id}/documents accepts up to 500 documents or 10 MB, whichever comes first. Batches larger than that return 413 payload_too_large.

Delete

curl -X DELETE "https://api.tengence.com/v1/apps/$TENGENCE_APP/documents/help-1024" 
  -H "Authorization: Bearer $TENGENCE_KEY"

Error codes

Status Code What to do
400 invalid_document Fix the field named in details.field
401 invalid_key Check key scope and environment
409 document_locked Retry after the current re-index finishes
413 payload_too_large Split the batch below 500 docs / 10 MB
429 rate_limited or quota_exceeded Back off, or check billing for quota

Idempotency

Send an Idempotency-Key header for retries. The same key with the same body returns the original result instead of writing twice. Keys are retained for 24 hours.

Make your ingestion job log the document id and the API request ID together. When a document looks wrong in search, that pair is the fastest path to the exact write.

Was this page helpful?

Consult