get_job
Returns the job's current state (pending, in_progress, awaiting_approval, completed, failed, or cancelled), intermediate AI responses streamed during execution, the final document HTML once complete, and any pending changes awaiting user approval (with chunk IDs and proposed HTML diffs in metadata.pending_changes). Poll this after chat_async to track progress and retrieve results. When status is awaiting_approval, call POST /v1/chat/{session_id}/approve to approve or deny each pending change. Headless/MCP clients get the same typed progress events the web SSE stream delivers via metadata.intermediate_responses (e.g. documents_changed, continue_prompt, model_fallback, proposed_change_batch); cross-session document updates from OTHER sessions are reported separately by polling GET /v1/sessions/{session_id}/doc-events.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | ||
| compact | No | When true, omit the heavy result body + streamed intermediate events from the response (status/progress/ids/timestamps/pending-change ids remain). Recommended for AI agents polling a large-document job: poll compact while it runs, then fetch once non-compact when status is completed to retrieve the final HTML. | |
| authorization | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Error message. Present when status is 'failed'. | |
| job_id | Yes | Unique job identifier. Use this to poll for status updates. | |
| result | No | Job output. Present when status is 'completed'. Contains AI response and document changes for chat jobs. | |
| status | Yes | Current status: 'pending', 'in_progress', 'awaiting_approval', 'completed', 'failed', or 'cancelled'. | |
| user_id | No | User that owns this job (null for organization jobs). | |
| job_type | Yes | Type of job: 'chat' or 'attachment_processing'. | |
| metadata | No | Job metadata and context. Contains pending_changes when status is 'awaiting_approval'. | |
| progress | Yes | Progress percentage (0-100). | |
| created_at | Yes | ISO 8601 timestamp when the job was created. | |
| session_id | Yes | Session associated with this job. | |
| updated_at | Yes | ISO 8601 timestamp of the last status change. | |
| organization_id | No | Organization that owns this job (null for user jobs). |