PedibeeDocs

Delete a company

Delete a company, and choose what happens to its people.

DELETE/api/v1/leads/:id
Scopeleads:write

Deletes 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

200 OK
{
  "deleted": true,
  "id": "66f1c2a9e4b0a1b2c3d4e001",
  "contactsDeleted": 0,
  "contactsKept": 3
}

Errors

Every error is { "error": "…" } with a message you can show. See Errors and limits.

StatusWhen
400contacts is neither keep nor delete.
403The key doesn’t have leads:write, or its creator’s role no longer allows it.
404No company with this id in your workspace.
409The company has people and contacts wasn't given.
401The API key is missing, invalid, revoked or expired.
429Too many requests. Wait for the seconds in Retry-After.

On this page