Lead
Update a lead
PUT
/
v1
/
leads
/
{id}
Update a lead
curl --request PUT \
--url https://dev.flextell.ai/api/v1/leads/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"description": "<string>",
"message": "<string>",
"preferred_contact": "<string>",
"source_page_url": "<string>",
"lead_status_id": 123,
"lead_reference_source_id": 123,
"assigned_user_id": 123,
"country_id": 123,
"marketing_attribution": [
"<string>"
]
}
'import requests
url = "https://dev.flextell.ai/api/v1/leads/{id}"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"description": "<string>",
"message": "<string>",
"preferred_contact": "<string>",
"source_page_url": "<string>",
"lead_status_id": 123,
"lead_reference_source_id": 123,
"assigned_user_id": 123,
"country_id": 123,
"marketing_attribution": ["<string>"]
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
first_name: '<string>',
last_name: '<string>',
phone_number: '<string>',
email: 'jsmith@example.com',
description: '<string>',
message: '<string>',
preferred_contact: '<string>',
source_page_url: '<string>',
lead_status_id: 123,
lead_reference_source_id: 123,
assigned_user_id: 123,
country_id: 123,
marketing_attribution: ['<string>']
})
};
fetch('https://dev.flextell.ai/api/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://dev.flextell.ai/api/v1/leads/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'first_name' => '<string>',
'last_name' => '<string>',
'phone_number' => '<string>',
'email' => 'jsmith@example.com',
'description' => '<string>',
'message' => '<string>',
'preferred_contact' => '<string>',
'source_page_url' => '<string>',
'lead_status_id' => 123,
'lead_reference_source_id' => 123,
'assigned_user_id' => 123,
'country_id' => 123,
'marketing_attribution' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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://dev.flextell.ai/api/v1/leads/{id}"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"description\": \"<string>\",\n \"message\": \"<string>\",\n \"preferred_contact\": \"<string>\",\n \"source_page_url\": \"<string>\",\n \"lead_status_id\": 123,\n \"lead_reference_source_id\": 123,\n \"assigned_user_id\": 123,\n \"country_id\": 123,\n \"marketing_attribution\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
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.put("https://dev.flextell.ai/api/v1/leads/{id}")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"description\": \"<string>\",\n \"message\": \"<string>\",\n \"preferred_contact\": \"<string>\",\n \"source_page_url\": \"<string>\",\n \"lead_status_id\": 123,\n \"lead_reference_source_id\": 123,\n \"assigned_user_id\": 123,\n \"country_id\": 123,\n \"marketing_attribution\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.flextell.ai/api/v1/leads/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"description\": \"<string>\",\n \"message\": \"<string>\",\n \"preferred_contact\": \"<string>\",\n \"source_page_url\": \"<string>\",\n \"lead_status_id\": 123,\n \"lead_reference_source_id\": 123,\n \"assigned_user_id\": 123,\n \"country_id\": 123,\n \"marketing_attribution\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>",
"full_name": "<string>",
"phone_number": "<string>",
"email": "<string>",
"description": "<string>",
"message": "<string>",
"preferred_contact": "<string>",
"source_page_url": "<string>",
"country_id": 123,
"is_converted": "<string>",
"converted_at": "2023-11-07T05:31:56Z",
"customer_id": 123,
"marketing_attribution": [
"<unknown>"
],
"external_id": "<string>",
"external_branch_id": "<string>",
"external_created_at": "2023-11-07T05:31:56Z",
"last_synced_at": "2023-11-07T05:31:56Z",
"import_source_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"status": {
"id": 123,
"name": "<string>",
"slug": "<string>",
"color": "<string>",
"is_terminal": true
},
"reference_source": {
"id": 123,
"name": "<string>",
"external_id": "<string>"
},
"assigned_user": {
"id": 123,
"name": "<string>"
},
"country_name": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error": "<string>",
"data": {
"message": "<string>"
},
"errors": null
}{
"message": "<string>",
"errors": {}
}Authorizations
oauth2bearer
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.
Path Parameters
The lead identifier
Body
application/json
The first name.
Maximum string length:
255The last name.
Maximum string length:
255The phone number in E.164 format.
Maximum string length:
50The email address.
Maximum string length:
255The description.
The message body.
Preferred contact channel.
Maximum string length:
50URL of the page that produced the lead.
Maximum string length:
2048The lead status ID.
The lead reference source ID.
The assigned user ID.
The country ID.
The marketing attribution.
⌘I
Update a lead
curl --request PUT \
--url https://dev.flextell.ai/api/v1/leads/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"first_name": "<string>",
"last_name": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"description": "<string>",
"message": "<string>",
"preferred_contact": "<string>",
"source_page_url": "<string>",
"lead_status_id": 123,
"lead_reference_source_id": 123,
"assigned_user_id": 123,
"country_id": 123,
"marketing_attribution": [
"<string>"
]
}
'import requests
url = "https://dev.flextell.ai/api/v1/leads/{id}"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"description": "<string>",
"message": "<string>",
"preferred_contact": "<string>",
"source_page_url": "<string>",
"lead_status_id": 123,
"lead_reference_source_id": 123,
"assigned_user_id": 123,
"country_id": 123,
"marketing_attribution": ["<string>"]
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
first_name: '<string>',
last_name: '<string>',
phone_number: '<string>',
email: 'jsmith@example.com',
description: '<string>',
message: '<string>',
preferred_contact: '<string>',
source_page_url: '<string>',
lead_status_id: 123,
lead_reference_source_id: 123,
assigned_user_id: 123,
country_id: 123,
marketing_attribution: ['<string>']
})
};
fetch('https://dev.flextell.ai/api/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://dev.flextell.ai/api/v1/leads/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'first_name' => '<string>',
'last_name' => '<string>',
'phone_number' => '<string>',
'email' => 'jsmith@example.com',
'description' => '<string>',
'message' => '<string>',
'preferred_contact' => '<string>',
'source_page_url' => '<string>',
'lead_status_id' => 123,
'lead_reference_source_id' => 123,
'assigned_user_id' => 123,
'country_id' => 123,
'marketing_attribution' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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://dev.flextell.ai/api/v1/leads/{id}"
payload := strings.NewReader("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"description\": \"<string>\",\n \"message\": \"<string>\",\n \"preferred_contact\": \"<string>\",\n \"source_page_url\": \"<string>\",\n \"lead_status_id\": 123,\n \"lead_reference_source_id\": 123,\n \"assigned_user_id\": 123,\n \"country_id\": 123,\n \"marketing_attribution\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
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.put("https://dev.flextell.ai/api/v1/leads/{id}")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"description\": \"<string>\",\n \"message\": \"<string>\",\n \"preferred_contact\": \"<string>\",\n \"source_page_url\": \"<string>\",\n \"lead_status_id\": 123,\n \"lead_reference_source_id\": 123,\n \"assigned_user_id\": 123,\n \"country_id\": 123,\n \"marketing_attribution\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.flextell.ai/api/v1/leads/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"description\": \"<string>\",\n \"message\": \"<string>\",\n \"preferred_contact\": \"<string>\",\n \"source_page_url\": \"<string>\",\n \"lead_status_id\": 123,\n \"lead_reference_source_id\": 123,\n \"assigned_user_id\": 123,\n \"country_id\": 123,\n \"marketing_attribution\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"first_name": "<string>",
"last_name": "<string>",
"full_name": "<string>",
"phone_number": "<string>",
"email": "<string>",
"description": "<string>",
"message": "<string>",
"preferred_contact": "<string>",
"source_page_url": "<string>",
"country_id": 123,
"is_converted": "<string>",
"converted_at": "2023-11-07T05:31:56Z",
"customer_id": 123,
"marketing_attribution": [
"<unknown>"
],
"external_id": "<string>",
"external_branch_id": "<string>",
"external_created_at": "2023-11-07T05:31:56Z",
"last_synced_at": "2023-11-07T05:31:56Z",
"import_source_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"status": {
"id": 123,
"name": "<string>",
"slug": "<string>",
"color": "<string>",
"is_terminal": true
},
"reference_source": {
"id": 123,
"name": "<string>",
"external_id": "<string>"
},
"assigned_user": {
"id": 123,
"name": "<string>"
},
"country_name": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error": "<string>",
"data": {
"message": "<string>"
},
"errors": null
}{
"message": "<string>",
"errors": {}
}