List Agent Environments
curl --request GET \
--url https://api.bland.ai/v2/agents/{agent_id}/environments \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/agents/{agent_id}/environments"
headers = {"authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v2/agents/{agent_id}/environments', 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}/environments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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}/environments"
req, _ := http.NewRequest("GET", 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.get("https://api.bland.ai/v2/agents/{agent_id}/environments")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/{agent_id}/environments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3f16480d-528f-4861-9e23-c2f40ceaf895",
"env_type": "dev",
"current_version_id": null,
"current_version": null
},
{
"id": "2d2740be-28ce-4a2b-bcfc-9ad947bb9faa",
"env_type": "staging",
"current_version_id": "54bc3ac6-7481-429f-8995-e7b119cf3b06",
"current_version": {
"name": "Holiday hours",
"semver": "1.4.0"
}
},
{
"id": "bf884f61-5034-48b4-9a2e-2f38fd0af537",
"env_type": "production",
"current_version_id": "7a971ff5-3ff8-41bd-a21e-fc3e3537cb6b",
"current_version": {
"name": null,
"semver": "1.3.2"
}
}
],
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Agent not found"
}
]
}
Environments and Releases
List Agent Environments
List an agent’s environments with their pinned versions.
GET
/
v2
/
agents
/
{agent_id}
/
environments
List Agent Environments
curl --request GET \
--url https://api.bland.ai/v2/agents/{agent_id}/environments \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/agents/{agent_id}/environments"
headers = {"authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v2/agents/{agent_id}/environments', 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}/environments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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}/environments"
req, _ := http.NewRequest("GET", 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.get("https://api.bland.ai/v2/agents/{agent_id}/environments")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/{agent_id}/environments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3f16480d-528f-4861-9e23-c2f40ceaf895",
"env_type": "dev",
"current_version_id": null,
"current_version": null
},
{
"id": "2d2740be-28ce-4a2b-bcfc-9ad947bb9faa",
"env_type": "staging",
"current_version_id": "54bc3ac6-7481-429f-8995-e7b119cf3b06",
"current_version": {
"name": "Holiday hours",
"semver": "1.4.0"
}
},
{
"id": "bf884f61-5034-48b4-9a2e-2f38fd0af537",
"env_type": "production",
"current_version_id": "7a971ff5-3ff8-41bd-a21e-fc3e3537cb6b",
"current_version": {
"name": null,
"semver": "1.3.2"
}
}
],
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Agent not found"
}
]
}
Overview
Returns the agent’sdev, staging, and production environments, each with the name and semver of the version it is pinned to. dev is never pinned: it always runs the newest saved version. Move the staging pointer with Publish Agent to Staging and the production pointer with Promote Agent to Production or Roll Back Agent.
Headers
string
required
Your API key for authentication.
Path Parameters
string
required
The agent’s unique identifier.
Response
array
The agent’s three environments.
Show environment object
Show environment object
string
Unique identifier for the environment.
string
One of
dev, staging, production.string | null
ID of the version this environment is pinned to.
null when unpinned. Always null for dev.object | null
Details of the pinned version, or
null when unpinned. Contains name (the version’s saved name, or null if it was never named) and semver (the version number minted when it was first published, or null if it has never been published).null | array
null on success, or a list of error objects if the request failed.{
"data": [
{
"id": "3f16480d-528f-4861-9e23-c2f40ceaf895",
"env_type": "dev",
"current_version_id": null,
"current_version": null
},
{
"id": "2d2740be-28ce-4a2b-bcfc-9ad947bb9faa",
"env_type": "staging",
"current_version_id": "54bc3ac6-7481-429f-8995-e7b119cf3b06",
"current_version": {
"name": "Holiday hours",
"semver": "1.4.0"
}
},
{
"id": "bf884f61-5034-48b4-9a2e-2f38fd0af537",
"env_type": "production",
"current_version_id": "7a971ff5-3ff8-41bd-a21e-fc3e3537cb6b",
"current_version": {
"name": null,
"semver": "1.3.2"
}
}
],
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Agent not found"
}
]
}
Docs for agents: llms.txt
Was this page helpful?