Public API
Create Lead
Create a lead (contact + deal) in one API call. This endpoint creates a contact and automatically adds it to a pipeline stage.
POST
/
public
/
api
/
v1
/
leads
Create Lead
curl --request POST \
--url https://api.evoai.app/public/api/v1/leads \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"custom_fields": {
"source": "website",
"campaign": "spring-2024"
},
"metadata": {
"utm_source": "google",
"utm_campaign": "ads"
}
}
'import requests
url = "https://api.evoai.app/public/api/v1/leads"
payload = {
"custom_fields": {
"source": "website",
"campaign": "spring-2024"
},
"metadata": {
"utm_source": "google",
"utm_campaign": "ads"
}
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
custom_fields: {source: 'website', campaign: 'spring-2024'},
metadata: {utm_source: 'google', utm_campaign: 'ads'}
})
};
fetch('https://api.evoai.app/public/api/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.evoai.app/public/api/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([
'custom_fields' => [
'source' => 'website',
'campaign' => 'spring-2024'
],
'metadata' => [
'utm_source' => 'google',
'utm_campaign' => 'ads'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_access_token: <api-key>"
],
]);
$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.evoai.app/public/api/v1/leads"
payload := strings.NewReader("{\n \"custom_fields\": {\n \"source\": \"website\",\n \"campaign\": \"spring-2024\"\n },\n \"metadata\": {\n \"utm_source\": \"google\",\n \"utm_campaign\": \"ads\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_access_token", "<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.post("https://api.evoai.app/public/api/v1/leads")
.header("api_access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"custom_fields\": {\n \"source\": \"website\",\n \"campaign\": \"spring-2024\"\n },\n \"metadata\": {\n \"utm_source\": \"google\",\n \"utm_campaign\": \"ads\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.evoai.app/public/api/v1/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_access_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"custom_fields\": {\n \"source\": \"website\",\n \"campaign\": \"spring-2024\"\n },\n \"metadata\": {\n \"utm_source\": \"google\",\n \"utm_campaign\": \"ads\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"lead_id": "770e0600-g40d-63f6-c938-668877662222",
"deal_id": "880e1711-h51e-74g7-d049-779988773333"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z"
},
"message": "Lead created successfully"
}{
"status": 400,
"error": "Bad Request"
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 403,
"error": "Forbidden"
}{
"status": 404,
"error": "Not Found"
}{
"status": 422,
"error": "Unprocessable Entity"
}{
"status": 500,
"error": "Internal Server Error"
}Autorizaciones
API access token for user authentication
Cuerpo
application/json
⌘I
Create Lead
curl --request POST \
--url https://api.evoai.app/public/api/v1/leads \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"custom_fields": {
"source": "website",
"campaign": "spring-2024"
},
"metadata": {
"utm_source": "google",
"utm_campaign": "ads"
}
}
'import requests
url = "https://api.evoai.app/public/api/v1/leads"
payload = {
"custom_fields": {
"source": "website",
"campaign": "spring-2024"
},
"metadata": {
"utm_source": "google",
"utm_campaign": "ads"
}
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
custom_fields: {source: 'website', campaign: 'spring-2024'},
metadata: {utm_source: 'google', utm_campaign: 'ads'}
})
};
fetch('https://api.evoai.app/public/api/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.evoai.app/public/api/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([
'custom_fields' => [
'source' => 'website',
'campaign' => 'spring-2024'
],
'metadata' => [
'utm_source' => 'google',
'utm_campaign' => 'ads'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_access_token: <api-key>"
],
]);
$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.evoai.app/public/api/v1/leads"
payload := strings.NewReader("{\n \"custom_fields\": {\n \"source\": \"website\",\n \"campaign\": \"spring-2024\"\n },\n \"metadata\": {\n \"utm_source\": \"google\",\n \"utm_campaign\": \"ads\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_access_token", "<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.post("https://api.evoai.app/public/api/v1/leads")
.header("api_access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"custom_fields\": {\n \"source\": \"website\",\n \"campaign\": \"spring-2024\"\n },\n \"metadata\": {\n \"utm_source\": \"google\",\n \"utm_campaign\": \"ads\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.evoai.app/public/api/v1/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_access_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"custom_fields\": {\n \"source\": \"website\",\n \"campaign\": \"spring-2024\"\n },\n \"metadata\": {\n \"utm_source\": \"google\",\n \"utm_campaign\": \"ads\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"lead_id": "770e0600-g40d-63f6-c938-668877662222",
"deal_id": "880e1711-h51e-74g7-d049-779988773333"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z"
},
"message": "Lead created successfully"
}{
"status": 400,
"error": "Bad Request"
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 403,
"error": "Forbidden"
}{
"status": 404,
"error": "Not Found"
}{
"status": 422,
"error": "Unprocessable Entity"
}{
"status": 500,
"error": "Internal Server Error"
}