Skip to main content

Response

View as Markdown

Response object​

A stored Genie One response.

idstringBetaOutput only

The opaque response identifier.

objectstringBetaOutput only

Always response.

modelstringBetaOutput only

The server-managed model profile, genie-one.

statusstringBetaOutput only

One of in_progress, completed, failed, or incomplete.

outputarray of objectBetaOutput only

The public assistant messages produced by this response, in output order.

Show child attributesHide child attributes
typestringBetaOutput only

The item discriminator, message.

idstringBetaOutput only

The opaque item identifier. Clients must not parse or derive identifiers from it.

rolestringBetaOutput only

Always assistant. To retrieve user messages, list the conversation items.

contentarray of objectBetaOutput only

The ordered text parts of the message.

Show child attributesHide child attributes
typestringBetaOutput only

Always output_text.

textstringBetaOutput only

The text of this content part. Output text may contain Markdown, including result tables.

annotationsarray of objectBetaOutput only

Public source references used by the assistant text. The array can be empty.

Show child attributesHide child attributes
typestringBetaOutput only

The citation discriminator, asset.

titlestringBetaOutput only

The customer-visible source title.

asset_typestringBetaOutput only

The kind of cited source, such as TABLE, NOTEBOOK, or WEB.

identifierstringBetaOutput only

The public asset identifier, volume path, or source web URL.

indexint32BetaOutput only

The one-based citation number. It is neither a character offset nor an index into annotations. Numbers remain stable if unsupported citations are omitted.

statusstringBetaOutput only

The lifecycle status of this message, when available.

phasestringBetaOutput only

The assistant message phase: commentary or final_answer.

create_timestringBetaOutput only

The message creation time as an RFC 3339 timestamp, when available.

complete_timestringBetaOutput only

The message completion time as an RFC 3339 timestamp, when available.

conversation_idstringBetaOutput only

The conversation that contains the response.

create_timestringBetaOutput only

The response creation time as an RFC 3339 timestamp, when available.

errorobjectBetaOutput only

Sanitized failure information on a failed response, when available.

Show child attributesHide child attributes
typestringBetaOutput only

The stable public error category.

messagestringBetaOutput only

A sanitized customer-facing description.

codestringBetaOutput only

The stable Genie One error code, such as internal_error, when available.

retryablebooleanBetaOutput only

Whether retrying the failed response may succeed.

previous_response_idstringBetaOutput only

The preceding response in the conversation, when this response has a parent.

Create a response Beta​

POST /api/2.0/genie/one/responses

Sends a question to Genie One and streams the response over Server-Sent Events (SSE). Omit conversation_id to start a conversation, or provide it to continue an existing Genie One conversation. The workspace must have Genie One API access enabled.

Save the response.id and response.conversation_id from response.created. Use them to get the response if the stream disconnects. Disconnecting does not cancel an accepted response. Repeating a POST can create another response.

API scopes: genie

Request body​

Send only the fields listed below. Unknown request fields return INVALID_PARAMETER_VALUE.

inputstring or array of objectRequired

The question. Send a nonblank string, or an array containing exactly one user message. In the array form, set role to "user"; the message's type can be omitted or set to "message".

The message's content can be a nonblank string or an array of one or more {"type": "input_text", "text": "..."} parts. Each text part must be nonblank. The combined text must not exceed 25,000 UTF-8 bytes. Other message roles and content types are not supported.

conversation_idstring

An existing Genie One conversation to continue. Omit to create a conversation. The caller must be allowed to add responses to it. The ID can contain ASCII letters, digits, hyphens, and underscores, up to 128 bytes.

warehouse_idstring

The SQL warehouse to use if Genie One runs a query. If omitted, Genie One resolves the warehouse.

user_timezonestring

An IANA time zone, such as America/Los_Angeles. The value must not exceed 255 UTF-8 bytes.

enable_vizboolean

Omit this field or set it to false. Requests with true are rejected; visualization payloads are not available through this API.

Default: false

Response events​

A successful request returns text/event-stream. Each JSON event has a type matching the SSE event name and a sequence_number that increases from zero. Output item events also have a zero-based output_index. A terminal response event is followed by data: [DONE]. Commentary can stream before completion. Final answer item events can arrive just before the terminal response event.

response.createdevent

The response has been accepted. data.response.status is "in_progress" and data.response.output is empty. Save its response and conversation IDs.

response.output_item.addedevent

A public assistant message is added. data.item is the message and data.output_index is its position in the response output.

response.output_item.updatedevent

A subsequent snapshot of an existing public assistant message. The item has the same shape as response.output_item.added. Replace the previous item at its output_index rather than appending its text.

response.output_item.doneevent

A public assistant message reaches its final state. The item appears in the terminal response's output array.

response.completedevent

Terminal success. data.response.status is "completed" and its output contains the public assistant messages.

response.failedevent

Terminal failure after the response was accepted. data.response.status is "failed". A sanitized error object is included when failure details are available.

response.incompleteevent

The response stopped without completing. data.response.status is "incomplete".

Response​

The response.created and terminal events carry the Response object. Its output contains public assistant messages only. Internal reasoning, tool calls, tool results, and visualization payloads are not output items. Answer text can include Markdown tables.

Errors​

Requests rejected before streaming return a JSON error with an HTTP status. After a response is accepted, execution failures appear in the SSE stream as response.failed, even though the HTTP status is 200.

HTTP statusError codeDescription
400INVALID_PARAMETER_VALUEThe request body is malformed or uses an unknown field, unsupported input, or unsupported option.
401UNAUTHENTICATEDAn authenticated identity is required.
403PERMISSION_DENIEDThe caller cannot add a response to the conversation.
404NOT_FOUNDThe API is not enabled for the workspace, or the conversation or specified warehouse is unavailable.
409ALREADY_EXISTSAnother response is active in the conversation. Retry after it finishes.
429RESOURCE_EXHAUSTEDThe request was rate limited.
500INTERNAL_ERRORAn unexpected server error occurred.

Get a response Beta​

GET /api/2.0/genie/one/conversations/{conversation_id}/responses/{response_id}

Gets the current or terminal response without starting another execution. Use the response and conversation IDs from response.created to recover after a CreateResponse stream disconnects. Poll while the status is in_progress.

Parameters​

conversation_idstringRequiredpath

The conversation that contains the response.

response_idstringRequiredpath

The response to retrieve.

Response​

Returns the Response object. The response create_time, when available, is an RFC 3339 timestamp. Output contains public assistant messages only. Failed responses can include a sanitized error.