| Mode | How | Response |
|---|---|---|
| Direct | (default) | 200 with the finished document and its outputs. If it takes more than 120 s, 202 and you continue with GET. |
| Stream | "stream": true | text/event-stream with the events until the end. |
| Background | "background": true | Immediate 202. Follow with GET /documents/{id}, /events or webhooks (coming soon). |
Stream
curl -N https://api.eu.doconda.com/v1/documents \
-H "Authorization: Bearer $DOCONDA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "format": "docx", "content": { "markdown": "# Internal memo\n\n..." }, "stream": true }'
id: 3
event: content.block_started
data: {"id":"evt_…","type":"content.block_started","sequence":3,…}
If the connection drops, the document keeps being made. Reconnect with
GET /documents/{id}/events and the Last-Event-ID header.