Documentation
Update Lead API: Modify Details, Tags, and Contact Info
Last updated on May 7, 2026
Update Lead Details and Tags
PUT /leads/:contact-number/update API Documentation
Purpose
Update an existing lead’s details, tags, or contact information using their contact number. This endpoint allows for partial updates, including adding/removing tags, updating lead data, and changing the contact number or country code.
Authentication
Required:
- Bearer Token in the
Authorizationheader
Header Format Examples:
Authorization: Bearer <access_token>;
Error States:
- 401 Unauthorized: Missing, expired, or invalid token.
Error Response Example:
{
"status": 401,
"message": "UnAuthorized Access-Token!",
"success": false
}
Note: Only one of the headers is required. If both are present, Authorization is preferred.
Request Specifications
Headers:
| Header | Required | Example Value | Description |
|---|---|---|---|
| Authorization | Yes | Bearer eyJhbGci... | Bearer token for authentication |
| Content-Type | Yes | application/json | Request body media type |
| Accept | No | application/json | Expected response media type |
Supported Media Types:
- application/json (request and response)
Path Parameters:
| Name | Type | Constraints | Required | Description |
|---|---|---|---|---|
| contact-number | number | Integer, required | Yes | Lead’s contact number |
Request Body
Schema Definition:
{
"add_tags": [1, 2],
"remove_tags": [3],
"lead_data": { "name": "John Doe", "email": "john@example.com" },
"new_contact_number": 9876543210,
"new_country_code": 91
}
Validation Rules:
| Field | Type | Constraints / Rules | Required | Notes |
|---|---|---|---|---|
| add_tags | number[] | Each must be a number | No | Tags to add |
| remove_tags | number[] | Each must be a number | No | Tags to remove |
| lead_data | object | Any key-value pairs | No | Lead fields to update |
| new_contact_number | number | Required if lead_data is not present | No | New contact number for the lead |
| new_country_code | number | Required if new_contact_number is present | No | New country code for the lead |
Example Request Body:
{
"add_tags": [101, 102],
"remove_tags": [103],
"lead_data": {
"name": "Jane Smith",
"email": "jane.smith@example.com",
"dob": "1990-01-01"
},
"new_contact_number": 9988776655,
"new_country_code": 91
}
Response Handling
Success Response:
- Status: 201 Created
{
"status": 201,
"message": "Successfully updated lead.",
"success": true
}
| Field | Type | Description |
|---|---|---|
| status | number | HTTP status code (201) |
| message | string | Success message |
| success | boolean | Operation status |
Error Responses:
| HTTP Status | Error Code / Message | Description / Troubleshooting |
|---|---|---|
| 401 | "UnAuthorized Access-Token!" | Invalid/missing token. Check credentials. |
| 404 | "Invalid contact number!" | Lead not found. Verify contact-number. |
| 400 | Validation error messages | Invalid request body. Check field types. |
Advanced Details
- Idempotency: Multiple identical update requests will result in the same lead state.
- Partial Updates: Only provided fields are updated; others remain unchanged.
- Tag Operations: add_tags and remove_tags can be used independently or together.