Skip to main content
POST
Create an agent from a definition
Requires Editor, Admin, or Owner. Supply a name and a workflow_definition containing nodes and edges. The request example is a minimal start-to-end conversation. See the workflow definition guide for node data, graph constraints, and context variables. Creation returns 200 OK with the new agent, numeric id, definition, and current_definition_id. The agent lifecycle starts as draft; creation does not place a call. The create response leaves workflow_uuid, version_number, and version_status null. Retrieve the UUID through list/get and inspect versions for definition version state. Configure the required AI connections, validate, and publish before directing traffic to it. Each successful request creates a new agent. If the connection fails after submission, check List agents before retrying. Validation failures return 422; credentials, workspace context, and role failures are described in API errors.

Authorizations

Authorization
string
header
required

Bandwidth Labs OAuth access token. Uses the user's selected workspace; the workspace header is not required. Do not also send an API key. Bearer-only operations may additionally require the Labs super_user role.

Headers

X-VOAI-ORGANIZATION-ID
string | null

Required with X-BW-LABS-AGENTS-API-KEY: the positive local workspace ID to access. The key owner must be a current member. Missing or invalid IDs return 400; non-member workspaces return 403. Not required for bearer authentication, which uses the user's selected workspace.

Body

application/json
name
string
required

Name shown in the workspace agent list.

workflow_definition
Workflow Definition · object
required

Workflow node and edge graph. See the workflow definition guide for node-specific fields.

template_context_variables
Template Context Variables · object | null

Default context variables available when a run starts.

workflow_configurations
Workflow Configurations · object | null

Optional connection and runtime configuration overrides.

Response

Successful Response

created_at
string<date-time>
required
current_definition_id
integer | null
required

Current definition record ID; distinct from version_number.

id
integer
required
name
string
required
status
string
required
workflow_definition
Workflow Definition · object
required

Node and edge graph for this version.

call_disposition_codes
CallDispositionCodes · object | null
template_context_variables
Template Context Variables · object | null
total_runs
integer | null
version_number
integer | null

Human-readable sequence number. Use the version record ID for rollback.

version_status
string | null
workflow_configurations
Workflow Configurations · object | null
workflow_uuid
string | null