curl --request POST \
--url https://api.topcalls.ai/v1/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"phone_number": "<string>",
"list_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"status": "New",
"notes": "<string>",
"notes_append": "<string>",
"tags": [],
"metadata": {}
}
'import requests
url = "https://api.topcalls.ai/v1/leads"
payload = {
"name": "<string>",
"phone_number": "<string>",
"list_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"status": "New",
"notes": "<string>",
"notes_append": "<string>",
"tags": [],
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
phone_number: '<string>',
list_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
email: 'jsmith@example.com',
status: 'New',
notes: '<string>',
notes_append: '<string>',
tags: [],
metadata: {}
})
};
fetch('https://api.topcalls.ai/v1/leads', 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",
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([
'name' => '<string>',
'phone_number' => '<string>',
'list_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'email' => 'jsmith@example.com',
'status' => 'New',
'notes' => '<string>',
'notes_append' => '<string>',
'tags' => [
],
'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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"list_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email\": \"jsmith@example.com\",\n \"status\": \"New\",\n \"notes\": \"<string>\",\n \"notes_append\": \"<string>\",\n \"tags\": [],\n \"metadata\": {}\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.topcalls.ai/v1/leads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"list_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email\": \"jsmith@example.com\",\n \"status\": \"New\",\n \"notes\": \"<string>\",\n \"notes_append\": \"<string>\",\n \"tags\": [],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topcalls.ai/v1/leads")
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 \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"list_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email\": \"jsmith@example.com\",\n \"status\": \"New\",\n \"notes\": \"<string>\",\n \"notes_append\": \"<string>\",\n \"tags\": [],\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",
"existed": true,
"email": "jsmith@example.com",
"notes": "<string>",
"metadata": {},
"converted_at": "2023-11-07T05:31:56Z",
"list_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"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",
"existed": true,
"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>"
}Create or attach lead
Creates a single lead and assigns it to the given list. Idempotent on
(account_id, phone_number): if a lead with this phone number already
exists in the account, the existing lead is attached to the requested
list (no error) and the response carries existed: true with HTTP 200.
A genuinely new lead returns HTTP 201 with existed: false.
notes and notes_append are mutually exclusive.
Requires scope: leads:write.
curl --request POST \
--url https://api.topcalls.ai/v1/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"phone_number": "<string>",
"list_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"status": "New",
"notes": "<string>",
"notes_append": "<string>",
"tags": [],
"metadata": {}
}
'import requests
url = "https://api.topcalls.ai/v1/leads"
payload = {
"name": "<string>",
"phone_number": "<string>",
"list_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"status": "New",
"notes": "<string>",
"notes_append": "<string>",
"tags": [],
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
phone_number: '<string>',
list_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
email: 'jsmith@example.com',
status: 'New',
notes: '<string>',
notes_append: '<string>',
tags: [],
metadata: {}
})
};
fetch('https://api.topcalls.ai/v1/leads', 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",
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([
'name' => '<string>',
'phone_number' => '<string>',
'list_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'email' => 'jsmith@example.com',
'status' => 'New',
'notes' => '<string>',
'notes_append' => '<string>',
'tags' => [
],
'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"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"list_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email\": \"jsmith@example.com\",\n \"status\": \"New\",\n \"notes\": \"<string>\",\n \"notes_append\": \"<string>\",\n \"tags\": [],\n \"metadata\": {}\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.topcalls.ai/v1/leads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"list_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email\": \"jsmith@example.com\",\n \"status\": \"New\",\n \"notes\": \"<string>\",\n \"notes_append\": \"<string>\",\n \"tags\": [],\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.topcalls.ai/v1/leads")
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 \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"list_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email\": \"jsmith@example.com\",\n \"status\": \"New\",\n \"notes\": \"<string>\",\n \"notes_append\": \"<string>\",\n \"tags\": [],\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",
"existed": true,
"email": "jsmith@example.com",
"notes": "<string>",
"metadata": {},
"converted_at": "2023-11-07T05:31:56Z",
"list_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"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",
"existed": true,
"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>"
}Authorizations
Use Authorization: Bearer tc_live_xxxxx
Body
1Phone number in E.164 format (also validated as dialable; country codes that don't exist are rejected)
^\+[1-9]\d{8,14}$New, Contacted, Converted, Unsubscribed Response
Existing lead attached to the requested list (idempotent)
Result of POST /v1/leads. existed=false (returned with HTTP 201) means
the phone number was new and a fresh lead row was created. existed=true
(returned with HTTP 200) means a lead with this phone number already
existed in the account; it has been (idempotently) attached to the
requested list, and list_ids reflects every list the lead is currently
in. The lead's other fields (name, email, notes, tags, metadata) are NOT
overwritten on the attach path - use PATCH /v1/leads/{id} for that.
^\+[1-9]\d{8,14}$New, Contacted, Converted, Unsubscribed false if a new lead was created; true if an existing lead was attached.