Skip to Content
ContactsDelete Contacts

Delete Contacts

Deleting a contact removes it from your organization immediately: it stops appearing in lists and segments.

There are three ways to choose the contacts to delete:

EndpointUse when
DELETE /v1/organization/contacts/:idYou already have the contact’s Bahasha id
DELETE /v1/organization/contacts/by-number/:numberYou only know the phone number
POST /v1/organization/contacts/bulk-deleteYou have up to 500 ids

All three endpoints require the contacts:write permission. OAuth connections (such as Zapier) must have that scope granted; API keys can call the endpoints directly.

Delete a contact by id

DELETE /v1/organization/contacts/:id
curl -X DELETE https://api.bahasha.app/v1/organization/contacts/68011f5f8f7f109de8f62f5e \ -H "Authorization: Bearer bh_live_xxxxxxxxxxxx"

Response

{ "success": true, "id": "68011f5f8f7f109de8f62f5e", "number": "+254700000000" }

An unknown id, a malformed id, a contact that belongs to another organization, or a contact that was already deleted all return 404 Not Found. The same id is not distinguishable from a deleted one, so a retried delete returns 404 rather than 200.


Delete a contact by phone number

DELETE /v1/organization/contacts/by-number/:number

The number is normalized with your organization’s default country before the lookup, so national and international formats resolve to the same contact.

curl -X DELETE "https://api.bahasha.app/v1/organization/contacts/by-number/%2B254700000000" \ -H "Authorization: Bearer bh_live_xxxxxxxxxxxx"

Percent-encode the leading + as %2B if your HTTP client or proxy requires it. The unencoded form is also accepted.

Response

{ "success": true, "id": "68011f5f8f7f109de8f62f5e", "number": "+254700000000" }
StatusMeaning
400The value is not a valid phone number
404No active contact in your organization has that number

Delete contacts in bulk

POST /v1/organization/contacts/bulk-delete

Bulk deletion is a POST rather than a DELETE because request bodies are unreliable on DELETE through proxies and HTTP clients.

Request body

FieldTypeRequiredDescription
contact_idsstring[]✓1–500 contact ids
curl -X POST https://api.bahasha.app/v1/organization/contacts/bulk-delete \ -H "Authorization: Bearer bh_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "contact_ids": [ "68011f5f8f7f109de8f62f5e", "68011f5f8f7f109de8f62f5f" ] }'

Response

{ "success": true, "deleted_count": 1, "not_found": ["68011f5f8f7f109de8f62f5f"] }

not_found lists the ids that were not deleted because they are unknown, already deleted, or belong to another organization. A partially stale id list therefore still deletes the contacts that do exist, and the whole request does not fail. Duplicate ids are collapsed before the lookup.

deleted_count: 0 is still a 200: use not_found to see which ids did not match. To delete more than 500 contacts, split the ids into batches.

StatusMeaning
400contact_ids is missing, empty, contains malformed ids, or has more than 500 entries

Segment deletion is separate: DELETE /v1/organization/contacts/segments/:id deletes the segment only and leaves its contacts intact. See Segments.

Errors

StatusMeaning
400Invalid phone number, or an empty, malformed, or oversized contact_ids
401Missing or invalid credentials
403The OAuth token does not include the contacts:write scope
404No active contact matches the id or number