Draft text
Módulo Settings
POST/aurora/draftaurora.draft
Drafts an SOP, advance packet, email, day sheet or change order description in the org's verbiage library. Facts the context lacks are marked as gaps, never invented. The draft is returned, not saved or sent. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.
- Requiere la capacidad home.dashboard.read.
- Alcances de OAuth: home.
- Envía el encabezado Idempotency-Key. Una repetición con la misma clave devuelve la respuesta original.
- Estados de error: 400, 401, 409, 422, 429. Los errores son detalles de problema RFC 9457.
Cuerpo de la solicitud: AuroraDraftRequest
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| kind | "sop" | "advance_packet" | "email" | "day_sheet" | "change_order_description" | Sí | What to draft. |
| instructions | string | Sí | What the draft should say.Restricciones: length 1 to 4000 |
| context | array of object | No | Records to draft from, read with the caller's permissions. |
| verbiage | array of object | No | The org's verbiage library entries to apply. |
{
"kind": "sop",
"instructions": "Write the load-in SOP for the main stage.",
"context": [
{
"collection": "venues",
"id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}
],
"verbiage": [
{
"term": "loading dock",
"preferred": "Dock"
}
]
}Respuesta 200: AuroraResult
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| outcome | "answer" | "no_answer" | "failed" | Sí | answer, no_answer (the data does not support an answer; `missing` says why) or failed (the model call failed and was logged). |
| ai_generated | true | Sí | Always true: the content is AI-generated and is labeled so (EU AI Act Article 50). |
| request_id | string (uuid) | null | Sí | Identifier of the logged AI request; null when no model was called. |
| model | string | null | Sí | Model that answered.Restricciones: length 1 to 100 |
| missing | string | null | Sí | What the data lacks, for no_answer.Restricciones: length 1 to 500 |
| failure_code | string | null | Sí | Why the request failed.Restricciones: length 1 to 64 |
| answer | object | No | The feature's answer for outcome answer, shaped per operation; null otherwise. |
| suggestions | array of AuroraProposal | Sí | Changes 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."
}
]
}Ejemplos de código
curl -X POST "$XOS_BASE_URL/aurora/draft" \
-H "Authorization: Bearer $XOS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"kind":"sop","instructions":"Write the load-in SOP for the main stage.","context":[{"collection":"venues","id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"}],"verbiage":[{"term":"loading dock","preferred":"Dock"}]}'const { data } = await xos.aurora.draft({
"kind": "sop",
"instructions": "Write the load-in SOP for the main stage.",
"context": [
{
"collection": "venues",
"id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}
],
"verbiage": [
{
"term": "loading dock",
"preferred": "Dock"
}
]
});response = xos.aurora.draft({"kind": "sop", "instructions": "Write the load-in SOP for the main stage.", "context": [{"collection": "venues", "id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"}], "verbiage": [{"term": "loading dock", "preferred": "Dock"}]})xos aurora draft --data '{"kind":"sop","instructions":"Write the load-in SOP for the main stage.","context":[{"collection":"venues","id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"}],"verbiage":[{"term":"loading dock","preferred":"Dock"}]}'