Runs
Run Outcome
Run an outcome on one call or SMS conversation.
POST
/
v1
/
dispositions
/
{id}
/
run
Run Outcome
curl --request POST \
--url https://api.bland.ai/v1/dispositions/{id}/run \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"conversation_id": "<string>",
"reference_type": "<string>"
}
'import requests
url = "https://api.bland.ai/v1/dispositions/{id}/run"
payload = {
"conversation_id": "<string>",
"reference_type": "<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({conversation_id: '<string>', reference_type: '<string>'})
};
fetch('https://api.bland.ai/v1/dispositions/{id}/run', 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://api.bland.ai/v1/dispositions/{id}/run",
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([
'conversation_id' => '<string>',
'reference_type' => '<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://api.bland.ai/v1/dispositions/{id}/run"
payload := strings.NewReader("{\n \"conversation_id\": \"<string>\",\n \"reference_type\": \"<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://api.bland.ai/v1/dispositions/{id}/run")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"conversation_id\": \"<string>\",\n \"reference_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/dispositions/{id}/run")
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 \"conversation_id\": \"<string>\",\n \"reference_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"disposition_id": "b3174d14-49bc-4e10-a12b-7dbe2480e377",
"snippet_version": 3,
"status": "COMPLETE",
"result": {
"booked": true,
"minutes": 2.4
},
"error": null,
"exec_time": 41
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Disposition not found"
}
]
}
Runs the outcome’s current script on a single conversation and returns the result. Use it to test a script, or to re-run an outcome on a past call. To run it on more conversations, send one request per conversation.
Each run is saved, so you can read it back later with List Outcome Runs.
Docs for agents: llms.txt
Headers
string
required
Your API key for authentication.
Path Parameters
string
required
The outcome ID.
Body Parameters
string
required
The call ID or SMS conversation ID to run the outcome on.
string
required
One of
CALL, CALL_TEST, PATHWAY or PERSONA. Use CALL_TEST to mark the run as a test. The other values save the run as CALL, or as SMS for an SMS conversation.Response
object | null
The run result.
null when no call or SMS conversation with that ID exists in your organization.null | array
null on success, otherwise an array of error objects.{
"data": {
"disposition_id": "b3174d14-49bc-4e10-a12b-7dbe2480e377",
"snippet_version": 3,
"status": "COMPLETE",
"result": {
"booked": true,
"minutes": 2.4
},
"error": null,
"exec_time": 41
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Disposition not found"
}
]
}
Docs for agents: llms.txt
Was this page helpful?
⌘I
Run Outcome
curl --request POST \
--url https://api.bland.ai/v1/dispositions/{id}/run \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"conversation_id": "<string>",
"reference_type": "<string>"
}
'import requests
url = "https://api.bland.ai/v1/dispositions/{id}/run"
payload = {
"conversation_id": "<string>",
"reference_type": "<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({conversation_id: '<string>', reference_type: '<string>'})
};
fetch('https://api.bland.ai/v1/dispositions/{id}/run', 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://api.bland.ai/v1/dispositions/{id}/run",
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([
'conversation_id' => '<string>',
'reference_type' => '<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://api.bland.ai/v1/dispositions/{id}/run"
payload := strings.NewReader("{\n \"conversation_id\": \"<string>\",\n \"reference_type\": \"<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://api.bland.ai/v1/dispositions/{id}/run")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"conversation_id\": \"<string>\",\n \"reference_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/dispositions/{id}/run")
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 \"conversation_id\": \"<string>\",\n \"reference_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"disposition_id": "b3174d14-49bc-4e10-a12b-7dbe2480e377",
"snippet_version": 3,
"status": "COMPLETE",
"result": {
"booked": true,
"minutes": 2.4
},
"error": null,
"exec_time": 41
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Disposition not found"
}
]
}