JavaScript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted
});
await client.agent.publish('agent_xxx', { version: 15 });import os
from retell import Retell
client = Retell(
api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted
)
client.agent.publish(
agent_id="agent_xxx",
version=15,
)curl --request POST \
--url https://api.retellai.com/publish-agent-version/{agent_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": 15,
"version_description": "Hotfix for transfer timeout",
"version_title": "Hotfix"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retellai.com/publish-agent-version/{agent_id}",
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([
'version' => 15,
'version_description' => 'Hotfix for transfer timeout',
'version_title' => 'Hotfix'
]),
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.retellai.com/publish-agent-version/{agent_id}"
payload := strings.NewReader("{\n \"version\": 15,\n \"version_description\": \"Hotfix for transfer timeout\",\n \"version_title\": \"Hotfix\"\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.retellai.com/publish-agent-version/{agent_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 15,\n \"version_description\": \"Hotfix for transfer timeout\",\n \"version_title\": \"Hotfix\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retellai.com/publish-agent-version/{agent_id}")
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 \"version\": 15,\n \"version_description\": \"Hotfix for transfer timeout\",\n \"version_title\": \"Hotfix\"\n}"
response = http.request(request)
puts response.read_body{
"status": "error",
"message": "Invalid request format, please check API reference."
}{
"status": "error",
"message": "API key is missing or invalid."
}{
"status": "error",
"message": "The requested resource was not found."
}{
"status": "error",
"message": "Cannot find requested asset under given api key."
}{
"status": "error",
"message": "An unexpected server error occurred."
}Chat Agent
Publish Chat Agent
Publish an existing draft version in place.
POST
/
publish-agent-version
/
{agent_id}
JavaScript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted
});
await client.agent.publish('agent_xxx', { version: 15 });import os
from retell import Retell
client = Retell(
api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted
)
client.agent.publish(
agent_id="agent_xxx",
version=15,
)curl --request POST \
--url https://api.retellai.com/publish-agent-version/{agent_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": 15,
"version_description": "Hotfix for transfer timeout",
"version_title": "Hotfix"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retellai.com/publish-agent-version/{agent_id}",
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([
'version' => 15,
'version_description' => 'Hotfix for transfer timeout',
'version_title' => 'Hotfix'
]),
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.retellai.com/publish-agent-version/{agent_id}"
payload := strings.NewReader("{\n \"version\": 15,\n \"version_description\": \"Hotfix for transfer timeout\",\n \"version_title\": \"Hotfix\"\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.retellai.com/publish-agent-version/{agent_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 15,\n \"version_description\": \"Hotfix for transfer timeout\",\n \"version_title\": \"Hotfix\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retellai.com/publish-agent-version/{agent_id}")
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 \"version\": 15,\n \"version_description\": \"Hotfix for transfer timeout\",\n \"version_title\": \"Hotfix\"\n}"
response = http.request(request)
puts response.read_body{
"status": "error",
"message": "Invalid request format, please check API reference."
}{
"status": "error",
"message": "API key is missing or invalid."
}{
"status": "error",
"message": "The requested resource was not found."
}{
"status": "error",
"message": "Cannot find requested asset under given api key."
}{
"status": "error",
"message": "An unexpected server error occurred."
}Authorizations
Authentication header containing API key (find it in dashboard). The format is "Bearer YOUR_API_KEY"
Path Parameters
Unique id of the agent.
Minimum string length:
1Example:
"agent_xxx"
Body
application/json
Response
Agent version published successfully.
Was this page helpful?
⌘I

