Turing API reference
Routes, fields, limits and error codes for Turing question events, conversations, personal projects, instructions and project files.
This page lists the Turing API. For how conversations, projects and instructions behave in the product, read Turing conversations and projects. For authentication and base paths, read API fundamentals.
All routes are under:
/api/v1/vegaflow/orgs/{org_id}/workspaces/{workspace_id}/vega-aiEvery operation requires authentication and use permission on vega_ai. Workspace instruction updates also require admin on vega_ai. Project operations are restricted to the project's owner.
Question events
GET /questions/{question_id}/events streams Server-Sent Events.
| Parameter | Description |
|---|---|
Accept: application/json | Read stored events as JSON instead of a stream. The response contains items, next_cursor and timed_out. |
wait_seconds=0 | With JSON, replay immediately without waiting. |
cursor (query) or Last-Event-ID (header) | Resume after a cursor. The query parameter takes precedence. |
Events arrive in cursor order, and each contains cursor and occurred_at. Answer and tool events identify the model step they belong to; public step numbers start at 1.
| Event | Fields | Meaning |
|---|---|---|
thinking_delta | step, delta | Provider reasoning or a reasoning summary for this step, emitted only when the provider supplies it. It follows the same access and redaction rules as answer text. |
answer_delta | step, delta | Answer text or narration for this step. Append in cursor order. |
tool_call | step, existing tool-call fields | A call requested by the model at this step. |
progress with reset: true | message, step, stage | Retract answer text and thinking for this step. stage is answer_correction when checking and rewriting an answer against its sources, or model_retry when retrying a provider attempt. Preserve earlier steps and tool calls. |
A thinking delta:
{"type":"thinking_delta","step":2,"delta":"I should check the source totals.","cursor":"41","occurred_at":"2026-10-26T09:00:00Z"}A reset names the step to retract:
{"type":"progress","message":"Checking the answer against its sources…","reset":true,"step":2,"stage":"answer_correction","cursor":"47","occurred_at":"2026-10-26T09:00:01Z"}Ordering and replay
- Within a step, pending thinking is emitted before text. Pending thinking and text are both emitted before a
tool_call, or before the progress event that precedes it. - Rebuild narration, thinking and tool groups from cursor order when replaying a question.
- A model retry streams replacement content with the same step.
- An answer correction retracts the named step and requests a rewrite in the next model step. Its replacement content carries that next step number.
- For a reset, discard the answer text and thinking of the named step. Events recorded before steps were introduced replay without
step; for a reset withoutstep, discard the trailing answer text.
Conversations
| Route | Notes |
|---|---|
GET /conversations | List conversations, up to 50 per page. |
POST /conversations | Create a conversation. Accepts an optional project_id; the project must belong to the caller in the same workspace. |
PATCH /conversations/{id} | Change title, pinned, approval_mode and project_id, in any combination. Requires If-Match. |
DELETE /conversations/{id} | Delete an owned conversation. If-Match is optional. Returns 204, including on repeated deletion while the deletion record remains. |
List
The response has items and, when another page exists, next_cursor. Pinned conversations come first, most recent pin first; the rest follow by most recent question activity. Accepting a question and reaching its terminal state both count as activity.
| Parameter | Description |
|---|---|
q | A literal, case-insensitive substring of 2–100 characters, matched against the title and the first 500 characters of the first question. Answers, tool results and file contents are not searched. |
project_id | A project UUID, or none for conversations outside a project. |
cursor | The opaque next_cursor from the previous page. Keep the same q and project_id on later pages. |
Conversation fields
| Field | Description |
|---|---|
title | Trimmed; 1–120 characters with no control characters. |
title_source | derived, generated or user. |
pinned, pinned_at | pinned_at is nullable. |
last_activity_at | Time of the most recent question activity. |
project_id | Nullable. Set it to a project UUID to move the conversation, or null to move it out. |
resource_version | Send it in If-Match, for example If-Match: "3". |
Conversations also carry their existing identity and approval settings.
Projects
| Route | Notes |
|---|---|
GET /projects | All owned projects in name order, with conversation_count and file_count. |
POST /projects | Create a project. Returns 201. |
GET /projects/{id} | A project and its ETag. |
PATCH /projects/{id} | Change name, description or both. Requires If-Match. |
DELETE /projects/{id} | Returns 204. Moves the project's conversations out of the project and schedules its files for cleanup. |
POST /projects body:
{"name":"Quarterly analysis","description":"Revenue investigation"}| Field | Rules |
|---|---|
name | Trimmed; 1–100 characters; unique within the person's workspace, ignoring case. |
description | At most 500 characters. |
Instructions
| Route | Document | Size limit |
|---|---|---|
GET, PUT /instructions/workspace | The workspace VEGA.md. Reading needs use; writing needs admin on vega_ai. | 32 KiB |
GET, PUT /projects/{id}/instructions | The owned project's instructions. | 16 KiB |
GET, PUT /instructions/personal | The caller's personal instructions. | 8 KiB |
Limits count UTF-8 bytes.
Responses contain version, body, updated_at and updated_by. A document that does not exist yet has version 0, an empty body, a null update time and an empty updater.
PUT takes {"body":"instruction text"} and requires the quoted instruction version in If-Match, including If-Match: "0" to create the document. An empty body writes a new version with no effective instructions.
Project files
Upload files with the POST /attachments staging API and its presigned upload URLs, then add them to a project:
| Route | Notes |
|---|---|
POST /projects/{id}/files | Body {"attachment_ids":["uuid"]}. Promotes 1–20 distinct, single-use upload receipts owned by the caller. Returns 201 with an items array of the added files. |
GET /projects/{id}/files | List active files. |
DELETE /projects/{id}/files/{file_id} | Remove a file. |
GET /projects/{id}/files/{file_id}/content | 303 redirect to a download URL valid for five minutes. Optional inline=1 requests inline viewing, subject to file-type restrictions. |
Error codes
| Status | Code | Cause |
|---|---|---|
| 403 | — | A non-admin tried to write the workspace instructions. |
| 404 | ATTACHMENT_NOT_FOUND | An unknown upload receipt, or one that belongs to someone else. |
| 409 | CONVERSATION_PIN_LIMIT | The person already has 20 pinned conversations in the workspace. |
| 409 | PROJECT_NAME_EXISTS | Another of the person's projects has that name. |
| 409 | PROJECT_LIMIT | The person already has 100 projects in the workspace. |
| 409 | PROJECT_FILE_LIMIT | The project's file quota would be exceeded. |
| 409 | ATTACHMENT_ALREADY_USED | The upload receipt was already used. |
| 410 | ATTACHMENT_EXPIRED | The upload receipt expired. |
| 412 | RESOURCE_VERSION_MISMATCH | Stale If-Match on a conversation, project or instruction document. Fetch the current resource before retrying. |
For product limits such as file formats and quotas, see Limits.