Trigger an Outbound Agent Run by API Trigger Node
curl --request POST \
--url https://agents.labs.bandwidth.com/api/v1/public/agent/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "<string>",
"initial_context": {},
"telephony_configuration_id": 123
}
'import requests
url = "https://agents.labs.bandwidth.com/api/v1/public/agent/{uuid}"
payload = {
"phone_number": "<string>",
"initial_context": {},
"telephony_configuration_id": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({phone_number: '<string>', initial_context: {}, telephony_configuration_id: 123})
};
fetch('https://agents.labs.bandwidth.com/api/v1/public/agent/{uuid}', 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://agents.labs.bandwidth.com/api/v1/public/agent/{uuid}",
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([
'phone_number' => '<string>',
'initial_context' => [
],
'telephony_configuration_id' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://agents.labs.bandwidth.com/api/v1/public/agent/{uuid}"
payload := strings.NewReader("{\n \"phone_number\": \"<string>\",\n \"initial_context\": {},\n \"telephony_configuration_id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://agents.labs.bandwidth.com/api/v1/public/agent/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"<string>\",\n \"initial_context\": {},\n \"telephony_configuration_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents.labs.bandwidth.com/api/v1/public/agent/{uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"<string>\",\n \"initial_context\": {},\n \"telephony_configuration_id\": 123\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"workflow_run_id": 123,
"workflow_run_name": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Runs
Trigger an Outbound Agent Run by API Trigger Node
Start an outbound agent run using an API Trigger node UUID
POST
/
api
/
v1
/
public
/
agent
/
{uuid}
Trigger an Outbound Agent Run by API Trigger Node
curl --request POST \
--url https://agents.labs.bandwidth.com/api/v1/public/agent/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone_number": "<string>",
"initial_context": {},
"telephony_configuration_id": 123
}
'import requests
url = "https://agents.labs.bandwidth.com/api/v1/public/agent/{uuid}"
payload = {
"phone_number": "<string>",
"initial_context": {},
"telephony_configuration_id": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({phone_number: '<string>', initial_context: {}, telephony_configuration_id: 123})
};
fetch('https://agents.labs.bandwidth.com/api/v1/public/agent/{uuid}', 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://agents.labs.bandwidth.com/api/v1/public/agent/{uuid}",
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([
'phone_number' => '<string>',
'initial_context' => [
],
'telephony_configuration_id' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://agents.labs.bandwidth.com/api/v1/public/agent/{uuid}"
payload := strings.NewReader("{\n \"phone_number\": \"<string>\",\n \"initial_context\": {},\n \"telephony_configuration_id\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://agents.labs.bandwidth.com/api/v1/public/agent/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone_number\": \"<string>\",\n \"initial_context\": {},\n \"telephony_configuration_id\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents.labs.bandwidth.com/api/v1/public/agent/{uuid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phone_number\": \"<string>\",\n \"initial_context\": {},\n \"telephony_configuration_id\": 123\n}"
response = http.request(request)
puts response.read_body{
"status": "<string>",
"workflow_run_id": 123,
"workflow_run_name": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Outbound calling is temporarily disabled. Use the browser tester or incoming calls to test your agent. The reference below does not enable outbound calling.
super_user and at least Editor access to the selected workspace. API keys are not accepted for this endpoint. See authentication.
Use this endpoint when you want to start an agent run through an API Trigger node.
The uuid comes from the API Trigger node in your agent. Add the node to your workflow and copy its auto-generated trigger_path.
Use workflow_run_id from the response to later retrieve run details, recordings, and transcripts.
Pass initial_context to inject runtime data as template variables into the agent’s prompt. See Using initial context.
Pass telephony_configuration_id to route the call through a specific telephony configuration instead of your organization’s default. The id is shown on each row in Phone numbers.
This route expects an API Trigger node UUID (
trigger_path). Do not pass a workflow UUID here. If you want to execute by Agent UUID, use Trigger an outbound agent run by Agent UUID instead.Your telephony provider must be configured before outbound calls will connect. See Telephony for setup instructions.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json