Deleting Leads
Endpoint Overview
Delete an individual lead by its numeric identifier.
- HTTP Method:
DELETE - Endpoint URL:
https://api.trywhiteowl.com/api/v1/leads/:id - Authentication: Bearer Token (API Key)
- Required Permission:
leads:delete(Ensure your API key has Delete permission under Leads)
Path Parameters
Section titled “Path Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
id |
Number | Yes | The numeric identifier of the lead to delete. |
Request Headers
Section titled “Request Headers”| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
String | Yes | Bearer token format: Bearer YOUR_API_KEY |
Content-Type |
String | Yes | application/json |
Code Examples
Section titled “Code Examples”cURL
curl -X DELETE "https://api.trywhiteowl.com/api/v1/leads/502" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json"JavaScript (Fetch)
const leadId = 502;const options = { method: 'DELETE', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }};
fetch(`https://api.trywhiteowl.com/api/v1/leads/${leadId}`, options) .then(response => response.json()) .then(data => console.log(data)) .catch(err => console.error(err));Python (Requests)
import requests
lead_id = 502url = f"https://api.trywhiteowl.com/api/v1/leads/{lead_id}"headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}
response = requests.delete(url, headers=headers)print(response.json())Response Structure
Section titled “Response Structure”Success Response (200 OK)
{ "success": true, "message": "The lead was deleted successfullly", "data": [ { "id": 502, "name": "Alex Smith", "email": "alex.smith@example.com", "organization": "org_12345" } ]}Error Responses
- Missing Identifier:
{ "success": false, "message": "id is a reuired fiel and should be passes as a search param"}- Missing Permissions (
403 Forbidden):
{ "success": false, "message": "Your API key does not have the 'leads:delete' permission"}- Internal / Database Error:
{ "success": false, "message": "There was an error deleting the lead"}