Skip to main content
PATCH
/
leads
/
{leadId}
cURL
curl --request PATCH \
  --url https://api.attent.app/v1/leads/{leadId} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "email": "newemail@example.com",
  "timeZone": "America/Los_Angeles",
  "additionalInfo": {
    "newField": "newValue",
    "existingField": "updatedValue",
    "fieldToRemove": null
  },
  "followUpConfig": {
    "1": {
      "hours": 24,
      "channel": "text",
      "strategyIds": "auto"
    },
    "2": {
      "hours": 72,
      "channel": "email"
    },
    "3": {
      "hours": 168,
      "channel": "call",
      "voicemailEnabled": true,
      "strategyIds": [
        "550e8400-e29b-41d4-a716-446655440000",
        "7c9e6679-7425-40de-944b-e07fc1f90ae7"
      ]
    }
  },
  "followUpStep": 1,
  "useStrategiesForFollowUps": true
}
'
import requests

url = "https://api.attent.app/v1/leads/{leadId}"

payload = {
"email": "newemail@example.com",
"timeZone": "America/Los_Angeles",
"additionalInfo": {
"newField": "newValue",
"existingField": "updatedValue",
"fieldToRemove": None
},
"followUpConfig": {
"1": {
"hours": 24,
"channel": "text",
"strategyIds": "auto"
},
"2": {
"hours": 72,
"channel": "email"
},
"3": {
"hours": 168,
"channel": "call",
"voicemailEnabled": True,
"strategyIds": ["550e8400-e29b-41d4-a716-446655440000", "7c9e6679-7425-40de-944b-e07fc1f90ae7"]
}
},
"followUpStep": 1,
"useStrategiesForFollowUps": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'newemail@example.com',
timeZone: 'America/Los_Angeles',
additionalInfo: {newField: 'newValue', existingField: 'updatedValue', fieldToRemove: null},
followUpConfig: {
'1': {hours: 24, channel: 'text', strategyIds: 'auto'},
'2': {hours: 72, channel: 'email'},
'3': {
hours: 168,
channel: 'call',
voicemailEnabled: true,
strategyIds: ['550e8400-e29b-41d4-a716-446655440000', '7c9e6679-7425-40de-944b-e07fc1f90ae7']
}
},
followUpStep: 1,
useStrategiesForFollowUps: true
})
};

fetch('https://api.attent.app/v1/leads/{leadId}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'newemail@example.com',
'timeZone' => 'America/Los_Angeles',
'additionalInfo' => [
'newField' => 'newValue',
'existingField' => 'updatedValue',
'fieldToRemove' => null
],
'followUpConfig' => [
'1' => [
'hours' => 24,
'channel' => 'text',
'strategyIds' => 'auto'
],
'2' => [
'hours' => 72,
'channel' => 'email'
],
'3' => [
'hours' => 168,
'channel' => 'call',
'voicemailEnabled' => true,
'strategyIds' => [
'550e8400-e29b-41d4-a716-446655440000',
'7c9e6679-7425-40de-944b-e07fc1f90ae7'
]
]
],
'followUpStep' => 1,
'useStrategiesForFollowUps' => 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}"

payload := strings.NewReader("{\n \"email\": \"newemail@example.com\",\n \"timeZone\": \"America/Los_Angeles\",\n \"additionalInfo\": {\n \"newField\": \"newValue\",\n \"existingField\": \"updatedValue\",\n \"fieldToRemove\": null\n },\n \"followUpConfig\": {\n \"1\": {\n \"hours\": 24,\n \"channel\": \"text\",\n \"strategyIds\": \"auto\"\n },\n \"2\": {\n \"hours\": 72,\n \"channel\": \"email\"\n },\n \"3\": {\n \"hours\": 168,\n \"channel\": \"call\",\n \"voicemailEnabled\": true,\n \"strategyIds\": [\n \"550e8400-e29b-41d4-a716-446655440000\",\n \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n ]\n }\n },\n \"followUpStep\": 1,\n \"useStrategiesForFollowUps\": true\n}")

req, _ := http.NewRequest("PATCH", 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.patch("https://api.attent.app/v1/leads/{leadId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"newemail@example.com\",\n \"timeZone\": \"America/Los_Angeles\",\n \"additionalInfo\": {\n \"newField\": \"newValue\",\n \"existingField\": \"updatedValue\",\n \"fieldToRemove\": null\n },\n \"followUpConfig\": {\n \"1\": {\n \"hours\": 24,\n \"channel\": \"text\",\n \"strategyIds\": \"auto\"\n },\n \"2\": {\n \"hours\": 72,\n \"channel\": \"email\"\n },\n \"3\": {\n \"hours\": 168,\n \"channel\": \"call\",\n \"voicemailEnabled\": true,\n \"strategyIds\": [\n \"550e8400-e29b-41d4-a716-446655440000\",\n \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n ]\n }\n },\n \"followUpStep\": 1,\n \"useStrategiesForFollowUps\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.attent.app/v1/leads/{leadId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"newemail@example.com\",\n \"timeZone\": \"America/Los_Angeles\",\n \"additionalInfo\": {\n \"newField\": \"newValue\",\n \"existingField\": \"updatedValue\",\n \"fieldToRemove\": null\n },\n \"followUpConfig\": {\n \"1\": {\n \"hours\": 24,\n \"channel\": \"text\",\n \"strategyIds\": \"auto\"\n },\n \"2\": {\n \"hours\": 72,\n \"channel\": \"email\"\n },\n \"3\": {\n \"hours\": 168,\n \"channel\": \"call\",\n \"voicemailEnabled\": true,\n \"strategyIds\": [\n \"550e8400-e29b-41d4-a716-446655440000\",\n \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n ]\n }\n },\n \"followUpStep\": 1,\n \"useStrategiesForFollowUps\": true\n}"

response = http.request(request)
puts response.read_body
{
  "message": "Lead updated successfully."
}
{
"message": "Invalid format for field: email must be a valid email address"
}
{
"message": "Forbidden"
}
{
"message": "Resource not found: Lead"
}
{
"message": "Internal Server Error"
}

Usage Notes

Updating additionalInfo

The additionalInfo field uses merge/upsert behavior:
  • New keys are added to the existing additionalInfo
  • Existing keys are updated with new values
  • To delete a key, set its value to null
{
  "additionalInfo": {
    "newKey": "newValue", // Adds new key
    "existingKey": "updated", // Updates existing key
    "oldKey": null // Removes this key
  }
}

Follow-up Configuration

The followUpConfig defines the follow-up schedule. Each step must include both hours and channel:
{
  "useStrategiesForFollowUps": true,
  "followUpConfig": {
    "1": { "hours": 24, "channel": "text", "strategyIds": "auto" },
    "2": { "hours": 72, "channel": "email" },
    "3": { "hours": 168, "channel": "call", "voicemailEnabled": true, "strategyIds": ["550e8400-e29b-41d4-a716-446655440000", "7c9e6679-7425-40de-944b-e07fc1f90ae7"] }
  }
}
Allowed channels: text, call, email Optional properties:
  • voicemailEnabled (boolean): Only valid for call channel. If true, leaves a voicemail when call is not answered.
  • strategyIds (string or string array): Strategy IDs to use for this follow-up step. Use "auto" for automatic selection, or provide an array of specific strategy IDs. Requires useStrategiesForFollowUps to be set to true on the lead.
Channel requirements: - text: Always available (SMS) - call: Requires voice to be enabled on the customer profile - email: Requires email to be enabled on both the customer profile and organization
To stop all follow-ups for a lead, set followUpConfig to an empty object {} . This will cancel any scheduled follow-ups and set the lead to STOPPED state.

Follow-up Scheduling Behavior

When updating followUpStep and/or followUpConfig, the timer always resets to now + hours:
  1. Update followUpStep only: Schedules that specific step
  2. Update followUpConfig only: Reschedules with new timing, preserving the current step
  3. Update both: Full reset with the new config starting at the specified step

Special followUpStep Values

  • Positive integers (1, 2, 3, …): Schedule that specific follow-up step
  • -1 (STOPPED): Stops all follow-ups for this lead
  • -2 (LONG_TERM): Moves lead to long-term nurture mode

Authorizations

x-api-key
string
header
required

Path Parameters

leadId
string
required

The ID of the lead to update

Body

application/json

Fields to update on the lead. All fields are optional.

email
string

The email address of the lead. Must be a valid email format.

timeZone
string

The timezone of the lead in tz database format (e.g. America/New_York).

additionalInfo
object | null

Key-value object to merge with existing additionalInfo. Set a value to null to remove that key.

followUpConfig
object

Follow-up schedule configuration. Keys are step numbers (1, 2, 3, etc.), values are objects with hours and channel.

followUpStep
integer

The follow-up step to schedule. Use positive integers (1, 2, 3, ...) for specific steps, -1 for STOPPED, or -2 for LONG_TERM.

useStrategiesForFollowUps
boolean

Enable strategy-based follow-ups for this lead. Must be true for strategyIds in followUpConfig steps to take effect.

Response

Lead updated successfully.

message
string

Returns "Lead updated successfully." when the update completes.