Use the POST /activities/contacts_tags_delete
endpoint to create an asynchronous activity used to delete up to 500 tags. Deleted tags are automatically removed from tagged contacts. To specify which tags to delete, use the tag_ids
array of string values in the request body. For example:
{
"tag_ids": [
"00e4429c-3beb-11eb-9f34-fa163e56c9b9",
"04fe9a97-a579-43c5-bb1a-58ed29bf0a6a"
]
}
Example Request
POST https://api.cc.email/v3/activities/contacts_tags_delete
Endpoint Requirements
User privileges: contacts:write
Authorization scopes: contact_data
<?php
curl --location --request POST 'https://api.cc.email/v3/activities/contacts_tags_delete' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}' \
--data-raw '{
"tag_ids": [
"4501b8b0-1e39-11e8-bc9f-00163e6dbd8d",
"486d275e-7aa8-11eb-ad39-c99fb2f37c92"
]
}'
curl --location --request POST 'https://api.cc.email/activities/contacts_tags_delete' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}' \
--data-raw '{
"tag_ids": [
"4501b8b0-1e39-11e8-bc9f-00163e6dbd8d",
"486d275e-7aa8-11eb-ad39-c99fb2f37c92"
]
}'
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"tag_ids\": [\n \"4501b8b0-1e39-11e8-bc9f-00163e6dbd8d\",\n \"486d275e-7aa8-11eb-ad39-c99fb2f37c92\"\n ]\n}");
Request request = new Request.Builder()
.url("https:/api.cc.email/activities/contacts_tags_delete")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {access_token}")
.build();
Response response = client.newCall(request).execute();
Example Response
{
"activity_id": "0c2712b8-9700-11eb-a392-33d450967a54",
"state": "initialized",
"created_at": "2021-04-06T17:46:42Z",
"updated_at": "2021-04-06T17:46:42Z",
"percent_done": 1,
"activity_errors": [],
"status": {},
"_links": {
"self": {
"href": "/v3/activities/0c2712b8-9700-11eb-a392-33d450967a54"
}
}
}
Checking the Activity Status for Job Complete
Check on the activity status by calling the activity status endpoint using the activity_id
provided in the _links
section of the response. The activity_id
is located in the href link. To retrieve the status, make the following GET call:
GET https://api.cc.email/v3/activities/{activity_id}
Endpoint Requirements
User privileges: contacts:write
Authorization scopes: contact_data