Skip to main content
DELETE
JavaScript
Permanently remove one variation from an agent.

Its assignments go with it, cleanly

Deleting a variation removes its assignments too, the tool sets, sub-agents, and memory layers wired to it. This cascade is clean: a memory layer that was assigned to the deleted variation becomes deletable right away, with no orphaned assignment left holding it. The tool sets, sub-agents, and memory layers themselves are untouched. Deleting a variation unwires them from this one variation; it does not delete the shared resources.
You can delete an agent’s last variation, and the agent stays STATE_PUBLISHED with zero variations, a state it cannot run in. A create-objective against it then fails validation (400), because there is no variation to select. Publishing requires at least one variation, but deleting past that is not blocked, so after removing variations, confirm the agent still has one or unpublish it.

Objectives already running are safe

An objective froze its variation into a configSnapshot when it started, so deleting the variation does not disturb a run in flight. This is why an objective survives the deletion of the variation that served it, the snapshot is the source of truth for that run, not the live record. Pass the agentvar_... id or the external_id: form. A missing ID is a 404.

List variations

What remains after a delete, and each one’s score.

Add an assignment

The wiring that a delete unwinds.

Unpublish an agent

Take an agent offline if a delete left it without a variation.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspaceId
string
required

Workspace ID.

Example:

"workspace_01HXKD2E5NQM3T9AYWCF133E3Q"

agentId
string
required

Agent ID. Accepts the canonical agent_… form or the external_id:<value> form.

Example:

"agent_01HXKD2E5NQM3T9AYWCFMGWT9Y"

id
string
required

Variation ID. Accepts the canonical agentvar_… form or the external_id:<value> form.

Example:

"agentvar_01HXKD2E5NQM3T9AYWCF32BSPP"

Response