Promote Agent to Production
curl --request POST \
--url https://api.bland.ai/v2/agents/{agent_id}/promote \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/agents/{agent_id}/promote"
headers = {"authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v2/agents/{agent_id}/promote', 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/v2/agents/{agent_id}/promote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.bland.ai/v2/agents/{agent_id}/promote"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("authorization", "<authorization>")
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/v2/agents/{agent_id}/promote")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/{agent_id}/promote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": {
"semver": "1.4.0",
"environments": [
{
"id": "3d5a2d9b-0457-4610-b6d0-86d09b42d8bc",
"env_type": "dev",
"current_version_id": null
},
{
"id": "f1ad8610-caea-4c4f-9d9b-3f35bf1a1a43",
"env_type": "staging",
"current_version_id": "46201abd-c8e6-4095-a65f-d5135a673627"
},
{
"id": "de65595f-4fbf-4d9e-9ce4-13dd995e863e",
"env_type": "production",
"current_version_id": "46201abd-c8e6-4095-a65f-d5135a673627"
}
]
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "STAGING_UNPINNED",
"message": "Publish to staging before promoting to production"
}
]
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Agent not found"
}
]
}
Environments and Releases
Promote Agent to Production
Pin production to the version currently in staging.
POST
/
v2
/
agents
/
{agent_id}
/
promote
Promote Agent to Production
curl --request POST \
--url https://api.bland.ai/v2/agents/{agent_id}/promote \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/agents/{agent_id}/promote"
headers = {"authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v2/agents/{agent_id}/promote', 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/v2/agents/{agent_id}/promote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.bland.ai/v2/agents/{agent_id}/promote"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("authorization", "<authorization>")
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/v2/agents/{agent_id}/promote")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/{agent_id}/promote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": {
"semver": "1.4.0",
"environments": [
{
"id": "3d5a2d9b-0457-4610-b6d0-86d09b42d8bc",
"env_type": "dev",
"current_version_id": null
},
{
"id": "f1ad8610-caea-4c4f-9d9b-3f35bf1a1a43",
"env_type": "staging",
"current_version_id": "46201abd-c8e6-4095-a65f-d5135a673627"
},
{
"id": "de65595f-4fbf-4d9e-9ce4-13dd995e863e",
"env_type": "production",
"current_version_id": "46201abd-c8e6-4095-a65f-d5135a673627"
}
]
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "STAGING_UNPINNED",
"message": "Publish to staging before promoting to production"
}
]
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Agent not found"
}
]
}
Overview
Moves the agent’sproduction pointer to whatever staging is pinned to and records a deployment carrying that version’s original semver; promoting never mints a new number. Phone numbers attached to the agent begin answering with the promoted version. No request body. The server does not run checks here: start one with Start Check Run beforehand and gate on its result yourself.
Requires an admin, owner, operator, or prompter role.
Headers
string
required
Your API key for authentication.
Path Parameters
string
required
The agent’s unique identifier.
Response
string
The promoted version’s number, for example
1.4.0.array
The agent’s three environments after the promote. Each has
id, env_type (dev, staging, or production), and current_version_id (the pinned version, or null if unpinned). staging and production now point at the same version.null | array
null on success, or a list of error objects if the request failed. Returns 400 STAGING_UNPINNED when nothing has been published to staging yet.{
"data": {
"semver": "1.4.0",
"environments": [
{
"id": "3d5a2d9b-0457-4610-b6d0-86d09b42d8bc",
"env_type": "dev",
"current_version_id": null
},
{
"id": "f1ad8610-caea-4c4f-9d9b-3f35bf1a1a43",
"env_type": "staging",
"current_version_id": "46201abd-c8e6-4095-a65f-d5135a673627"
},
{
"id": "de65595f-4fbf-4d9e-9ce4-13dd995e863e",
"env_type": "production",
"current_version_id": "46201abd-c8e6-4095-a65f-d5135a673627"
}
]
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "STAGING_UNPINNED",
"message": "Publish to staging before promoting to production"
}
]
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Agent not found"
}
]
}
Docs for agents: llms.txt
Was this page helpful?