Skip to main content
POST
/
v1
/
pathway
/
chat
/
create
Create Pathway Chat
curl --request POST \
  --url https://us.api.bland.ai/v1/pathway/chat/create \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '{
  "pathway_id": "<string>",
  "start_node_id": "<string>",
  "request_data": {},
  "use_candidate_model": true,
  "pathway_version": 123
}'
{
  "data": {
    "chat_id": "9f8e7d6c-5b4a-3c2d-1e0f-a1b2c3d4e5f6",
    "message": "Chat instance created successfully",
    "variables": {
      "user_name": "John Doe",
      "account_id": "12345",
      "preference": "email"
    }
  },
  "errors": null
}

Headers

authorization
string
required
Your API key for authentication.

Body

pathway_id
string
required
Pathway ID of the pathway to create a chat instance for.
start_node_id
string
The start node ID of the pathway. If not provided, the pathway will start from the node marked as the start node in the pathway configuration.
request_data
object
Custom key-value data to initialize the pathway chat with. This object will be stored as the pathway’s initial variables and can be referenced within pathway nodes. The request_data must be a valid JSON object (not an array or null).This works the same as request_data in v1/calls where variables can be accessed using {{variable_name}} syntax within your pathway nodes.
{
  "user_name": "John Doe",
  "account_id": "12345",
  "preference": "email"
}
use_candidate_model
boolean
Whether to use the candidate model for this pathway chat. When enabled, the pathway will use an experimental model version for enhanced performance and capabilities.
pathway_version
number
The specific version number of the pathway to use for this chat instance. If not provided, the production version will be used.

Response

data
object
Contains the response data for the created pathway chat instance.
errors
null | array
Will be null on success. Contains error details if the request failed.
{
  "data": {
    "chat_id": "9f8e7d6c-5b4a-3c2d-1e0f-a1b2c3d4e5f6",
    "message": "Chat instance created successfully",
    "variables": {
      "user_name": "John Doe",
      "account_id": "12345",
      "preference": "email"
    }
  },
  "errors": null
}