Skip to main content
POST
cURL

Notes

Unsubscribes a lead from one or more channels. Pass a channels array (sms, voice, email) in the request body to target specific channels. When channels is omitted, Apten unsubscribes every channel the lead can actually receive: SMS and voice if the lead has a phone number, email if the lead has an email address. The 200 response channels array is the set that was applied, not the set that was requested. A lead with a phone number and no email who sends {} is unsubscribed from SMS and voice, and the response is ["sms", "voice"]. SMS and voice opt-outs may be coupled according to your organization’s settings. When those channels are coupled, requesting either one unsubscribes both. If every requested channel is missing on the lead, the request fails with a 400. An explicit {"channels":["email"]} on a lead with no email returns Lead has no email. An explicit request that includes at least one reachable channel still succeeds for those channels. Repeated requests converge on the same subscription state. Channels that are already unsubscribed remain unchanged, and no duplicate opt-out webhook is emitted for those channels. Choose the right control:
  • Pause the AI: Use Turn off a lead. This pauses Apten for the lead but does not change their subscription status.
  • Opt out of contact: Use this endpoint. It changes the lead’s subscription status for the selected channels.
  • Never contact this number: Use the Do Not Contact API. This adds the phone number to your organization’s DNC list.
Side effects:
  • Emits an opt-out webhook event for each channel that transitions to unsubscribed.
  • Does not change whether Apten is on for the lead.
  • Does not add the lead’s phone number to the DNC list.
To undo an SMS opt-out, the lead can text START, or you can use Resubscribe a lead for the applicable channels. Carrier-level SMS blocks can only be cleared by texting START.

Authorizations

x-api-key
string
header
required

Path Parameters

leadId
string
required

The ID of the lead to unsubscribe.

Body

application/json

Channels to unsubscribe. Optional; when omitted, defaults to every channel the lead can receive.

channels
enum<string>[]

The channels to unsubscribe the lead from. When omitted, Apten unsubscribes every channel the lead can receive (phone → sms and voice, email → email).

Minimum array length: 1
Available options:
sms,
voice,
email

Response

Lead unsubscribed successfully.

message
string

Returns "Lead unsubscribed successfully." if the lead was unsubscribed.

channels
enum<string>[]

The channels that were applied. Channels the lead cannot receive (no phone or no email) are omitted.

Available options:
sms,
voice,
email