Leads
Switch lead's customer profile
Switches the customer profile of a lead
POST
/
leads
/
{leadId}
/
switchCustomerProfile
cURL
curl --request POST \
--url https://api.attent.app/v1/leads/{leadId}/switchCustomerProfile \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"profile": "<string>",
"sendMessage": true,
"messageDelayHours": 123,
"messageDelayMins": 123,
"clearMemory": true
}
'import requests
url = "https://api.attent.app/v1/leads/{leadId}/switchCustomerProfile"
payload = {
"profile": "<string>",
"sendMessage": True,
"messageDelayHours": 123,
"messageDelayMins": 123,
"clearMemory": True
}
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({
profile: '<string>',
sendMessage: true,
messageDelayHours: 123,
messageDelayMins: 123,
clearMemory: true
})
};
fetch('https://api.attent.app/v1/leads/{leadId}/switchCustomerProfile', 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.attent.app/v1/leads/{leadId}/switchCustomerProfile",
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([
'profile' => '<string>',
'sendMessage' => true,
'messageDelayHours' => 123,
'messageDelayMins' => 123,
'clearMemory' => true
]),
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.attent.app/v1/leads/{leadId}/switchCustomerProfile"
payload := strings.NewReader("{\n \"profile\": \"<string>\",\n \"sendMessage\": true,\n \"messageDelayHours\": 123,\n \"messageDelayMins\": 123,\n \"clearMemory\": true\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.attent.app/v1/leads/{leadId}/switchCustomerProfile")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"profile\": \"<string>\",\n \"sendMessage\": true,\n \"messageDelayHours\": 123,\n \"messageDelayMins\": 123,\n \"clearMemory\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attent.app/v1/leads/{leadId}/switchCustomerProfile")
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 \"profile\": \"<string>\",\n \"sendMessage\": true,\n \"messageDelayHours\": 123,\n \"messageDelayMins\": 123,\n \"clearMemory\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "Switched profile successfully.",
"sendMessage": true,
"messageDelayHours": 0,
"messageDelayMins": 30
}Authorizations
Path Parameters
The ID of the lead to switch the customer profile for.
Body
application/json
The new customer profile to switch the lead to.
The name of the new customer profile to switch the lead to.
Whether to send a message to the lead.
The number of hours to wait before sending the message. Takes precedence over messageDelayMins.
The number of minutes to wait before sending the message. Used as an alternative to messageDelayHours.
Whether to clear the AI's memory of the existing conversation with the lead. Defaults to false.
⌘I
cURL
curl --request POST \
--url https://api.attent.app/v1/leads/{leadId}/switchCustomerProfile \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"profile": "<string>",
"sendMessage": true,
"messageDelayHours": 123,
"messageDelayMins": 123,
"clearMemory": true
}
'import requests
url = "https://api.attent.app/v1/leads/{leadId}/switchCustomerProfile"
payload = {
"profile": "<string>",
"sendMessage": True,
"messageDelayHours": 123,
"messageDelayMins": 123,
"clearMemory": True
}
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({
profile: '<string>',
sendMessage: true,
messageDelayHours: 123,
messageDelayMins: 123,
clearMemory: true
})
};
fetch('https://api.attent.app/v1/leads/{leadId}/switchCustomerProfile', 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.attent.app/v1/leads/{leadId}/switchCustomerProfile",
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([
'profile' => '<string>',
'sendMessage' => true,
'messageDelayHours' => 123,
'messageDelayMins' => 123,
'clearMemory' => true
]),
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.attent.app/v1/leads/{leadId}/switchCustomerProfile"
payload := strings.NewReader("{\n \"profile\": \"<string>\",\n \"sendMessage\": true,\n \"messageDelayHours\": 123,\n \"messageDelayMins\": 123,\n \"clearMemory\": true\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.attent.app/v1/leads/{leadId}/switchCustomerProfile")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"profile\": \"<string>\",\n \"sendMessage\": true,\n \"messageDelayHours\": 123,\n \"messageDelayMins\": 123,\n \"clearMemory\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attent.app/v1/leads/{leadId}/switchCustomerProfile")
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 \"profile\": \"<string>\",\n \"sendMessage\": true,\n \"messageDelayHours\": 123,\n \"messageDelayMins\": 123,\n \"clearMemory\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "Switched profile successfully.",
"sendMessage": true,
"messageDelayHours": 0,
"messageDelayMins": 30
}
