Skip to main content

Add & Remove List Contacts

Add contacts to a list, or remove them from it. A contact can belong to several lists at once.

To read the members of a list, use GET /contacts?list_id=:id — there is no list-scoped read endpoint.

Add Contacts to List​

Add one or more contacts to a list. Contacts already in the list are skipped.

Endpoint​

POST /lists/:id/contacts

Returns: 200 OK

Headers​

HeaderValueRequired
AuthorizationBearer <your-api-key>Yes
Content-Typeapplication/jsonYes

Path Parameters​

ParameterTypeDescription
idstringThe list ID

Body Parameters​

ParameterTypeRequiredDescription
contact_idsstring[]YesArray of contact IDs to add. Min: 1.

Response​

{
"message": "Contacts added to list",
"processed": 3,
"skipped": 1
}
FieldTypeDescription
processednumberNumber of contacts newly added to the list
skippednumberNumber of contacts that were already in the list (skipped)

Examples​

curl -X POST "https://api.arsel.sa/v1/lists/01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a/contacts" \
-H "Authorization: Bearer $ARSEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact_ids": [
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6b",
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6c",
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6d"
]
}'

Remove Contacts from List​

Remove one or more contacts from a list. The contacts themselves are not deleted — only the list association is removed.

Endpoint​

DELETE /lists/:id/contacts

Returns: 200 OK

Body Parameters​

ParameterTypeRequiredDescription
contact_idsstring[]YesArray of contact IDs to remove. Min: 1.

Response​

{
"message": "Contacts removed from list",
"processed": 2,
"skipped": 0
}

Examples​

curl -X DELETE "https://api.arsel.sa/v1/lists/01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a/contacts" \
-H "Authorization: Bearer $ARSEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact_ids": [
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6b",
"01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6c"
]
}'

Error Responses​

{
"status_code": 401,
"name": "unauthorized",
"message": "Invalid API Key"
}