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-ai

Every 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.

ParameterDescription
Accept: application/jsonRead stored events as JSON instead of a stream. The response contains items, next_cursor and timed_out.
wait_seconds=0With 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.

EventFieldsMeaning
thinking_deltastep, deltaProvider 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_deltastep, deltaAnswer text or narration for this step. Append in cursor order.
tool_callstep, existing tool-call fieldsA call requested by the model at this step.
progress with reset: truemessage, step, stageRetract 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 without step, discard the trailing answer text.

Conversations

RouteNotes
GET /conversationsList conversations, up to 50 per page.
POST /conversationsCreate 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.

ParameterDescription
qA 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_idA project UUID, or none for conversations outside a project.
cursorThe opaque next_cursor from the previous page. Keep the same q and project_id on later pages.

Conversation fields

FieldDescription
titleTrimmed; 1–120 characters with no control characters.
title_sourcederived, generated or user.
pinned, pinned_atpinned_at is nullable.
last_activity_atTime of the most recent question activity.
project_idNullable. Set it to a project UUID to move the conversation, or null to move it out.
resource_versionSend it in If-Match, for example If-Match: "3".

Conversations also carry their existing identity and approval settings.

Projects

RouteNotes
GET /projectsAll owned projects in name order, with conversation_count and file_count.
POST /projectsCreate 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"}
FieldRules
nameTrimmed; 1–100 characters; unique within the person's workspace, ignoring case.
descriptionAt most 500 characters.

Instructions

RouteDocumentSize limit
GET, PUT /instructions/workspaceThe workspace VEGA.md. Reading needs use; writing needs admin on vega_ai.32 KiB
GET, PUT /projects/{id}/instructionsThe owned project's instructions.16 KiB
GET, PUT /instructions/personalThe 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:

RouteNotes
POST /projects/{id}/filesBody {"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}/filesList active files.
DELETE /projects/{id}/files/{file_id}Remove a file.
GET /projects/{id}/files/{file_id}/content303 redirect to a download URL valid for five minutes. Optional inline=1 requests inline viewing, subject to file-type restrictions.

Error codes

StatusCodeCause
403—A non-admin tried to write the workspace instructions.
404ATTACHMENT_NOT_FOUNDAn unknown upload receipt, or one that belongs to someone else.
409CONVERSATION_PIN_LIMITThe person already has 20 pinned conversations in the workspace.
409PROJECT_NAME_EXISTSAnother of the person's projects has that name.
409PROJECT_LIMITThe person already has 100 projects in the workspace.
409PROJECT_FILE_LIMITThe project's file quota would be exceeded.
409ATTACHMENT_ALREADY_USEDThe upload receipt was already used.
410ATTACHMENT_EXPIREDThe upload receipt expired.
412RESOURCE_VERSION_MISMATCHStale 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.

Vegalake, VegaDB and VegaFlow are trademarks or registered trademarks of Vegalake Inc.

On this page