---
title: "Update Leads"
method: PATCH
path: "/leads"
tags: ["Leads"]
---

# Update Leads

`PATCH /leads`

Perform the specified operations on the specified leads.

## Request body

- object
  - `id` string, required — Lead ID
  - `operation` union, required
    - MakeActiveInGroupOperation
      - `type` 'makeActiveInGroup', required — This operation will make the lead active in the group and add the lead to a specified group if they are not already a part of it. This is a permanent addition since these leads have message history and other auditing requirements that make them impossible to permanently delete. The only way to stop texting a lead in a group is to make them inactive using the MakeInactiveInGroup operation.
      - `groupId` string, required — The ID of the group to reactivate the lead in or add the lead to.
    - MakeInactiveInGroupOperation
      - `type` 'makeInactiveInGroup', required — This operation will make the lead inactive in the specified group. Because deleting a lead from a group is not allowed since the lead has message history, the only way to stop a lead from receiving messages meant for a group is to make them inactive.
      - `groupId` string, required — The ID of the group to make the lead inactive in.
    - AttachLeadToIntegrationOperation
      - `type` 'attachLeadToIntegration', required — This operation will attach a lead in Hustle to a lead (or similar object) in an integration.
      - `integrationId` string, required — The ID of the integration to attach the lead to.
      - `external` union, required
        - VanExternalLeadSchema
          - `integrationType` 'van', required
          - `externalObject` object, required
            - `version` 'v4', required
            - `vanId` string, required
            - `vanPhoneId` number
        - VanMyVotersExternalLeadSchema
          - `integrationType` 'van-myvoters', required
          - `externalObject` object, required
            - `version` 'v4', required
            - `vanId` string, required
            - `vanPhoneId` number
        - EvertrueExternalLeadSchema
          - `integrationType` 'evertrue', required
          - `externalObject` object, required
            - `version` '1.0', required
            - `remoteId` string, required
        - SalesforceExternalLeadSchema
          - `integrationType` 'salesforce', required
          - `externalObject` object, required
            - `version` '41.0', required
            - `salesforceObjectType` string, required
            - `salesforceObjectId` string, required
        - BbLuminateExternalLeadSchema
          - `integrationType` 'bbluminate', required
          - `externalObject` object, required
            - `version` '1.0', required
            - `constituentId` string, required
    - ApplyTagOperation
      - `type` 'applyTag', required — This operation will attach a tag in an organization to a lead in that same organization.
      - `tagId` string, required — The ID of the tag to apply to the lead.
    - RemoveTagOperation
      - `type` 'removeTag', required — This operation will remove a tag form a lead.
      - `tagId` string, required — The ID of the tag to remove from the lead.
    - SetCustomFieldOperation
      - `type` 'setCustomField', required — This operation will set the value of a custom field on a lead.
      - `customFieldName` string, required — The label of the custom field to set. This must exist as a custom field in the organization.
      - `value` string, required — The value to set the custom field to.
    - OptOutOperation
      - `type` 'optOut', required — This operation will opt a lead out of receiving messages from Hustle. If account sync is enabled, all other leads in the account with the same number will also be opted out.
      - `tagId` string — The ID of the tag to apply to the lead when opting them out. This must be an OptOut tag.
    - OptInOperation
      - `type` 'optIn', required — This operation will opt a lead back in to receiving messages from Hustle. If account sync is enabled, all other leads in the account with the same number will also be opted in.

## Response `204`

Returned on a successful operation. Check results with the associated GET endpoints.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `422` — Unprocessable Entity
- `500` — Internal Server Error

---

[API](https://skmtc.net/hustle/apis/hustle-public-api.md) · [All operations](https://skmtc.net/hustle/apis/hustle-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hustle/hustle-public-api/revisions/e920ac8ed225/schema)
