API referenceSchema Inboxes

Attach or replace an inbox's extraction contract

Attaches or replaces the extraction contract on the inbox.

Endpoint
PUT https://api.dairo.app/v1/inboxes/{inbox}/schema

Attaches or replaces the extraction contract on the inbox. The write is an upsert keyed on the inbox, so a re-PUT replaces the previous contract in full rather than merging into it. schema is a flat map of field name to declaration, where each declaration may set type (string, number, integer, boolean, object, array, url, or email), required, default, maxLength, and enum; a standard JSON Schema with top-level properties and a required array is also accepted and folded into this shape, and the serialized schema is capped at 8192 bytes with unknown types rejected as 400. Setting schema to {} (or omitting it) means no contract, leaving the inbox on plain passthrough delivery. onValidationError defaults to quarantine, which holds a message whose extracted object fails validation out of message.received and emits message.quarantined instead; set passthrough to deliver it anyway with the validation error attached. extractionHint is optional free-text prompt context capped at 1000 characters and never executed — because the write is a full replace, omitting it clears any previous hint; requires the inboxes:write scope.

Scope: inboxes:write. Send the API key as a bearer token; Scopes lists what each one reaches.

Request

cURL
curl -X PUT "https://api.dairo.app/v1/inboxes/support/schema" \
  -H "Authorization: Bearer $DAIRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Path parameters

NameTypeRequiredDescription
inboxstringyesInbox UUID or full address (e.g. agent@dairo.app).

Body

Required, application/json: SetInboxSchemaRequest.

FieldTypeRequiredDescription
schemaInboxSchemaContractno
onValidationError"quarantine", "passthrough"noBehaviour when an extracted object fails validation. 'quarantine' (default) holds the message out of message.received and emits message.quarantined; 'passthrough' delivers it with the error attached. (default "quarantine")
extractionHintstring or nullnoOptional free-text hint passed to the extractor as prompt context. Never executed. (max length 1000)

Response

200 Success. Body: application/json, InboxSchemaResponse.

FieldTypeRequiredDescription
inboxIdstring (uuid)yes
schemaInboxSchemaContractyes
onValidationError"quarantine", "passthrough"yes
extractionHintstring or nullno
createdAtstring (date-time)no
updatedAtstring (date-time)no
200
{
  "inboxId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "schema": {},
  "onValidationError": "quarantine",
  "extractionHint": null,
  "createdAt": "2026-10-19T09:30:00Z",
  "updatedAt": "2026-10-19T09:30:00Z"
}

Errors

Every error has the same body, {"error": {"type", "code", "message", "param"}}; branch on code. Errors lists every code.

StatusMeaning
400The request is malformed or a value is invalid (invalid_request, invalid_domain, idempotency_key_mismatch).
401The API key is missing or invalid.
403The key lacks the scope this endpoint needs (scope_missing) or may not do this (not_permitted).
404No such resource in this account (resource_not_found).
422The request is well-formed but a field failed validation (validation_failed).
429Rate limit, plan limit, budget or spend cap reached (rate_limited, plan_limit_reached, budget_exceeded, spend_cap_reached).
500An unexpected error; retry with backoff, then contact support (internal_error).

On this page