curl --request PUT \
--url https://app.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>",
"expected_value": 1,
"treatment_ids": [
123
],
"currency_id": 123,
"exchange_rate": 1,
"preferred_contact": "<string>",
"source_page_url": "<string>",
"pipeline_stage_id": 123,
"lead_reference_source_id": 123,
"assigned_user_id": 123,
"country_id": 123,
"lost_reason": "<string>",
"marketing_attribution": [
"<string>"
]
}
'import requests
url = "https://app.flextell.ai/api/v1/leads/{id}"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"description": "<string>",
"message": "<string>",
"expected_value": 1,
"treatment_ids": [123],
"currency_id": 123,
"exchange_rate": 1,
"preferred_contact": "<string>",
"source_page_url": "<string>",
"pipeline_stage_id": 123,
"lead_reference_source_id": 123,
"assigned_user_id": 123,
"country_id": 123,
"lost_reason": "<string>",
"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>',
expected_value: 1,
treatment_ids: [123],
currency_id: 123,
exchange_rate: 1,
preferred_contact: '<string>',
source_page_url: '<string>',
pipeline_stage_id: 123,
lead_reference_source_id: 123,
assigned_user_id: 123,
country_id: 123,
lost_reason: '<string>',
marketing_attribution: ['<string>']
})
};
fetch('https://app.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://app.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>',
'expected_value' => 1,
'treatment_ids' => [
123
],
'currency_id' => 123,
'exchange_rate' => 1,
'preferred_contact' => '<string>',
'source_page_url' => '<string>',
'pipeline_stage_id' => 123,
'lead_reference_source_id' => 123,
'assigned_user_id' => 123,
'country_id' => 123,
'lost_reason' => '<string>',
'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://app.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 \"expected_value\": 1,\n \"treatment_ids\": [\n 123\n ],\n \"currency_id\": 123,\n \"exchange_rate\": 1,\n \"preferred_contact\": \"<string>\",\n \"source_page_url\": \"<string>\",\n \"pipeline_stage_id\": 123,\n \"lead_reference_source_id\": 123,\n \"assigned_user_id\": 123,\n \"country_id\": 123,\n \"lost_reason\": \"<string>\",\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://app.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 \"expected_value\": 1,\n \"treatment_ids\": [\n 123\n ],\n \"currency_id\": 123,\n \"exchange_rate\": 1,\n \"preferred_contact\": \"<string>\",\n \"source_page_url\": \"<string>\",\n \"pipeline_stage_id\": 123,\n \"lead_reference_source_id\": 123,\n \"assigned_user_id\": 123,\n \"country_id\": 123,\n \"lost_reason\": \"<string>\",\n \"marketing_attribution\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.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 \"expected_value\": 1,\n \"treatment_ids\": [\n 123\n ],\n \"currency_id\": 123,\n \"exchange_rate\": 1,\n \"preferred_contact\": \"<string>\",\n \"source_page_url\": \"<string>\",\n \"pipeline_stage_id\": 123,\n \"lead_reference_source_id\": 123,\n \"assigned_user_id\": 123,\n \"country_id\": 123,\n \"lost_reason\": \"<string>\",\n \"marketing_attribution\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"record_state": {
"is_read_only": true,
"reason_code": "<string>"
},
"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>",
"avatar_url": "<string>",
"latest_conversation_id": 123,
"expected_value": "<string>",
"currency_id": 123,
"exchange_rate": "<string>",
"country_id": 123,
"is_converted": "<string>",
"converted_at": "2023-11-07T05:31:56Z",
"won_at": "2023-11-07T05:31:56Z",
"lost_reason": "<string>",
"lost_at": "2023-11-07T05:31:56Z",
"lost_by_user_id": 123,
"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",
"stage": {
"id": 123,
"name": "<string>",
"color": "<string>",
"is_won": true,
"is_lost": true
},
"reference_source": {
"id": 123,
"name": "<string>",
"external_id": "<string>"
},
"treatments": [
"<string>"
],
"assigned_user": {
"id": 123,
"name": "<string>",
"avatar_url": "<string>"
},
"country_name": "<string>",
"notification_channels": {
"default_channel_id": "<string>",
"source": "<string>",
"channels": [
"<unknown>"
]
},
"import_source": {
"id": 123,
"name": "<string>",
"company_logo": null
},
"integration_source": {
"connection_id": 123,
"connection_name": "<string>",
"integration": {
"id": 123,
"name": "<string>",
"system_name": "<string>",
"company_logo": null
},
"external_id": "<string>"
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"success": false,
"error_code": "CUSTOMER_ERASED",
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}Update a lead
curl --request PUT \
--url https://app.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>",
"expected_value": 1,
"treatment_ids": [
123
],
"currency_id": 123,
"exchange_rate": 1,
"preferred_contact": "<string>",
"source_page_url": "<string>",
"pipeline_stage_id": 123,
"lead_reference_source_id": 123,
"assigned_user_id": 123,
"country_id": 123,
"lost_reason": "<string>",
"marketing_attribution": [
"<string>"
]
}
'import requests
url = "https://app.flextell.ai/api/v1/leads/{id}"
payload = {
"first_name": "<string>",
"last_name": "<string>",
"phone_number": "<string>",
"email": "jsmith@example.com",
"description": "<string>",
"message": "<string>",
"expected_value": 1,
"treatment_ids": [123],
"currency_id": 123,
"exchange_rate": 1,
"preferred_contact": "<string>",
"source_page_url": "<string>",
"pipeline_stage_id": 123,
"lead_reference_source_id": 123,
"assigned_user_id": 123,
"country_id": 123,
"lost_reason": "<string>",
"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>',
expected_value: 1,
treatment_ids: [123],
currency_id: 123,
exchange_rate: 1,
preferred_contact: '<string>',
source_page_url: '<string>',
pipeline_stage_id: 123,
lead_reference_source_id: 123,
assigned_user_id: 123,
country_id: 123,
lost_reason: '<string>',
marketing_attribution: ['<string>']
})
};
fetch('https://app.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://app.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>',
'expected_value' => 1,
'treatment_ids' => [
123
],
'currency_id' => 123,
'exchange_rate' => 1,
'preferred_contact' => '<string>',
'source_page_url' => '<string>',
'pipeline_stage_id' => 123,
'lead_reference_source_id' => 123,
'assigned_user_id' => 123,
'country_id' => 123,
'lost_reason' => '<string>',
'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://app.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 \"expected_value\": 1,\n \"treatment_ids\": [\n 123\n ],\n \"currency_id\": 123,\n \"exchange_rate\": 1,\n \"preferred_contact\": \"<string>\",\n \"source_page_url\": \"<string>\",\n \"pipeline_stage_id\": 123,\n \"lead_reference_source_id\": 123,\n \"assigned_user_id\": 123,\n \"country_id\": 123,\n \"lost_reason\": \"<string>\",\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://app.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 \"expected_value\": 1,\n \"treatment_ids\": [\n 123\n ],\n \"currency_id\": 123,\n \"exchange_rate\": 1,\n \"preferred_contact\": \"<string>\",\n \"source_page_url\": \"<string>\",\n \"pipeline_stage_id\": 123,\n \"lead_reference_source_id\": 123,\n \"assigned_user_id\": 123,\n \"country_id\": 123,\n \"lost_reason\": \"<string>\",\n \"marketing_attribution\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.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 \"expected_value\": 1,\n \"treatment_ids\": [\n 123\n ],\n \"currency_id\": 123,\n \"exchange_rate\": 1,\n \"preferred_contact\": \"<string>\",\n \"source_page_url\": \"<string>\",\n \"pipeline_stage_id\": 123,\n \"lead_reference_source_id\": 123,\n \"assigned_user_id\": 123,\n \"country_id\": 123,\n \"lost_reason\": \"<string>\",\n \"marketing_attribution\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"record_state": {
"is_read_only": true,
"reason_code": "<string>"
},
"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>",
"avatar_url": "<string>",
"latest_conversation_id": 123,
"expected_value": "<string>",
"currency_id": 123,
"exchange_rate": "<string>",
"country_id": 123,
"is_converted": "<string>",
"converted_at": "2023-11-07T05:31:56Z",
"won_at": "2023-11-07T05:31:56Z",
"lost_reason": "<string>",
"lost_at": "2023-11-07T05:31:56Z",
"lost_by_user_id": 123,
"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",
"stage": {
"id": 123,
"name": "<string>",
"color": "<string>",
"is_won": true,
"is_lost": true
},
"reference_source": {
"id": 123,
"name": "<string>",
"external_id": "<string>"
},
"treatments": [
"<string>"
],
"assigned_user": {
"id": 123,
"name": "<string>",
"avatar_url": "<string>"
},
"country_name": "<string>",
"notification_channels": {
"default_channel_id": "<string>",
"source": "<string>",
"channels": [
"<unknown>"
]
},
"import_source": {
"id": 123,
"name": "<string>",
"company_logo": null
},
"integration_source": {
"connection_id": 123,
"connection_name": "<string>",
"integration": {
"id": 123,
"name": "<string>",
"system_name": "<string>",
"company_logo": null
},
"external_id": "<string>"
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"success": false,
"error_code": "CUSTOMER_ERASED",
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}Yetkilendirmeler
The access token received from the authorization server in the OAuth 2.0 flow.
Başlıklar
Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.
Yol Parametreleri
The lead identifier
Gövde
The first name.
255The last name.
255The phone number in E.164 format.
50The email address.
255The description.
The message body.
The expected deal value.
x >= 0The active treatment identifiers selected for the lead. An empty array clears the relationship.
An active treatment identifier belonging to the tenant.
The currency ID for the expected value.
The exchange rate of the lead currency against the tenant base currency (1 for the base currency).
x >= 0Preferred contact channel.
50URL of the page that produced the lead.
2048The pipeline stage ID.
The lead reference source ID.
The assigned user ID. Reassignment (including clearing it) requires Assign:Lead.
The country ID.
The reason the lead was lost. Required when moving into a lost stage that mandates a reason.
The marketing attribution.