Update Live Call
curl --request PATCH \
--url https://api.trysela.com/api/leads/{id}/live-call/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"connected_representative": {
"external_id": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"active": true,
"metadata": {}
},
"other_external_identifiers": {},
"connected_timestamp": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.trysela.com/api/leads/{id}/live-call/"
payload = {
"connected_representative": {
"external_id": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"active": True,
"metadata": {}
},
"other_external_identifiers": {},
"connected_timestamp": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connected_representative: {
external_id: '<string>',
phone_number: '<string>',
email: 'jsmith@example.com',
active: true,
metadata: {}
},
other_external_identifiers: {},
connected_timestamp: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.trysela.com/api/leads/{id}/live-call/', 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.trysela.com/api/leads/{id}/live-call/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'connected_representative' => [
'external_id' => '<string>',
'phone_number' => '<string>',
'email' => 'jsmith@example.com',
'active' => true,
'metadata' => [
]
],
'other_external_identifiers' => [
],
'connected_timestamp' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.trysela.com/api/leads/{id}/live-call/"
payload := strings.NewReader("{\n \"connected_representative\": {\n \"external_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"active\": true,\n \"metadata\": {}\n },\n \"other_external_identifiers\": {},\n \"connected_timestamp\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.patch("https://api.trysela.com/api/leads/{id}/live-call/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"connected_representative\": {\n \"external_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"active\": true,\n \"metadata\": {}\n },\n \"other_external_identifiers\": {},\n \"connected_timestamp\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trysela.com/api/leads/{id}/live-call/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connected_representative\": {\n \"external_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"active\": true,\n \"metadata\": {}\n },\n \"other_external_identifiers\": {},\n \"connected_timestamp\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"chat_id": 12345,
"representative_id": 67,
"representative_external_id": "REP-123"
}Leads
Update Live Call
Updates a live call for this lead with connected representative information and other external identifiers. This endpoint is used when a customer’s CRM notifies us that a loan officer picked up a transferred call. The endpoint will find the appropriate chat (using connected_timestamp if provided, otherwise an active call, a recent warm transfer, or a recent blind transfer/escalation) and link the representative to it. If no matching representative exists, a new one will be created. The external_id field is required and must be unique per company.
PATCH
/
api
/
leads
/
{id}
/
live-call
/
Update Live Call
curl --request PATCH \
--url https://api.trysela.com/api/leads/{id}/live-call/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"connected_representative": {
"external_id": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"active": true,
"metadata": {}
},
"other_external_identifiers": {},
"connected_timestamp": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.trysela.com/api/leads/{id}/live-call/"
payload = {
"connected_representative": {
"external_id": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"active": True,
"metadata": {}
},
"other_external_identifiers": {},
"connected_timestamp": "2023-11-07T05:31:56Z"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connected_representative: {
external_id: '<string>',
phone_number: '<string>',
email: 'jsmith@example.com',
active: true,
metadata: {}
},
other_external_identifiers: {},
connected_timestamp: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.trysela.com/api/leads/{id}/live-call/', 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.trysela.com/api/leads/{id}/live-call/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'connected_representative' => [
'external_id' => '<string>',
'phone_number' => '<string>',
'email' => 'jsmith@example.com',
'active' => true,
'metadata' => [
]
],
'other_external_identifiers' => [
],
'connected_timestamp' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.trysela.com/api/leads/{id}/live-call/"
payload := strings.NewReader("{\n \"connected_representative\": {\n \"external_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"active\": true,\n \"metadata\": {}\n },\n \"other_external_identifiers\": {},\n \"connected_timestamp\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.patch("https://api.trysela.com/api/leads/{id}/live-call/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"connected_representative\": {\n \"external_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"active\": true,\n \"metadata\": {}\n },\n \"other_external_identifiers\": {},\n \"connected_timestamp\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trysela.com/api/leads/{id}/live-call/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connected_representative\": {\n \"external_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"active\": true,\n \"metadata\": {}\n },\n \"other_external_identifiers\": {},\n \"connected_timestamp\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"chat_id": 12345,
"representative_id": 67,
"representative_external_id": "REP-123"
}Authorizations
Token-based authentication with required prefix "Token"
Path Parameters
A unique integer value identifying this lead.
Body
application/json
Response
Live call successfully updated with representative information.
⌘I