For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Connect
BlogHelp CenterAPI PricingSign up
OverviewElevenCreativeElevenAgentsElevenAPIReception AIAPI referenceChangelog
OverviewElevenCreativeElevenAgentsElevenAPIReception AIAPI referenceChangelog
  • API reference
    • Introduction
    • Authentication
    • Streaming
  • ElevenAgents
        • POSTCreate draft
        • DELDelete draft
      • POSTCreate agent
      • GETGet agent
      • GETList agents
      • PATCHUpdate agent
      • DELDelete agent
      • POSTDuplicate agent
      • GETGet link
      • POSTSimulate conversation
      • POSTStream simulate conversation
      • POSTCalculate expected LLM usage
      • GETGet agent summaries
  • ElevenAPI
  • ElevenCreative
  • Core Resources
  • Workspace
  • Legacy
  • Conversational AI
LogoLogo
Login
Login
Connect
BlogHelp CenterAPI PricingSign up
ElevenAgentsAgentsDrafts

Create draft

POST
/v1/convai/agents/:agent_id/drafts
POST
/v1/convai/agents/:agent_id/drafts
$curl -X POST "https://api.elevenlabs.io/v1/convai/agents/agent_id/drafts?branch_id=branch_id" \
> -H "Content-Type: application/json" \
> -d '{
> "conversation_config": {},
> "platform_settings": {},
> "workflow": {
> "edges": {
> "entry_to_tool_a": {
> "source": "entry_node",
> "target": "tool_node_a",
> "forward_condition": {
> "condition": "Tool A condition"
> }
> },
> "start_to_entry": {
> "source": "start_node",
> "target": "entry_node",
> "forward_condition": {}
> },
> "tool_a_to_failure": {
> "source": "tool_node_a",
> "target": "failure_node",
> "forward_condition": {
> "successful": false
> }
> },
> "tool_a_to_tool_b": {
> "source": "tool_node_a",
> "target": "tool_node_b",
> "forward_condition": {
> "successful": true
> }
> },
> "tool_b_to_agent_transfer": {
> "source": "tool_node_b",
> "target": "success_transfer",
> "forward_condition": {}
> },
> "tool_b_to_conversation": {
> "source": "tool_node_b",
> "target": "success_conversation",
> "forward_condition": {
> "condition": "Conversation condition"
> }
> },
> "tool_b_to_end": {
> "source": "tool_node_b",
> "target": "success_end",
> "forward_condition": {
> "condition": "End condition"
> }
> },
> "tool_b_to_phone": {
> "source": "tool_node_b",
> "target": "success_phone",
> "forward_condition": {
> "expression": {
> "children": [
> {
> "name": "force_phone_transfer"
> },
> {
> "prompt": "Phone condition",
> "value_schema": {
> "description": "Phone condition",
> "type": "boolean"
> }
> },
> {
> "left": {
> "name": "mode"
> },
> "right": {
> "value": "dev"
> }
> }
> ]
> }
> }
> }
> },
> "nodes": {
> "entry_node": {
> "conversation_config": {},
> "edge_order": [
> "entry_to_tool_a"
> ],
> "label": "Entry"
> },
> "failure_node": {
> "conversation_config": {},
> "label": "Failure"
> },
> "start_node": {
> "edge_order": [
> "start_to_entry"
> ]
> },
> "success_conversation": {
> "conversation_config": {},
> "label": "Success A"
> },
> "success_end": {},
> "success_phone": {
> "transfer_destination": {
> "phone_number": "+1234567890"
> }
> },
> "success_transfer": {
> "agent_id": "success_transfer_agent"
> },
> "tool_node_a": {
> "edge_order": [
> "tool_a_to_failure",
> "tool_a_to_tool_b"
> ],
> "tools": [
> {
> "tool_id": "tool_a"
> },
> {
> "tool_id": "tool_b"
> }
> ]
> },
> "tool_node_b": {
> "edge_order": [
> "tool_b_to_conversation",
> "tool_b_to_end",
> "tool_b_to_phone",
> "tool_b_to_agent_transfer"
> ],
> "tools": [
> {
> "tool_id": "tool_a"
> }
> ]
> }
> }
> },
> "name": "string"
>}'
Create a new draft for an agent
Was this page helpful?
Previous

Delete draft

Next
Built with

Path parameters

agent_idstringRequired
The id of an agent. This is returned on agent creation.

Headers

xi-api-keystringOptional

Query parameters

branch_idstringRequired
The ID of the agent branch to use

Request

This endpoint expects an object.
conversation_configmap from strings to anyRequired
Conversation config for the draft
platform_settingsmap from strings to anyRequired
Platform settings for the draft
workflowobjectRequired
Workflow for the draft
namestringRequired
Name for the draft
tagslist of strings or nullOptional
Tags to help classify and filter the agent

Response

Successful Response

Errors

422
Unprocessable Entity Error