What you need
Export:sdk-support-agent if that value already exists in your workspace.
Create the agent and its first variation
The API mirrors the dashboard boundary. Create the draft agent, then create a variation under it.STATE_DRAFT. Draft agents can be configured but reject objectives. The variation’s Liquid template can read only from the system_prompt_data object supplied by each objective.
Publish and run
An agent needs at least one variation before it can be published.configSnapshot.agentVariation identifies the configuration selected for this objective and remains unchanged if you edit the variation later.
Create the agent and default variation atomically
Automation that already has the complete configuration can usedefaultVariation:
Add assignments
addAssignment accepts a discriminated union. The type field determines the one ID field that is allowed:
assignment.id identifies the assignment row. Keep it when your application needs to remove the relationship later.
See Assign tools, memory, and sub-agents for the toolId, subAgentId, and memory-layer variants.
Add candidates and control selection
Create more variations under the same agent. When an objective omitsvariationId, the agent’s mode chooses:
VARIATION_SELECTION_MODE_RANDOMgives every variation equal probability.VARIATION_SELECTION_MODE_WEIGHTEDuses Thompson Sampling over objective feedback. The dashboard calls this Feedback Driven.
Lifecycle actions
State is output-only. Use explicit actions:Configure variations
Understand snapshots, automatic sampling, and explicit pinning.
Optimize with feedback
Update a candidate’s posterior and inspect the next sampled objective.
Run objectives with the SDK
Stream events, continue conversations, approve tools, and submit scores.
Use your own IDs
Address resources with stable
external_id: references.