curl --request POST \
--url https://api.branchpilot.ai/v1/decide/{slug} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"email": "anna@acme.com",
"message": "Could we get a quote for 40 seats?"
}
}
'import requests
url = "https://api.branchpilot.ai/v1/decide/{slug}"
payload = { "input": {
"email": "anna@acme.com",
"message": "Could we get a quote for 40 seats?"
} }
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({input: {email: 'anna@acme.com', message: 'Could we get a quote for 40 seats?'}})
};
fetch('https://api.branchpilot.ai/v1/decide/{slug}', 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.branchpilot.ai/v1/decide/{slug}",
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([
'input' => [
'email' => 'anna@acme.com',
'message' => 'Could we get a quote for 40 seats?'
]
]),
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://api.branchpilot.ai/v1/decide/{slug}"
payload := strings.NewReader("{\n \"input\": {\n \"email\": \"anna@acme.com\",\n \"message\": \"Could we get a quote for 40 seats?\"\n }\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://api.branchpilot.ai/v1/decide/{slug}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"email\": \"anna@acme.com\",\n \"message\": \"Could we get a quote for 40 seats?\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.branchpilot.ai/v1/decide/{slug}")
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 \"input\": {\n \"email\": \"anna@acme.com\",\n \"message\": \"Could we get a quote for 40 seats?\"\n }\n}"
response = http.request(request)
puts response.read_body{
"run_id": "3f0b2c1e-6c1d-4a1e-9f3a-8a1b2c3d4e5f",
"decision": "lead-routing",
"version": 3,
"status": "ok",
"choice": "sales",
"probabilities": {
"sales": 0.87,
"support": 0.09,
"spam": 0.04
},
"confidence": 0.87,
"confidence_source": "calibrated",
"engine": "jev",
"model": "jev-1.13.0",
"latency_ms": 212,
"pii_redacted": 1
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Make a decision
Runs the live version of the decision (or options.version) on input.
curl --request POST \
--url https://api.branchpilot.ai/v1/decide/{slug} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"email": "anna@acme.com",
"message": "Could we get a quote for 40 seats?"
}
}
'import requests
url = "https://api.branchpilot.ai/v1/decide/{slug}"
payload = { "input": {
"email": "anna@acme.com",
"message": "Could we get a quote for 40 seats?"
} }
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({input: {email: 'anna@acme.com', message: 'Could we get a quote for 40 seats?'}})
};
fetch('https://api.branchpilot.ai/v1/decide/{slug}', 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.branchpilot.ai/v1/decide/{slug}",
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([
'input' => [
'email' => 'anna@acme.com',
'message' => 'Could we get a quote for 40 seats?'
]
]),
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://api.branchpilot.ai/v1/decide/{slug}"
payload := strings.NewReader("{\n \"input\": {\n \"email\": \"anna@acme.com\",\n \"message\": \"Could we get a quote for 40 seats?\"\n }\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://api.branchpilot.ai/v1/decide/{slug}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"email\": \"anna@acme.com\",\n \"message\": \"Could we get a quote for 40 seats?\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.branchpilot.ai/v1/decide/{slug}")
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 \"input\": {\n \"email\": \"anna@acme.com\",\n \"message\": \"Could we get a quote for 40 seats?\"\n }\n}"
response = http.request(request)
puts response.read_body{
"run_id": "3f0b2c1e-6c1d-4a1e-9f3a-8a1b2c3d4e5f",
"decision": "lead-routing",
"version": 3,
"status": "ok",
"choice": "sales",
"probabilities": {
"sales": 0.87,
"support": 0.09,
"spam": 0.04
},
"confidence": 0.87,
"confidence_source": "calibrated",
"engine": "jev",
"model": "jev-1.13.0",
"latency_ms": 212,
"pii_redacted": 1
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
An API key created in Settings → API keys (bp_live_… or bp_test_…).
Path Parameters
Slug of the decision, as shown in the app.
^[a-z0-9]+(-[a-z0-9]+)*$"lead-routing"
Body
Response
The decision.
uncertain: confidence below the decision threshold. pending: sent to the human review queue.
ok, uncertain, pending Show child attributes
Show child attributes
0 <= x <= 1jev, llm_fallback Number of personal-data substitutions performed before the model call.
Route decisions. __uncertain__ when status is uncertain.
Score decisions, remapped to 0–100.
0 <= x <= 100Score decisions, weighted position on the 0..N-1 level scale.
Score decisions, level index → label.
Show child attributes
Show child attributes
Classify decisions, labels whose probability reached their threshold.
calibrated, self_reported Present when the LLM fallback answered; why the primary engine did not.
Present when status is pending.