Update lead
curl --request PATCH \
--url https://api.topcalls.ai/v1/leads/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"notes": "<string>",
"notes_append": "<string>",
"tags": [
"<string>"
],
"metadata": {}
}
'import requests
url = "https://api.topcalls.ai/v1/leads/{id}"
payload = {
"name": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"notes": "<string>",
"notes_append": "<string>",
"tags": ["<string>"],
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
phone_number: '<string>',
email: 'jsmith@example.com',
notes: '<string>',
notes_append: '<string>',
tags: ['<string>'],
metadata: {}
})
};
fetch('https://api.topcalls.ai/v1/leads/{id}', 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.topcalls.ai/v1/leads/{id}",
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([
'name' => '<string>',
'phone_number' => '<string>',
'email' => 'jsmith@example.com',
'notes' => '<string>',
'notes_append' => '<string>',
'tags' => [
'<string>'
],
'metadata' => [
]
]),
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.topcalls.ai/v1/leads/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"notes\": \"<string>\",\n \"notes_append\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.topcalls.ai/v1/leads/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"notes\": \"<string>\",\n \"notes_append\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topcalls.ai/v1/leads/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"notes\": \"<string>\",\n \"notes_append\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"phone_number": "<string>",
"status": "New",
"tags": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"email": "jsmith@example.com",
"notes": "<string>",
"metadata": {},
"converted_at": "2023-11-07T05:31:56Z",
"list_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}Leads
Update lead
Requires scope: leads:write. Body must contain at least one field; notes and notes_append are mutually exclusive.
PATCH
/
v1
/
leads
/
{id}
Update lead
curl --request PATCH \
--url https://api.topcalls.ai/v1/leads/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"notes": "<string>",
"notes_append": "<string>",
"tags": [
"<string>"
],
"metadata": {}
}
'import requests
url = "https://api.topcalls.ai/v1/leads/{id}"
payload = {
"name": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"notes": "<string>",
"notes_append": "<string>",
"tags": ["<string>"],
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
phone_number: '<string>',
email: 'jsmith@example.com',
notes: '<string>',
notes_append: '<string>',
tags: ['<string>'],
metadata: {}
})
};
fetch('https://api.topcalls.ai/v1/leads/{id}', 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.topcalls.ai/v1/leads/{id}",
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([
'name' => '<string>',
'phone_number' => '<string>',
'email' => 'jsmith@example.com',
'notes' => '<string>',
'notes_append' => '<string>',
'tags' => [
'<string>'
],
'metadata' => [
]
]),
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.topcalls.ai/v1/leads/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"notes\": \"<string>\",\n \"notes_append\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.topcalls.ai/v1/leads/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"notes\": \"<string>\",\n \"notes_append\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topcalls.ai/v1/leads/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"notes\": \"<string>\",\n \"notes_append\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"phone_number": "<string>",
"status": "New",
"tags": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"email": "jsmith@example.com",
"notes": "<string>",
"metadata": {},
"converted_at": "2023-11-07T05:31:56Z",
"list_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"code": "<string>",
"instance": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"errors": [
{
"path": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"details": "<string>"
}Authorizations
Use Authorization: Bearer tc_live_xxxxx
Path Parameters
Body
application/json
Minimum string length:
1Phone number in E.164 format (also validated as dialable; country codes that don't exist are rejected)
Pattern:
^\+[1-9]\d{8,14}$Available options:
New, Contacted, Converted, Unsubscribed Response
OK
Pattern:
^\+[1-9]\d{8,14}$Available options:
New, Contacted, Converted, Unsubscribed ⌘I