Agents Platform

Create Agent Draft

Create a new draft for an agent

post/v1/convai/agents/{agent_id}/drafts

Path parameters

agent_idstring required

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

Example:agent_3701k3ttaq12ewp8b7qv5rfyszkz

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

Query parameters

branch_idstring required

The ID of the agent branch to use

Example:agtbrch_8901k4t9z5defmb8vh3e9361y7nj

The ID of the agent branch to use

Headers

xi-api-keystring nullable

Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.

Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.

Request body

conversation_configobject required

Conversation config for the draft

platform_settingsobject required

Platform settings for the draft

namestring required

Name for the draft

tagsstring[] nullable

Tags to help classify and filter the agent

Example request

{
  "workflow": {
    "edges": {
      "entry_to_tool_a": {
        "forward_condition": {
          "condition": "Tool A condition"
        },
        "source": "entry_node",
        "target": "tool_node_a"
      },
      "start_to_entry": {
        "forward_condition": {},
        "source": "start_node",
        "target": "entry_node"
      },
      "tool_a_to_failure": {
        "forward_condition": {
          "successful": false
        },
        "source": "tool_node_a",
        "target": "failure_node"
      },
      "tool_a_to_tool_b": {
        "forward_condition": {
          "successful": true
        },
        "source": "tool_node_a",
        "target": "tool_node_b"
      },
      "tool_b_to_agent_transfer": {
        "forward_condition": {},
        "source": "tool_node_b",
        "target": "success_transfer"
      },
      "tool_b_to_conversation": {
        "forward_condition": {
          "condition": "Conversation condition"
        },
        "source": "tool_node_b",
        "target": "success_conversation"
      },
      "tool_b_to_end": {
        "forward_condition": {
          "condition": "End condition"
        },
        "source": "tool_node_b",
        "target": "success_end"
      },
      "tool_b_to_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"
                }
              }
            ]
          }
        },
        "source": "tool_node_b",
        "target": "success_phone"
      }
    },
    "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"
          }
        ]
      }
    }
  },
  "tags": [
    "Customer Support",
    "Technical Help",
    "Eleven"
  ]
}

Response

Successful Response

{"stackTrail":"paths:/v1/convai/agents/{agent_id}/drafts:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}

Changes

Changed in 25 of the 49 revisions of this API.301372

    • ○

      added the new deepseek-v41-flash enum value to the request property ////////////

      request-property-enum-value-added

    • ○

      added the new deepseek-v41-flash enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new deepseek-v41-flash enum value to the request property //////////////

      request-property-enum-value-added

    • ○

      added the new glm-52 enum value to the request property ////////////

      request-property-enum-value-added

    • ○

      added the new glm-52 enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new glm-52 enum value to the request property //////////////

      request-property-enum-value-added

    • ○

      added the new gpt-6-luna enum value to the request property ////////////

      request-property-enum-value-added

    • ○

      added the new gpt-6-luna enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new gpt-6-luna enum value to the request property //////////////

      request-property-enum-value-added

    • ○

      added the new gpt-6-sol enum value to the request property ////////////

      request-property-enum-value-added

    • ○

      added the new gpt-6-sol enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new gpt-6-sol enum value to the request property //////////////

      request-property-enum-value-added

    • ○

      added the new claude-opus-5 enum value to the request property ////////////

      request-property-enum-value-added

    • ○

      added the new claude-opus-5 enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new claude-opus-5 enum value to the request property //////////////

      request-property-enum-value-added

    • ○

      added the new claude-opus-5-5 enum value to the request property ////////////

      request-property-enum-value-added

    • ○

      added the new claude-opus-5-5 enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new claude-opus-5-5 enum value to the request property //////////////

      request-property-enum-value-added

    • ○

      added the new optional request property /////////

      new-optional-request-property

    • ○

      added the new gpt-6-astra enum value to the request property ////////////

      request-property-enum-value-added

    • ○

      added the new gpt-6-astra enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new gpt-6-astra enum value to the request property //////////////

      request-property-enum-value-added

    • ○

      added the new gemini-3.8-flash enum value to the request property ////////////

      request-property-enum-value-added

    • ○

      added the new gemini-3.8-flash enum value to the request property //////////

      request-property-enum-value-added

    • ○

      added the new gemini-3.8-flash enum value to the request property //////////////

      request-property-enum-value-added

  • d393c67c384a929See the full diff
    • ▲

      removed from the ////////////// request property anyOf list

      request-property-any-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ○

      added the new optional request property ////////////////

      new-optional-request-property

    • ○

      added the new optional request property ///////////////////

      new-optional-request-property

    • ○

      added the new optional request property /////////////////////

      new-optional-request-property

    • ○

      added the new optional request property ///////////////////

      new-optional-request-property

    • ○

      added the new optional request property /////////////////////

      new-optional-request-property

    • ○

      added the new optional request property //////////////////

      new-optional-request-property

    • ○

      added the new optional request property ////////////////////

      new-optional-request-property

    • ○

      added the new optional request property //////////////////

      new-optional-request-property

    • ○

      added the new optional request property ////////////////////

      new-optional-request-property

    • ○

      added to the ////////////// request property anyOf list

      request-property-any-of-added

    • ○

      request property //////////////// deprecated

      request-property-deprecated

    • ○

      request property /////////////////// deprecated

      request-property-deprecated

    • ○

      request property ///////////////////// deprecated

      request-property-deprecated

    • ○

      request property /////////////////// deprecated

      request-property-deprecated

    • ○

      request property ///////////////////// deprecated

      request-property-deprecated

    • ○

      request property ////////////////// deprecated

      request-property-deprecated

    • ○

      request property //////////////////// deprecated

      request-property-deprecated

    • ○

      request property ////////////////// deprecated

      request-property-deprecated

    • ○

      request property //////////////////// deprecated

      request-property-deprecated

    • ○

      added create_product_quote_request create_service_quote_request send_custom_email discriminator mapping keys to the ///////////// request property

      request-property-discriminator-mapping-added

    • ○

      removed run_subagent discriminator mapping keys from the ///////////// request property

      request-property-discriminator-mapping-deleted

    • ○

      removed run_subagent discriminator mapping keys from the ///////////// request property

      request-property-discriminator-mapping-deleted

    • ○

      removed run_subagent discriminator mapping keys from the ///////////// request property

      request-property-discriminator-mapping-deleted

    • ○

      removed run_subagent discriminator mapping keys from the ///////////// request property

      request-property-discriminator-mapping-deleted

    • ○

      removed run_subagent discriminator mapping keys from the ///////////// request property

      request-property-discriminator-mapping-deleted

    • ○

      removed run_subagent discriminator mapping keys from the ///////////// request property

      request-property-discriminator-mapping-deleted

    • ○

      removed run_subagent discriminator mapping keys from the ///////////// request property

      request-property-discriminator-mapping-deleted

    • ○

      removed run_subagent discriminator mapping keys from the ///////////// request property

      request-property-discriminator-mapping-deleted

    • ○

      added to the ///////////// request property oneOf list

      request-property-one-of-added

    This revision also has 6 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • ○

      added the new optional request property ///////////

      new-optional-request-property

    • ○

      added the new optional request property /////////////

      new-optional-request-property

    • ○

      added the new optional request property /////////////

      new-optional-request-property

    • ○

      added the new optional request property ///////

      new-optional-request-property

  • aa277505183c824See the full diff
    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ▲

      removed from the ///////////// request property oneOf list

      request-property-one-of-removed

    • ○

      mapped value for discriminator key end_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key end_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key end_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key end_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key end_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key end_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key end_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key end_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key start_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key start_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key start_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key start_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key start_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key start_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key start_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      mapped value for discriminator key start_procedure changed from to for ///////////// request property

      request-property-discriminator-mapping-changed

    • ○

      added to the ///////////// request property oneOf list

      request-property-one-of-added

    • ○

      added to the ///////////// request property oneOf list

      request-property-one-of-added

    • ○

      added to the ///////////// request property oneOf list

      request-property-one-of-added

    • ○

      added to the ///////////// request property oneOf list

      request-property-one-of-added

    • ○

      added to the ///////////// request property oneOf list

      request-property-one-of-added

    • ○

      added to the ///////////// request property oneOf list

      request-property-one-of-added

    • ○

      added to the ///////////// request property oneOf list

      request-property-one-of-added

    • ○

      added to the ///////////// request property oneOf list

      request-property-one-of-added

    This revision also has 6 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog