curl -X DELETE "https://YOUR_DEPLOYMENT.lupitor.com/api/v1/leads?campaignId=YOUR_CAMPAIGN_ID&externalId=CRM_12345" \
-H "x-api-key: YOUR_API_KEY"
const response = await fetch(
'https://YOUR_DEPLOYMENT.lupitor.com/api/v1/leads?campaignId=YOUR_CAMPAIGN_ID&externalId=CRM_12345',
{
method: 'DELETE',
headers: {
'x-api-key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();
import requests
response = requests.delete(
'https://YOUR_DEPLOYMENT.lupitor.com/api/v1/leads',
params={
'campaignId': 'YOUR_CAMPAIGN_ID',
'externalId': 'CRM_12345'
},
headers={'x-api-key': 'YOUR_API_KEY'}
)
print(response.json())
{
"success": true,
"data": {
"deleted": true
},
"error": null
}
{
"success": false,
"data": null,
"error": "Lead not found"
}
{
"success": false,
"data": null,
"error": "At least one of phoneNumber or externalId query parameter is required"
}
Leads
Delete Lead
Delete a single lead from your campaign
DELETE
/
api
/
v1
/
leads
curl -X DELETE "https://YOUR_DEPLOYMENT.lupitor.com/api/v1/leads?campaignId=YOUR_CAMPAIGN_ID&externalId=CRM_12345" \
-H "x-api-key: YOUR_API_KEY"
const response = await fetch(
'https://YOUR_DEPLOYMENT.lupitor.com/api/v1/leads?campaignId=YOUR_CAMPAIGN_ID&externalId=CRM_12345',
{
method: 'DELETE',
headers: {
'x-api-key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();
import requests
response = requests.delete(
'https://YOUR_DEPLOYMENT.lupitor.com/api/v1/leads',
params={
'campaignId': 'YOUR_CAMPAIGN_ID',
'externalId': 'CRM_12345'
},
headers={'x-api-key': 'YOUR_API_KEY'}
)
print(response.json())
{
"success": true,
"data": {
"deleted": true
},
"error": null
}
{
"success": false,
"data": null,
"error": "Lead not found"
}
{
"success": false,
"data": null,
"error": "At least one of phoneNumber or externalId query parameter is required"
}
Endpoint Alias: You can also use
/api/v1/records instead of /api/v1/leads. Both endpoints are functionally identical - use whichever naming convention fits your integration.Lead Lookup
Leads are identified byexternalId or phoneNumber, not internal IDs. This matches how you created the lead.
At least one of
phoneNumber or externalId is required. If both are provided, externalId takes priority for the lookup.Authentication
string
required
Your API key with
write scopeQuery Parameters
string
required
The ID of the campaign the lead belongs to
string
Phone number in E.164 format (e.g., +15555551234).Required if
externalId is not provided.string
Your CRM’s internal ID for this lead.Required if
phoneNumber is not provided.Response
boolean
Whether the request was successful
string | null
Error message if request failed
Examples
- By External ID
- By Phone Number
Delete by external CRM reference:
curl -X DELETE "https://YOUR_DEPLOYMENT.lupitor.com/api/v1/leads?campaignId=YOUR_CAMPAIGN_ID&externalId=CRM_12345" \
-H "x-api-key: YOUR_API_KEY"
const response = await fetch(
'https://YOUR_DEPLOYMENT.lupitor.com/api/v1/leads?campaignId=YOUR_CAMPAIGN_ID&externalId=CRM_12345',
{
method: 'DELETE',
headers: {
'x-api-key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();
import requests
response = requests.delete(
'https://YOUR_DEPLOYMENT.lupitor.com/api/v1/leads',
params={
'campaignId': 'YOUR_CAMPAIGN_ID',
'externalId': 'CRM_12345'
},
headers={'x-api-key': 'YOUR_API_KEY'}
)
print(response.json())
Delete by phone number:
curl -X DELETE "https://YOUR_DEPLOYMENT.lupitor.com/api/v1/leads?campaignId=YOUR_CAMPAIGN_ID&phoneNumber=%2B15555551234" \
-H "x-api-key: YOUR_API_KEY"
const response = await fetch(
'https://YOUR_DEPLOYMENT.lupitor.com/api/v1/leads?campaignId=YOUR_CAMPAIGN_ID&phoneNumber=%2B15555551234',
{
method: 'DELETE',
headers: {
'x-api-key': 'YOUR_API_KEY'
}
}
);
const data = await response.json();
import requests
response = requests.delete(
'https://YOUR_DEPLOYMENT.lupitor.com/api/v1/leads',
params={
'campaignId': 'YOUR_CAMPAIGN_ID',
'phoneNumber': '+15555551234'
},
headers={'x-api-key': 'YOUR_API_KEY'}
)
print(response.json())
{
"success": true,
"data": {
"deleted": true
},
"error": null
}
{
"success": false,
"data": null,
"error": "Lead not found"
}
{
"success": false,
"data": null,
"error": "At least one of phoneNumber or externalId query parameter is required"
}
Notes
Permanent Deletion: This action cannot be undone. The lead will be permanently deleted.
Need the lead data? The delete response only confirms deletion—it doesn’t return the lead’s details. If you need the lead information (metadata, status, etc.), fetch the lead first using
GET /api/v1/leads, then delete it.URL Encoding: When passing phone numbers in the URL, remember to URL-encode the
+ sign as %2B.Access Control: You can only delete leads that belong to campaigns your API key has access to.
Common Errors
| Error | Cause | Solution |
|---|---|---|
campaignId query parameter is required | Missing campaignId | Include campaignId in query string |
At least one of phoneNumber or externalId query parameter is required | Missing both identifiers | Include phoneNumber or externalId |
Lead not found | Lead doesn’t exist in campaign | Verify identifier and campaign |
Invalid or inactive API key | Wrong API key | Check your API key |
Forbidden | API key doesn’t have write access | Use an API key with write scope |