---
title: "Update an existing lead"
method: PUT
path: "/api/business/{businessId}/branch/{branchId}/leads/{leadId}"
tags: ["Lead"]
---

# Update an existing lead

`PUT /api/business/{businessId}/branch/{branchId}/leads/{leadId}`

## Request

- Base URL: `http://api-gateway-eu.phorest.com/third-party-api-server`
- URL: `http://api-gateway-eu.phorest.com/third-party-api-server/api/business/{businessId}/branch/{branchId}/leads/{leadId}`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/phorest/apis/third-party-api/docs/api/business/:businessId/branch/:branchId/leads/:leadId/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates an existing lead. Only the fields provided in the request body are changed.

## Path parameters

- `businessId` string, required
- `branchId` string, required
- `leadId` integer, required

## Request body

- LeadUpdateRequest
  - `mobile` string: Mobile phone number of the lead
  - `email` string: Email address of the lead
  - `firstName` string: First name of the lead
  - `lastName` string: Last name of the lead
  - `contactableByEmail` boolean: Whether the lead can be contacted by email
  - `contactableByMobile` boolean: Whether the lead can be contacted by mobile
  - `status` 'NEW_LEAD' | 'CONTACT_ATTEMPTED' | 'CONTACT_MADE' | 'INTERESTED' | 'APPOINTMENT_SCHEDULED' | 'CONVERTED' | 'LOST' | 'DELETED': Status to set on the lead
  - `smsMarketingOptOut` boolean: Whether the lead has opted out of SMS marketing
  - `emailMarketingOptOut` boolean: Whether the lead has opted out of email marketing
  - `clientId` string: ID of the client matched to this lead

## Response `200`

Lead updated successfully

- LeadResponse
  - `leadId` integer: Unique identifier for the lead
  - `businessId` string: Unique identifier for the business
  - `branchId` string: Unique identifier for the branch
  - `mobile` string: Mobile phone number of the lead
  - `email` string: Email address of the lead
  - `firstName` string: First name of the lead
  - `lastName` string: Last name of the lead
  - `contactableByEmail` boolean: Whether the lead can be contacted by email
  - `contactableByMobile` boolean: Whether the lead can be contacted by mobile
  - `status` 'NEW_LEAD' | 'CONTACT_ATTEMPTED' | 'CONTACT_MADE' | 'INTERESTED' | 'APPOINTMENT_SCHEDULED' | 'CONVERTED' | 'LOST' | 'DELETED': Current status of the lead
  - `source` string: Source where the lead originated from
  - `lastActivityDate` string, date-time: Date and time of the last activity on this lead
  - `smsMarketingOptOut` boolean: Whether the lead has opted out of SMS marketing
  - `emailMarketingOptOut` boolean: Whether the lead has opted out of email marketing
  - `clientId` string: Client ID if the lead has been converted to a client
  - `updatedBy` string: ID of the user who last updated the lead
  - `updateAction` 'MANUAL_UPDATE' | 'APPOINTMENT_CONVERTED' | 'APPOINTMENT_CANCELLED' | 'APPOINTMENT_CANCELLED_OR_DELETED' | 'APPOINTMENT_DELETED' | 'APPOINTMENT_BOOKED' | 'CLIENT_MATCHED_BY_MOBILE' | 'CLIENT_MATCHED_BY_EMAIL' | 'EXISTING_CLIENT' | 'MARKETING_CONSENT' | 'ONE_CLICK_UNSUBSCRIBE' | 'SUBMITTED_FORM': Action that triggered the last update to the lead
  - `adCampaignName` string: Name of the advertising campaign that generated this lead
  - `messageHistory` MessageHistory[]: History of messages sent to this lead
    - `type` string: Type of message sent
    - `sendDate` string, date-time: Date and time when the message was sent
    - `channel` string: Channel through which the message was sent
  - `note` string: Additional notes about the lead

## Other responses

- `400`: Lead data is invalid, unable to update the lead
- `404`: Business, branch or lead with the specified ids don't exist
- `429`: Request rate limit exceeded. Current limit set to 100 rps.
- `500`: Internal Server Error

---

[API](https://skmtc.dev/phorest/apis/third-party-api.md) - [All operations](https://skmtc.dev/phorest/apis/third-party-api/llms.txt) - [OpenAPI document](https://skmtc.dev/phorest/apis/third-party-api/revisions/beea6ef29634?raw)
