Skip to content

Extract a document

Settings module

POST/aurora/extractaurora.extract

Reads a rider, insurance certificate, invoice, receipt or quote into proposed fields with a confidence each and provenance agent. A price, date or quantity the document does not show is NO_ANSWER. Nothing is written until the caller confirms. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.

  • Requires the capability home.dashboard.read.
  • OAuth scopes: home.
  • Send an Idempotency-Key header. A replay with the same key returns the original response.
  • Error statuses: 400, 401, 409, 422, 429. Errors are RFC 9457 problem details.

Request body: AuroraExtractRequest

aurora.extract: AuroraExtractRequest
FieldTypeRequiredDescription
kind"rider" | "insurance_certificate" | "invoice" | "receipt" | "quote"YesWhat the document is.
document_idstring (uuid) | nullNoIdentifier of the stored document read, when the file is one.
media_type"application/pdf" | "text/plain" | "image/png" | "image/jpeg" | "image/webp"YesMedia type of the content.
content_base64stringYesThe document content in base64, read by the caller from storage.Constraints: length 1 to 14000000
file_namestringYesFile name shown in the log.Constraints: length 1 to 300
{
  "kind": "insurance_certificate",
  "document_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
  "media_type": "application/pdf",
  "content_base64": "JVBERi0xLjcK",
  "file_name": "coi-atlantic.pdf"
}

Response 200: AuroraResult

aurora.extract: AuroraResult
FieldTypeRequiredDescription
outcome"answer" | "no_answer" | "failed"Yesanswer, no_answer (the data does not support an answer; `missing` says why) or failed (the model call failed and was logged).
ai_generatedtrueYesAlways true: the content is AI-generated and is labeled so (EU AI Act Article 50).
request_idstring (uuid) | nullYesIdentifier of the logged AI request; null when no model was called.
modelstring | nullYesModel that answered.Constraints: length 1 to 100
missingstring | nullYesWhat the data lacks, for no_answer.Constraints: length 1 to 500
failure_codestring | nullYesWhy the request failed.Constraints: length 1 to 64
answerobjectNoThe feature's answer for outcome answer, shaped per operation; null otherwise.
suggestionsarray of AuroraProposalYesChanges stored for confirmation.
{
  "outcome": "answer",
  "ai_generated": true,
  "request_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
  "model": "claude-sonnet-5-5",
  "missing": "No budget lines exist yet.",
  "failure_code": "model_error",
  "answer": {
    "text": "One permit is blocked: Fire Marshal Permit.",
    "citations": []
  },
  "suggestions": [
    {
      "suggestion_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
      "operation_id": "savedViews.create",
      "summary": "Save the view Blocked Miami Permits."
    }
  ]
}

Code samples

curl -X POST "$XOS_BASE_URL/aurora/extract" \
  -H "Authorization: Bearer $XOS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"kind":"insurance_certificate","document_id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f","media_type":"application/pdf","content_base64":"JVBERi0xLjcK","file_name":"coi-atlantic.pdf"}'
const { data } = await xos.aurora.extract({
    "kind": "insurance_certificate",
    "document_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f",
    "media_type": "application/pdf",
    "content_base64": "JVBERi0xLjcK",
    "file_name": "coi-atlantic.pdf"
  });
response = xos.aurora.extract({"kind": "insurance_certificate", "document_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f", "media_type": "application/pdf", "content_base64": "JVBERi0xLjcK", "file_name": "coi-atlantic.pdf"})
xos aurora extract --data '{"kind":"insurance_certificate","document_id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f","media_type":"application/pdf","content_base64":"JVBERi0xLjcK","file_name":"coi-atlantic.pdf"}'