curl -X DELETE https://api.ibubbl.com/v1/contacts/c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f \
-H "Authorization: Bearer $IBUBBL_API_KEY"
const contactId = "c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f";
const res = await fetch(`https://api.ibubbl.com/v1/contacts/${contactId}`, {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.IBUBBL_API_KEY}` },
signal: AbortSignal.timeout(10_000),
});
// 204 has no body; only an error does.
if (!res.ok) {
const data = await res.json();
throw new Error(`${res.status} ${data.detail?.error}`);
}
console.log("deleted:", res.status);
import os
import requests
API_KEY = os.environ["IBUBBL_API_KEY"]
contact_id = "c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f"
res = requests.delete(
f"https://api.ibubbl.com/v1/contacts/{contact_id}",
headers={"Authorization": f"Bearer {API_KEY}"},
timeout=10,
)
# 204 has no body; only an error does.
if not res.ok:
data = res.json()
raise RuntimeError(f"{res.status_code} {data['detail']['error']}")
print("deleted:", res.status_code)
(empty body)
{
"detail": {
"error": "not_found",
"message": "Contact not found"
}
}
Contacts
Delete a contact
Delete a contact. It disappears from the list and from GET /v1/contacts/{id}, and every endpoint that takes its id (including POST /v1/messages with contact_id) returns 404 not_found. Deleting it again also returns 404.
What stays: its messages and conversations, which GET /v1/messages still lists under the old contact_id; messages already accepted for it and still waiting, which still go out (cancel them in the dashboard to stop them); and its opt-out, which belongs to the number.
Upserting the same number, sending to it with to, or an inbound message from it creates a new contact with a new id. Names, tags and a block are not carried over; an opt-out is.
DELETE
/
v1
/
contacts
/
{contact_id}
curl -X DELETE https://api.ibubbl.com/v1/contacts/c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f \
-H "Authorization: Bearer $IBUBBL_API_KEY"
const contactId = "c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f";
const res = await fetch(`https://api.ibubbl.com/v1/contacts/${contactId}`, {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.IBUBBL_API_KEY}` },
signal: AbortSignal.timeout(10_000),
});
// 204 has no body; only an error does.
if (!res.ok) {
const data = await res.json();
throw new Error(`${res.status} ${data.detail?.error}`);
}
console.log("deleted:", res.status);
import os
import requests
API_KEY = os.environ["IBUBBL_API_KEY"]
contact_id = "c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f"
res = requests.delete(
f"https://api.ibubbl.com/v1/contacts/{contact_id}",
headers={"Authorization": f"Bearer {API_KEY}"},
timeout=10,
)
# 204 has no body; only an error does.
if not res.ok:
data = res.json()
raise RuntimeError(f"{res.status_code} {data['detail']['error']}")
print("deleted:", res.status_code)
(empty body)
{
"detail": {
"error": "not_found",
"message": "Contact not found"
}
}
Delete a contact
Method:DELETE | Endpoint: /v1/contacts/{contact_id}
Description: Remove a contact from your account. It disappears from List contacts and from every endpoint that takes its ID. Its message history stays.
Authentication: API key in the Authorization header: Authorization: Bearer ib_pk_<64 hex>. Create keys in the dashboard under Settings → API access.
Request Body
None. The path parametercontact_id is the contact’s ID (a UUID).
What deleting does
- The ID stops working. Retrieve, Update, the tag, opt-out and block endpoints, and Send a message with this
contact_idall return404 not_found. Deleting it again also returns404. - History stays. Its messages and conversations are kept, and List messages still returns them with the old
contact_id. - Waiting messages still go out. A message already accepted for the contact and still waiting (held for sending hours, or queued) is not cancelled. Cancel it in the dashboard first if it shouldn’t be sent.
- The number can come back as a new contact. Creating or updating a contact with the same number, sending to it with
to, or an inbound message from it creates a new contact with a newid. Names, tags and a block are not carried over. - An opt-out is never lost. An opt-out belongs to the phone number, not the contact. A new contact for an opted-out number starts with
opted_out: true, and sends to it return422 contact_opted_out. Deleting a contact is not a way to message someone who opted out.
curl -X DELETE https://api.ibubbl.com/v1/contacts/c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f \
-H "Authorization: Bearer $IBUBBL_API_KEY"
const contactId = "c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f";
const res = await fetch(`https://api.ibubbl.com/v1/contacts/${contactId}`, {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.IBUBBL_API_KEY}` },
signal: AbortSignal.timeout(10_000),
});
// 204 has no body; only an error does.
if (!res.ok) {
const data = await res.json();
throw new Error(`${res.status} ${data.detail?.error}`);
}
console.log("deleted:", res.status);
import os
import requests
API_KEY = os.environ["IBUBBL_API_KEY"]
contact_id = "c8a1f4e2-3b9d-4f7c-a8e5-1d2c3b4a5e6f"
res = requests.delete(
f"https://api.ibubbl.com/v1/contacts/{contact_id}",
headers={"Authorization": f"Bearer {API_KEY}"},
timeout=10,
)
# 204 has no body; only an error does.
if not res.ok:
data = res.json()
raise RuntimeError(f"{res.status_code} {data['detail']['error']}")
print("deleted:", res.status_code)
(empty body)
{
"detail": {
"error": "not_found",
"message": "Contact not found"
}
}
Responses
204 No Content The contact is deleted. The response has no body. 401 Unauthorized{
"detail": {
"error": "unauthorized",
"message": "Invalid or revoked API key"
}
}
message values: Authorization Bearer token required, API key required (use Authorization: Bearer ib_pk_…), Invalid API key format, Customer account not found.
403 Forbidden
{
"detail": {
"error": "forbidden",
"message": "Account is suspended"
}
}
message is then Account is cancelled). Every API-key endpoint returns this.
404 Not Found
{
"detail": {
"error": "not_found",
"message": "Contact not found"
}
}
404, the first attempt already deleted it.
