Skip to Content
CallMitraDocs
API referenceLeads

Update a lead

Changes only the fields you send. Send `If-Match` with the lead's `updatedAt` to refuse the write (`lead_changed`) when someone changed the lead after you read it. A new `phone` is stored in E.164 form like on create. Campaign IDs you cannot access are skipped.

PUT
/api/v1/leads/{lead_id}

Changes only the fields you send. Send If-Match with the lead's updatedAt to refuse the write (lead_changed) when someone changed the lead after you read it. A new phone is stored in E.164 form like on create. Campaign IDs you cannot access are skipped.

Authorization

headerX-API-Key<token>

Create in the console: Settings → API & webhooks.

Path Parameters

lead_id*Lead Id

Lead ID.

Header Parameters

If-Match?string|null

Request Body

application/json
  1. body

Send only the fields to change.

assignedToUserId?|

A team member's user ID, or null to unassign.

attributes?|

Profile facts to set; a null value clears that fact. Other facts stay.

campaignIds?array<unknown>|

Replaces the lead's campaigns: campaigns missing from the list are removed.

company?|

Company name.

dismissIssues?array<unknown>|

Attribute keys whose kept-aside values (attributeIssues) should be dropped.

email?|

Email address.

externalId?||

Your business id for this person.

leadSourceId?|

ID of a lead source, or empty to clear.

name?|

Full name.

notes?|

Deprecated: adds one note (never replaces notes). Use POST /leads/{leadId}/notes.

phone?|

Phone number, saved in E.164 form: +919876543210, 9876543210 and 098765 43210 all save as +919876543210 (a number without a country code is taken as Indian). A value that is not a phone number returns 422 invalid_phone_number.

source?|

Free-text source label.

status?|

Pipeline status key.

tags?array<unknown>|

Replaces the lead's tags.

timezone?|

IANA time zone such as Asia/Kolkata for dial windows.

title?|

Job title.

[key: string]?any

Response Body

OK

application/json
  1. response

The lead after the change.

lead*

The lead.

success?Success

Always true on a 2xx response.

Defaulttrue
warnings?array<>|

Values saved differently than sent (for example an unknown status).

[key: string]?any
Example Request
curl -X PUT 'https://api.callmitra.ai/api/v1/leads/string' \  -H 'Content-Type: application/json' \  -d '{  "attributes": {    "city": "Mumbai"  },  "status": "qualified",  "tags": [    "vip"  ]}'
Example Response
{  "lead": {    "assignedToUserId": "string",    "assigneeName": "string",    "attributeIssues": {},    "attributes": {},    "callAttempts": 0,    "callStatus": "string",    "campaignCallStatus": {},    "campaignIds": [      "string"    ],    "campaignNames": [      "string"    ],    "company": "string",    "createdAt": "string",    "dncOptOut": true,    "dncReason": "string",    "dncUpdatedAt": "string",    "email": "string",    "externalId": "string",    "id": "string",    "lastCallAttempt": "string",    "lastContactDate": "string",    "leadSourceId": "string",    "merchantOutcome": "string",    "name": "string",    "nextCallScheduled": "string",    "notes": "string",    "notesCount": 0,    "phone": "string",    "pinnedNotePreview": "string",    "source": "string",    "status": "string",    "tags": [      "string"    ],    "title": "string",    "updatedAt": "string"  },  "success": true,  "warnings": [    {      "key": "string",      "label": "string",      "reason": "string",      "value": null    }  ]}