Delete a company
Delete a company, and choose what happens to its people.
DELETE
/api/v1/leads/:idScope
leads:writeDeletes the company. If people work there, say what happens to them with contacts: keep leaves them as contacts without a company, delete deletes them and their history too. A company with people and no contacts choice is refused, so nobody is deleted by accident.
Path parameters
Prop
Type
Query parameters
Prop
Type
Example request
curl -X DELETE "https://api.pedibee.com/api/v1/leads/66f1c2a9e4b0a1b2c3d4e001?contacts=keep" \
-H "Authorization: Bearer $PEDIBEE_API_KEY"Response
{
"deleted": true,
"id": "66f1c2a9e4b0a1b2c3d4e001",
"contactsDeleted": 0,
"contactsKept": 3
}Errors
Every error is { "error": "…" } with a message you can show. See Errors and limits.
| Status | When |
|---|---|
400 | contacts is neither keep nor delete. |
403 | The key doesn’t have leads:write, or its creator’s role no longer allows it. |
404 | No company with this id in your workspace. |
409 | The company has people and contacts wasn't given. |
401 | The API key is missing, invalid, revoked or expired. |
429 | Too many requests. Wait for the seconds in Retry-After. |
