Pathway Chat
curl --request POST \
--url https://us.api.bland.ai/v1/pathway/chat/{id} \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"message": "<string>"
}
'import requests
url = "https://us.api.bland.ai/v1/pathway/chat/{id}"
payload = { "message": "<string>" }
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: '<string>'})
};
fetch('https://us.api.bland.ai/v1/pathway/chat/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://us.api.bland.ai/v1/pathway/chat/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://us.api.bland.ai/v1/pathway/chat/{id}"
payload := strings.NewReader("{\n \"message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://us.api.bland.ai/v1/pathway/chat/{id}")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.api.bland.ai/v1/pathway/chat/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"chat_id": "12345678-1234-1234-1234-123456789012",
"assistant_responses": ["Hey there, this is the Bland Bistro reservation line. Do you want to make a reservation?"],
"current_node_id": "1",
"current_node_name": "Start",
"chat_history": [
{"role": "user", "content": "hello"},
{"role": "assistant", "content": "Hey there, this is the Bland Bistro reservation line. Do you want to make a reservation?"}
],
"pathway_id": "87654321-4321-4321-4321-210987654321",
"pathway_version": null,
"use_candidate_model": false,
"variables": {
"callID": "12345678-1234-1234-1234-123456789012"
},
"completed": false
},
"errors": null
}
Pathway Chat
Pathway Chat
Send a message to a pathway and receive a response.
POST
/
v1
/
pathway
/
chat
/
{id}
Pathway Chat
curl --request POST \
--url https://us.api.bland.ai/v1/pathway/chat/{id} \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"message": "<string>"
}
'import requests
url = "https://us.api.bland.ai/v1/pathway/chat/{id}"
payload = { "message": "<string>" }
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: '<string>'})
};
fetch('https://us.api.bland.ai/v1/pathway/chat/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://us.api.bland.ai/v1/pathway/chat/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://us.api.bland.ai/v1/pathway/chat/{id}"
payload := strings.NewReader("{\n \"message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://us.api.bland.ai/v1/pathway/chat/{id}")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://us.api.bland.ai/v1/pathway/chat/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"chat_id": "12345678-1234-1234-1234-123456789012",
"assistant_responses": ["Hey there, this is the Bland Bistro reservation line. Do you want to make a reservation?"],
"current_node_id": "1",
"current_node_name": "Start",
"chat_history": [
{"role": "user", "content": "hello"},
{"role": "assistant", "content": "Hey there, this is the Bland Bistro reservation line. Do you want to make a reservation?"}
],
"pathway_id": "87654321-4321-4321-4321-210987654321",
"pathway_version": null,
"use_candidate_model": false,
"variables": {
"callID": "12345678-1234-1234-1234-123456789012"
},
"completed": false
},
"errors": null
}
Headers
string
required
Your API key for authentication.
Path Parameters
uuid
required
The chat ID created from the /pathway/chat/create endpoint.
Body
string
The message to send to the pathway (optional)
Response
object
Contains the response data for the pathway chat message.
Show data properties
Show data properties
uuid
The ID of the chat instance.
array
An array of strings containing the assistant’s responses to the message sent.
string
The ID of the current node in the pathway after processing the message.
string
The name of the current node in the pathway.
array
An array of objects containing the role and content of each message in the external chat history.
string
The ID of the pathway the chat is associated with.
string | null
The version of the pathway being used, or null if not specified.
boolean
Whether the candidate model is being used for this pathway chat.
object
The current state of variables in the pathway execution.
boolean
Whether the pathway has completed execution.
null | array
Will be
null on success. Contains error details if the request failed.{
"data": {
"chat_id": "12345678-1234-1234-1234-123456789012",
"assistant_responses": ["Hey there, this is the Bland Bistro reservation line. Do you want to make a reservation?"],
"current_node_id": "1",
"current_node_name": "Start",
"chat_history": [
{"role": "user", "content": "hello"},
{"role": "assistant", "content": "Hey there, this is the Bland Bistro reservation line. Do you want to make a reservation?"}
],
"pathway_id": "87654321-4321-4321-4321-210987654321",
"pathway_version": null,
"use_candidate_model": false,
"variables": {
"callID": "12345678-1234-1234-1234-123456789012"
},
"completed": false
},
"errors": null
}
Docs for agents: llms.txt
Was this page helpful?
⌘I