Run a Sigma agent (Beta)

View as Markdown
Run a Sigma agent and return its reply. **Beta**: This documentation describes a public beta feature and is subject to the [Beta features](/docs/sigma-product-releases#beta-features) disclaimer. The API is stateless. Include the full conversation in `messages` on every call. To continue a conversation, append the response `output` to your `messages` and send them on the next call. The agent runs with your access against the workbook's latest published version unless you pass `versionTagName`. ### Usage notes - Retrieve the **workbookId** by calling the [/v2/workbooks](https://help.sigmacomputing.com/reference/list-workbooks) endpoint. - Retrieve the **agentId** by calling the [/v2/workbooks/{workbookId}/agents](https://help.sigmacomputing.com/reference/list-agents-in-workbook) endpoint. - Retrieve the **versionTagName** by calling the [/v2/tags](https://help.sigmacomputing.com/reference/list-version-tag) endpoint and using the `name` in the response. Omit to run against the latest published version. - If the `workbookVersion` changes between turns, the workbook was published mid-conversation. ### Usage scenarios - **Evaluate agent responses**: Include the response `runId` in support requests, and use it to correlate runs with your logs.

Authentication

AuthorizationBearer

OAuth authentication of the form <token>.

Path parameters

workbookIdstringRequired
Unique identifier of the workbook that contains the agent.
agentIdstringRequired
Unique identifier of the Sigma agent to run.

Request

The request body.
messageslist of objectsRequired
Full conversation contents.
streambooleanOptional

When true, the response is a stream of events instead of a single JSON body. Defaults to false.

sigma:versionTagNamestringOptional
Name of the version tag whose workbook version to run the agent against. Omit to run against the latest published version.
responseFormatobjectOptional
maxTurnsdoubleOptional

Maximum tool-calling steps per turn before the agent stops running. Default 50, max 100.

maxOutputTokensdoubleOptional
Maximum total output tokens the agent can generate. When omitted, no limit is applied.
metadatamap from strings to strings or doubles or booleansOptional

Caller-defined key/value metadata logged to the ai_usage table in your warehouse.

Response

The response body.
objectenum

Object type, always agent.run.

runIdstring
Unique identifier for the agent run.
createdAtdouble

Unix timestamp (in seconds) of when the run began.

completedAtdouble or null

Unix timestamp (in seconds) when the run completed.

modelstring
Identifier of the model that served the run.
statusenum
Status of the run.
incompleteDetailsobject or null

Details about why the run is incomplete, or null when the run completed normally.

outputlist of objects
The agent's reply turn, containing the answer text and any tool calls or tool results.
usageobject
outputParsedobjectOptional

The agent’s answer parsed into the structure requested in responseFormat. Present only when a responseFormat was specified and the output satisfied it.

outputErrorstringOptional

Present when a responseFormat was requested but the structured output could not be produced or failed schema validation.

workbookVersiondoubleOptional
Workbook version used to run the agent turn.