Skip to main content

Tag Contacts

Apply or remove tags from contacts. A contact can have multiple tags.

Apply Tag to Contacts

Apply a tag to one or more contacts. Contacts that already have the tag are skipped.

Endpoint

POST /tags/:id/contacts

Returns: 200 OK

Headers

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

Path Parameters

ParameterTypeDescription
idstringThe tag ID

Body Parameters

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

Response

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

Examples

curl -X POST "https://api.arsel.sa/v1/tags/01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a/contacts" \
-H "Authorization: Bearer be_your_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 Tag from Contacts

Remove a tag from one or more contacts. The contacts themselves are not deleted.

Endpoint

DELETE /tags/:id/contacts

Returns: 200 OK

Body Parameters

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

Response

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

Examples

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