import Retell from 'retell-sdk';
const client = new Retell({
apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted
});
const crmConfig = await client.crm.updateConfig();
console.log(crmConfig.org_id);import os
from retell import Retell
client = Retell(
api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted
)
crm_config = client.crm.update_config()
print(crm_config.org_id)curl --request POST \
--url https://api.retellai.com/update-crm-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"app_id": "<string>",
"custom_fields": [
{
"name": "<string>",
"label": "<string>",
"description": "<string>",
"options": [
"<string>"
]
}
],
"crm_analysis_data_mappings": [
{
"field_name": "<string>",
"analysis_data_name": "<string>"
}
],
"contact_columns_order": [
"<string>"
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retellai.com/update-crm-config",
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([
'app_id' => '<string>',
'custom_fields' => [
[
'name' => '<string>',
'label' => '<string>',
'description' => '<string>',
'options' => [
'<string>'
]
]
],
'crm_analysis_data_mappings' => [
[
'field_name' => '<string>',
'analysis_data_name' => '<string>'
]
],
'contact_columns_order' => [
'<string>'
]
]),
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/update-crm-config"
payload := strings.NewReader("{\n \"app_id\": \"<string>\",\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n \"<string>\"\n ]\n }\n ],\n \"crm_analysis_data_mappings\": [\n {\n \"field_name\": \"<string>\",\n \"analysis_data_name\": \"<string>\"\n }\n ],\n \"contact_columns_order\": [\n \"<string>\"\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.retellai.com/update-crm-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"app_id\": \"<string>\",\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n \"<string>\"\n ]\n }\n ],\n \"crm_analysis_data_mappings\": [\n {\n \"field_name\": \"<string>\",\n \"analysis_data_name\": \"<string>\"\n }\n ],\n \"contact_columns_order\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retellai.com/update-crm-config")
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 \"app_id\": \"<string>\",\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n \"<string>\"\n ]\n }\n ],\n \"crm_analysis_data_mappings\": [\n {\n \"field_name\": \"<string>\",\n \"analysis_data_name\": \"<string>\"\n }\n ],\n \"contact_columns_order\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"org_id": "<string>",
"app_id": "<string>",
"last_sync_timestamp": 123,
"custom_fields": [
{
"name": "<string>",
"type": "string",
"label": "<string>",
"description": "<string>",
"options": [
"<string>"
]
}
],
"crm_analysis_data_mappings": [
{
"field_name": "<string>",
"analysis_data_name": "<string>",
"update_mode": "overwrite"
}
],
"contact_columns_order": [
"<string>"
]
}{
"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": "Account rate limited, please throttle your requests."
}{
"status": "error",
"message": "An unexpected server error occurred."
}Update CRM Config
Update the organization’s CRM configuration. Omitted fields stay as they are; a field that is sent replaces its stored value in full.
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: process.env['RETELL_API_KEY'], // This is the default and can be omitted
});
const crmConfig = await client.crm.updateConfig();
console.log(crmConfig.org_id);import os
from retell import Retell
client = Retell(
api_key=os.environ.get("RETELL_API_KEY"), # This is the default and can be omitted
)
crm_config = client.crm.update_config()
print(crm_config.org_id)curl --request POST \
--url https://api.retellai.com/update-crm-config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"app_id": "<string>",
"custom_fields": [
{
"name": "<string>",
"label": "<string>",
"description": "<string>",
"options": [
"<string>"
]
}
],
"crm_analysis_data_mappings": [
{
"field_name": "<string>",
"analysis_data_name": "<string>"
}
],
"contact_columns_order": [
"<string>"
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.retellai.com/update-crm-config",
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([
'app_id' => '<string>',
'custom_fields' => [
[
'name' => '<string>',
'label' => '<string>',
'description' => '<string>',
'options' => [
'<string>'
]
]
],
'crm_analysis_data_mappings' => [
[
'field_name' => '<string>',
'analysis_data_name' => '<string>'
]
],
'contact_columns_order' => [
'<string>'
]
]),
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/update-crm-config"
payload := strings.NewReader("{\n \"app_id\": \"<string>\",\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n \"<string>\"\n ]\n }\n ],\n \"crm_analysis_data_mappings\": [\n {\n \"field_name\": \"<string>\",\n \"analysis_data_name\": \"<string>\"\n }\n ],\n \"contact_columns_order\": [\n \"<string>\"\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.retellai.com/update-crm-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"app_id\": \"<string>\",\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n \"<string>\"\n ]\n }\n ],\n \"crm_analysis_data_mappings\": [\n {\n \"field_name\": \"<string>\",\n \"analysis_data_name\": \"<string>\"\n }\n ],\n \"contact_columns_order\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.retellai.com/update-crm-config")
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 \"app_id\": \"<string>\",\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"options\": [\n \"<string>\"\n ]\n }\n ],\n \"crm_analysis_data_mappings\": [\n {\n \"field_name\": \"<string>\",\n \"analysis_data_name\": \"<string>\"\n }\n ],\n \"contact_columns_order\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"org_id": "<string>",
"app_id": "<string>",
"last_sync_timestamp": 123,
"custom_fields": [
{
"name": "<string>",
"type": "string",
"label": "<string>",
"description": "<string>",
"options": [
"<string>"
]
}
],
"crm_analysis_data_mappings": [
{
"field_name": "<string>",
"analysis_data_name": "<string>",
"update_mode": "overwrite"
}
],
"contact_columns_order": [
"<string>"
]
}{
"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": "Account rate limited, please throttle your requests."
}{
"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"
Body
ID of the CRM app to link. Pass null to unlink, which stops syncing. Changing it resets the sync cursor, so the next sync re-reads every contact from the new CRM.
Replaces the stored list. Names must be snake_case and cannot collide with a built-in contact field or start with contact/external. Removing a field that an analysis data mapping still targets is rejected — send crm_analysis_data_mappings in the same request to retarget or drop those mappings.
200Show child attributes
Show child attributes
Replaces the stored list.
200Show child attributes
Show child attributes
Preferred display order of contact fields, for clients that render contacts as a table. Not used by the API itself.
200Response
Updated CRM config.
The connected CRM integration app ID.
Epoch milliseconds of the last successful sync.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Preferred display order of contact fields, for clients that render contacts as a table. Not used by the API itself.
Was this page helpful?

