Delete Contacts
Remove contacts from your organization. Supports deleting a single contact or bulk deleting up to 1,000 contacts at once.
Delete Single Contact
Soft-delete a contact by ID.
Endpoint
DELETE /contacts/:id
Returns: 200 OK
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The contact ID to delete |
Response
{
"message": "Contact deleted"
}
Examples
- cURL
- JavaScript
- Python
- C#
- PHP
curl -X DELETE "https://api.arsel.sa/v1/contacts/01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a" \
-H "Authorization: Bearer be_your_api_key"
const contactId = "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a";
const response = await fetch(
`https://api.arsel.sa/v1/contacts/${contactId}`,
{
method: "DELETE",
headers: { Authorization: "Bearer be_your_api_key" },
}
);
console.log(await response.json());
import requests
contact_id = "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a"
response = requests.delete(
f"https://api.arsel.sa/v1/contacts/{contact_id}",
headers={"Authorization": "Bearer be_your_api_key"},
)
print(response.json())
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer be_your_api_key");
var contactId = "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a";
var response = await client.DeleteAsync($"https://api.arsel.sa/v1/contacts/{contactId}");
Console.WriteLine(await response.Content.ReadAsStringAsync());
<?php
$contactId = "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a";
$ch = curl_init("https://api.arsel.sa/v1/contacts/{$contactId}");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer be_your_api_key"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Bulk Delete Contacts
Delete multiple contacts in a single request. Maximum 1,000 contacts per request.
Endpoint
POST /contacts/bulk-delete
Returns: 200 OK
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <your-api-key> | Yes |
Content-Type | application/json | Yes |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
contact_ids | string[] | Yes | Array of contact IDs to delete. Min: 1, Max: 1,000. |
Response
{
"message": "Contacts deleted",
"deleted": 25
}
| Field | Type | Description |
|---|---|---|
deleted | number | Number of contacts that were deleted |
Examples
- cURL
- JavaScript
- Python
- C#
- PHP
curl -X POST "https://api.arsel.sa/v1/contacts/bulk-delete" \
-H "Authorization: Bearer be_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"contact_ids": [
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a",
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6b",
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6c"
]
}'
const response = await fetch("https://api.arsel.sa/v1/contacts/bulk-delete", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer be_your_api_key",
},
body: JSON.stringify({
contact_ids: [
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a",
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6b",
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6c",
],
}),
});
const result = await response.json();
console.log(`Deleted: ${result.deleted}`);
import requests
response = requests.post(
"https://api.arsel.sa/v1/contacts/bulk-delete",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer be_your_api_key",
},
json={
"contact_ids": [
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a",
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6b",
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6c",
],
},
)
result = response.json()
print(f"Deleted: {result['deleted']}")
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer be_your_api_key");
var payload = new
{
contact_ids = new[]
{
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a",
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6b",
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6c"
}
};
var json = System.Text.Json.JsonSerializer.Serialize(payload);
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.arsel.sa/v1/contacts/bulk-delete", content);
Console.WriteLine(await response.Content.ReadAsStringAsync());
<?php
$ch = curl_init("https://api.arsel.sa/v1/contacts/bulk-delete");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer be_your_api_key"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"contact_ids" => [
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a",
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6b",
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6c"
]
]));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Error Responses
- 404 Not Found
- 422 Validation Error
- 401 Unauthorized
{
"status_code": 404,
"name": "not_found",
"message": "Contact not found"
}
{
"status_code": 422,
"name": "validation_error",
"message": "contact_ids must contain no more than 1000 elements"
}
{
"status_code": 401,
"name": "unauthorized",
"message": "Invalid or missing API key"
}