Workbooks

Run a Sigma agent

Run a Sigma agent and return its reply.

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. For a guide to calling Sigma agents from the API, see Call Sigma agents with the API.

Usage notes

  • Retrieve the workbookId by calling the /v2/workbooks endpoint.
  • Retrieve the agentId by calling the /v2/workbooks/{workbookId}/agents endpoint.
  • Retrieve the versionTagName by calling the /v2/tags 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.
post/v2/workbooks/{workbookId}/agents/{agentId}

Request

  • Base URL
    https://api.sigmacomputing.com
  • Auth
    HTTP bearer

Path parameters

workbookIdstring required

Unique identifier of the workbook that contains the agent.

agentIdstring required

Unique identifier of the Sigma agent to run.

Request body

streamboolean

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

sigma:versionTagNamestring

Name of the version tag whose workbook version to run the agent against. Omit to run against the latest published version.

maxTurnsnumber double

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

maxOutputTokensnumber double

Maximum total output tokens the agent can generate. When omitted, no limit is applied.

metadataobject

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

Response

The response body.

object'agent.run' required

Object type, always agent.run.

runIdstring required

Unique identifier for the agent run.

createdAtnumber double required

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

completedAtnumber double nullable required

Unix timestamp (in seconds) when the run completed.

modelstring required

Identifier of the model that served the run.

status'completed' | 'failed' | 'incomplete' | 'cancelled' required

Status of the run.

outputParsedV2WorkbooksWorkbookIdAgentsAgentIdPostResponsesContentApplicationJsonSchemaOutputParsed

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

outputErrorstring

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

workbookVersionnumber double

Workbook version used to run the agent turn.

Changes

No recorded changes to this operation across all 1 revision of this API.