Update a lead
update_leadUpdate a lead
Changes the fields you send. status must be the value of one of the agent's statuses,
and a move the agent's status flow doesn't allow may be refused (422 invalid_request).
A status change is recorded on the contact's timeline when the lead has a contact. Unlike
a person's edit in the dashboard, an edit through the API never assigns an unassigned
lead to anyone; assignLead does. pinned pins or unpins the lead for everyone on the
agent; sending the state the lead is already in changes nothing, so a pinned lead keeps
its place.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| phone | No | A valid number in E.164 (`+201001234567`), or an empty string to clear it. | |
| pinned | No | `true` pins the lead for everyone on the agent, `false` unpins it. Sending the state the lead is already in changes nothing: a pinned lead keeps its place. | |
| status | No | The `value` of one of the agent's lead statuses as `listLeadFields` returns it; matched without regard to case and stored in that form. | |
| lead_id | Yes | A lead of the agent. Another agent's lead is `404 not_found`. | |
| summary | No | ||
| agent_id | Yes | The agent the resource belongs to. Another company's agent, or the nil UUID, is `404 agent_not_found`; an agent outside the key's agent list is `403 agent_not_authorized`. | |
| custom_fields | No | Free-form fields keyed by name, stored as sent (see Partial updates in the API description for how date-time strings and decimals are normalized). For a lead, use the keys of the agent's own lead fields (`listLeadFields`, `built_in: false`), and the whole object is limited to about 10,000 characters of JSON (`422 invalid_request` beyond). Mojeeb doesn't check keys or values against the fields' `type`, `options` or `required`. On update the object merges key by key, and a key sent as `null` stays with the value `null`. |