Create a new lead
curl --request POST \
--url https://api.heffl.com/api/v1/leads \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"mobile": "<string>",
"secondaryMobile": "<string>",
"email": "[email protected]",
"title": "<string>",
"value": 123,
"sourceId": "<string>",
"stageId": "<string>",
"website": "<unknown>"
}
'import requests
url = "https://api.heffl.com/api/v1/leads"
payload = {
"name": "<string>",
"mobile": "<string>",
"secondaryMobile": "<string>",
"email": "[email protected]",
"title": "<string>",
"value": 123,
"sourceId": "<string>",
"stageId": "<string>",
"website": "<unknown>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
mobile: '<string>',
secondaryMobile: '<string>',
email: '[email protected]',
title: '<string>',
value: 123,
sourceId: '<string>',
stageId: '<string>',
website: '<unknown>'
})
};
fetch('https://api.heffl.com/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.heffl.com/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([
'name' => '<string>',
'mobile' => '<string>',
'secondaryMobile' => '<string>',
'email' => '[email protected]',
'title' => '<string>',
'value' => 123,
'sourceId' => '<string>',
'stageId' => '<string>',
'website' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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.heffl.com/api/v1/leads"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"mobile\": \"<string>\",\n \"secondaryMobile\": \"<string>\",\n \"email\": \"[email protected]\",\n \"title\": \"<string>\",\n \"value\": 123,\n \"sourceId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"website\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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.heffl.com/api/v1/leads")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"mobile\": \"<string>\",\n \"secondaryMobile\": \"<string>\",\n \"email\": \"[email protected]\",\n \"title\": \"<string>\",\n \"value\": 123,\n \"sourceId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"website\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heffl.com/api/v1/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"mobile\": \"<string>\",\n \"secondaryMobile\": \"<string>\",\n \"email\": \"[email protected]\",\n \"title\": \"<string>\",\n \"value\": 123,\n \"sourceId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"website\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"number": "<string>",
"name": "<string>",
"archived": true,
"createdAt": "2023-11-07T05:31:56Z",
"title": "<string>",
"email": "<string>",
"mobile": "<string>",
"secondaryMobile": "<string>",
"website": "<string>",
"value": 123,
"sourceId": "<string>",
"stageId": "<string>",
"customFields": {}
}Leads
Create a new lead
Creates a new lead in your CRM. The lead will be assigned to the user associated with your API key.
POST
/
leads
Create a new lead
curl --request POST \
--url https://api.heffl.com/api/v1/leads \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"mobile": "<string>",
"secondaryMobile": "<string>",
"email": "[email protected]",
"title": "<string>",
"value": 123,
"sourceId": "<string>",
"stageId": "<string>",
"website": "<unknown>"
}
'import requests
url = "https://api.heffl.com/api/v1/leads"
payload = {
"name": "<string>",
"mobile": "<string>",
"secondaryMobile": "<string>",
"email": "[email protected]",
"title": "<string>",
"value": 123,
"sourceId": "<string>",
"stageId": "<string>",
"website": "<unknown>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
mobile: '<string>',
secondaryMobile: '<string>',
email: '[email protected]',
title: '<string>',
value: 123,
sourceId: '<string>',
stageId: '<string>',
website: '<unknown>'
})
};
fetch('https://api.heffl.com/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.heffl.com/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([
'name' => '<string>',
'mobile' => '<string>',
'secondaryMobile' => '<string>',
'email' => '[email protected]',
'title' => '<string>',
'value' => 123,
'sourceId' => '<string>',
'stageId' => '<string>',
'website' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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.heffl.com/api/v1/leads"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"mobile\": \"<string>\",\n \"secondaryMobile\": \"<string>\",\n \"email\": \"[email protected]\",\n \"title\": \"<string>\",\n \"value\": 123,\n \"sourceId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"website\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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.heffl.com/api/v1/leads")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"mobile\": \"<string>\",\n \"secondaryMobile\": \"<string>\",\n \"email\": \"[email protected]\",\n \"title\": \"<string>\",\n \"value\": 123,\n \"sourceId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"website\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heffl.com/api/v1/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"mobile\": \"<string>\",\n \"secondaryMobile\": \"<string>\",\n \"email\": \"[email protected]\",\n \"title\": \"<string>\",\n \"value\": 123,\n \"sourceId\": \"<string>\",\n \"stageId\": \"<string>\",\n \"website\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"number": "<string>",
"name": "<string>",
"archived": true,
"createdAt": "2023-11-07T05:31:56Z",
"title": "<string>",
"email": "<string>",
"mobile": "<string>",
"secondaryMobile": "<string>",
"website": "<string>",
"value": 123,
"sourceId": "<string>",
"stageId": "<string>",
"customFields": {}
}Authorizations
API key for authentication. Get yours at app.heffl.com/settings/developers
Body
application/json
Lead's full name
Mobile phone number with country code
Secondary mobile phone number with country code
Job title or position
Expected deal value or amount
Lead source public ID
Lead stage public ID
Company website URL
Response
200 - application/json
OK
Lead public ID
Auto-generated lead number
Full name
Whether the lead is archived
When the lead was created
Job title
Email address
Mobile phone number
Secondary mobile
Website URL
Expected value
Lead source public ID
Lead stage public ID
Custom field values
Show child attributes
Show child attributes
⌘I