Create Opt-Out Subscription
Subscribe to real-time notifications when a contact opts out of data processing. When a contact requests removal, Lusha sends an OptOutWebhookPayload to your endpoint so you can action the removal in your own systems (CRM, outreach tools, etc.).
Endpoint: (POST) https://api.lusha.com/api/subscriptions/opt-out
How it works:
- Create one opt-out subscription per account (scoped to
contactentity type) - Lusha delivers a POST request to your URL whenever a contact opts out
- The payload includes the contact identity, opt-out date, and the specific data points (emails and/or phones) that must be removed
Payload you’ll receive:
{
"contactId": "987654321",
"fullName": "Jane Doe",
"companyName": "Acme Corp",
"jobTitle": "Director of Product",
"linkedinUrl": "https://www.linkedin.com/in/jane-doe",
"contactOptOutDate": "2026-04-22 14:32:11.412",
"contactExposureDate": "2025-08-03 09:15:47",
"datapoints": [
{ "datapointId": "+14155550199", "datapointType": "phone" },
{ "datapointId": "jane.doe@acme.com", "datapointType": "email" }
],
"partnerClientId": "acme-crm-tenant-42"
}
Important: Signature verification applies the same way as standard webhook deliveries. See Security & Verification for details.
Note: Ensure your account has a webhook secret before creating this subscription. See Regenerate Account Secret.
curl --request POST \
--url https://api.lusha.com/api/subscriptions/opt-out \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"entityType": "contact",
"url": "https://example.com/webhook",
"name": "Account opt-out webhook"
}
'import requests
url = "https://api.lusha.com/api/subscriptions/opt-out"
payload = {
"entityType": "contact",
"url": "https://example.com/webhook",
"name": "Account opt-out webhook"
}
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entityType: 'contact',
url: 'https://example.com/webhook',
name: 'Account opt-out webhook'
})
};
fetch('https://api.lusha.com/api/subscriptions/opt-out', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.lusha.com/api/subscriptions/opt-out")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"entityType\": \"contact\",\n \"url\": \"https://example.com/webhook\",\n \"name\": \"Account opt-out webhook\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lusha.com/api/subscriptions/opt-out"
payload := strings.NewReader("{\n \"entityType\": \"contact\",\n \"url\": \"https://example.com/webhook\",\n \"name\": \"Account opt-out webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "6a0ca910b402df368d2aff07",
"entityType": "contact",
"entityId": "431705",
"signalTypes": [
"optOut"
],
"url": "https://example.com/webhook",
"isActive": true,
"createdAt": "2026-05-19T18:16:48.360Z",
"updatedAt": "2026-05-19T18:16:48.360Z",
"name": "Account opt-out webhook"
}{
"statusCode": 400,
"message": "Invalid request parameters"
}{
"statusCode": 401,
"message": "Invalid API key"
}{
"statusCode": 403,
"message": "An opt-out subscription already exists for this account"
}{
"statusCode": 500,
"message": "Internal server error. Please try again later."
}Authorizations
Your Lusha API key. You can find this in your Lusha dashboard under API settings.
Include this key in the api_key header for all requests.
Body
Request body for creating an opt-out webhook subscription
Entity type for opt-out subscriptions. Currently only contact is supported.
contact "contact"
Your webhook endpoint URL (HTTPS required in production)
2048"https://example.com/webhook"
Descriptive name for this subscription
100"Account opt-out webhook"
Response
Opt-out subscription created successfully
Response body returned when an opt-out subscription is created successfully
"6a0ca910b402df368d2aff07"
contact "contact"
"431705"
["optOut"]
"https://example.com/webhook"
true
"2026-05-19T18:16:48.360Z"
"2026-05-19T18:16:48.360Z"
"Account opt-out webhook"
Was this page helpful?
curl --request POST \
--url https://api.lusha.com/api/subscriptions/opt-out \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"entityType": "contact",
"url": "https://example.com/webhook",
"name": "Account opt-out webhook"
}
'import requests
url = "https://api.lusha.com/api/subscriptions/opt-out"
payload = {
"entityType": "contact",
"url": "https://example.com/webhook",
"name": "Account opt-out webhook"
}
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
entityType: 'contact',
url: 'https://example.com/webhook',
name: 'Account opt-out webhook'
})
};
fetch('https://api.lusha.com/api/subscriptions/opt-out', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.lusha.com/api/subscriptions/opt-out")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"entityType\": \"contact\",\n \"url\": \"https://example.com/webhook\",\n \"name\": \"Account opt-out webhook\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lusha.com/api/subscriptions/opt-out"
payload := strings.NewReader("{\n \"entityType\": \"contact\",\n \"url\": \"https://example.com/webhook\",\n \"name\": \"Account opt-out webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "6a0ca910b402df368d2aff07",
"entityType": "contact",
"entityId": "431705",
"signalTypes": [
"optOut"
],
"url": "https://example.com/webhook",
"isActive": true,
"createdAt": "2026-05-19T18:16:48.360Z",
"updatedAt": "2026-05-19T18:16:48.360Z",
"name": "Account opt-out webhook"
}{
"statusCode": 400,
"message": "Invalid request parameters"
}{
"statusCode": 401,
"message": "Invalid API key"
}{
"statusCode": 403,
"message": "An opt-out subscription already exists for this account"
}{
"statusCode": 500,
"message": "Internal server error. Please try again later."
}