Update a lead
const url = 'https://app.whatsetter.com/api/v1/leads/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"assigned_to":"66a1f2c3d4e5f60718293a4b","next_action_at":"2026-09-22T09:00:00.000Z","next_action_label":"Call back","deal_status":"open"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://app.whatsetter.com/api/v1/leads/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "assigned_to": "66a1f2c3d4e5f60718293a4b", "next_action_at": "2026-09-22T09:00:00.000Z", "next_action_label": "Call back", "deal_status": "open" }'Update a lead from your CRM: status, tags, owner, next action
and outcome. Only the fields you send change; at least one is
required. Setting status to qualified stamps the qualification date
(once).
assigned_to: the id of a workspace member (GET /team/members), ornullto release the lead. Any other value answers422.next_action_at/next_action_label: the next human step.nullonnext_action_atclears both; a label needs a date.deal_status:open/won/lost. A lost deal needs alost_reasonfrom the dashboard’s list (price,timing,unqualified,competitor,unreachable,other); it is cleared when the deal is open or won.
Every owner / next-action / outcome change is written to the lead’s
journal, by the API key’s name, exactly like an edit from the
dashboard. Requires scope leads:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
A member id from GET /team/members, or null to unassign.
ISO 8601, or null to clear the next action.
Short label for the next action (needs next_action_at).
Required when deal_status is lost; ignored otherwise.
Example
{ "assigned_to": "66a1f2c3d4e5f60718293a4b", "next_action_at": "2026-09-22T09:00:00.000Z", "next_action_label": "Call back", "deal_status": "open"}Responses
Section titled “Responses”The updated lead
object
object
Digits with country code, no +
Where the lead came from. A platform value means the prospect reached WhatsApp through one of your tracked links (Dashboard → Liens) and the platform was read on the click (direct = through a link, no platform signature); list = campaign sender, api = POST /campaigns/{id}/leads, webhook = form or integration push, inbound = wrote first without a matching click, instagram with channel: instagram = Instagram automation. null on leads created before origins were recorded — derive from list_id, external_reference and channel for those.
How the origin was established: certain (a dedicated number, a Meta ad signal, or the click’s fingerprint in the first message), probable (the most recent click on this number’s links within 45 minutes), null when no click was involved.
Id of the tracked WhatsApp link that brought this lead, when one did.
The id you sent on POST /campaigns/{id}/leads. null for leads created from the dashboard (lists, CSV import, sales-page forms).
Where this conversation happens. Always set — leads that predate the channel column are reported as whatsapp.
Instagram handle, without the @. null on WhatsApp, where phone carries the identity. On Instagram phone is meaningless: id_lead holds an IGSID, not a number.
Id of the team member who owns the lead (GET /team/members); null = nobody, the AI handles it.
Where the person is commercially, derived exactly like the dashboard: booked when a meeting is on the calendar, else from the status (qualified, not_interested, stopped, cold, waiting), else conversation if they replied, else contacted.
The outcome, set by people (PATCH /leads/{id}); null when never set.
Example
{ "data": { "id": "68e0a1b2c3d4e5f6a7b8c9d0", "phone": "33612345678", "whatsapp_id": "33612345678@c.us", "name": "Marie Dupont", "status": "in_progress", "qualified": false, "qualified_at": null, "replied": true, "campaign_id": "auto24-maroc-4-bu76", "list_id": null, "source": "instagram", "source_confidence": "certain", "tracked_link_id": "68d9aa11bb22cc33dd44ee55", "external_reference": "4471", "channel": "whatsapp", "ig_username": null, "email": "marie@acme.fr", "tags": [ "hot" ], "messages_count": 7, "booking_status": null, "assigned_to": "66a1f2c3d4e5f60718293a4b", "stage": "conversation", "deal_status": "open", "lost_reason": null, "next_action_at": "2026-09-22T09:00:00.000Z", "next_action_label": "Call back", "first_contact_at": "2026-09-15T10:02:11.000Z", "last_message_at": "2026-09-18T16:40:03.000Z", "last_message_direction": "inbound", "created_at": "2026-09-15T10:02:11.000Z", "updated_at": "2026-09-19T08:12:45.000Z" }}Missing, unknown or revoked API key
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Resource not found in this workspace
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example" }}Invalid field, unknown member id, or nothing to update
object
object
Example
{ "error": { "code": "validation_error", "message": "\"assigned_to\" must be the id of a member of this workspace (see GET /team/members), or null." }}
