Get details about all tags.

Make a GET call to the /contact_tags endpoint to get details about tags that are associated with your account. The example that follows shows tag details returned in the response when the limit and tags_count parameters are specified:

{
    "tags_count": 14,
    "tags": [
        {
            "tag_id": "0169480a-24dc-11eb-8ae8-fa163e595591",
            "name": "owners - big dogs",
            "tag_source": "ESTY",
            "contacts_count": 45,
            "created_at": "2020-11-12T11:41:30Z",
            "updated_at": "2020-11-12T11:41:30Z"
        },
        {
            "tag_id": "20012f6c-332d-11eb-923c-fa163e595591",
            "name": "owners - small dogs",
            "tag_source": "ESTY",
            "contacts_count": 72,
            "created_at": "2020-11-30T16:57:26Z",
            "updated_at": "2020-11-30T16:57:26Z"
        }
    ],
    "_links": {
        "next": {
            "href": "/contacts-service/v3/accounts/1100465488172/contact_tags?cursor=aW5jbHVkZV9jb3VudD10cnVlJmxpbWl0PTImbmV4dD0yYzM4OGU4ZS0yNGVmLTExZWItOGFlOC1mYTE2M2U1OTU1OTE="
        }
    }
}

The response body returns the name and the ID that uniquely identifies each tag, the source used to tag the contact (if specified when the tag is first created) and timestamps (in ISO format) showing when the tag was created (created_at) and last updated (updated_at).

Parameters

To get details about all tags associated with your account, make a GET call to /contact_tags. To include the total number of contacts to which a tag applies, use the tags_count parameter. To limit the number of tags returned per page of results, use the limit parameter.

Authorization Requirements

User privileges: contacts:read

Authorization scopes: contact_data

Example GET Tags Requests

GET https://api.cc.email/v3/contact_tags

 <?php
 
 $curl = curl_init();
 
 curl_setopt_array($curl, array(
   CURLOPT_URL => "https://api.cc.email/v3/contact_tags",
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_ENCODING => "",
   CURLOPT_MAXREDIRS => 10,
   CURLOPT_TIMEOUT => 0,
   CURLOPT_FOLLOWLOCATION => true,
   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
   CURLOPT_CUSTOMREQUEST => "GET",
   CURLOPT_HTTPHEADER => array(
     "Authorization: Authorization: Bearer {access_token}"
   ),
 ));
 
 $response = curl_exec($curl);
 
 curl_close($curl);
 echo $response;

curl --location --request GET 'api.cc.email/v3/contact_tags \
--header 'Authorization: Bearer {access_token}'
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://api.cc.email/v3/contact_tags")
  .method("GET", null)
  .addHeader("Authorization", "Bearer {access_token}")
  .build();
Response response = client.newCall(request).execute();

Response

 {
     "tags": [
         {
             "tag_id": "20012f6c-332d-11eb-923c-fa163e595591",
             "name": "owners - big dogs",
             "created_at": "2020-11-30T16:57:26Z",
             "updated_at": "2020-11-30T16:57:26Z"
         },
         {
             "tag_id": "2c388e8e-24ef-11eb-8ae8-fa163e595591",
             "name": "owners - medium dogs",
             "tag_source": "ESTY",
             "created_at": "2020-11-12T13:58:42Z",
             "updated_at": "2020-11-12T13:58:42Z"
         },
         {
             "tag_id": "30c97dd0-332e-11eb-923c-fa163e595591",
             "name": "Dogs Rule Benefit 2020 - attended 2020",
             "created_at": "2020-11-30T17:05:04Z",
             "updated_at": "2020-11-30T17:05:04Z"
         },
         {
             "tag_id": "525837d2-3335-11eb-923c-fa163e595591",
             "name": "Dogs Rule 2020 Donors",
             "created_at": "2020-11-30T17:56:07Z",
             "updated_at": "2020-11-30T17:56:07Z"
         },
         {
             "tag_id": "7ab451fe-1fa1-11eb-9a08-fa163ef30863",
             "name": "owners - small dogs",
             "tag_source": "ESTY",
             "created_at": "2020-11-05T19:59:57Z",
             "updated_at": "2020-11-05T19:59:57Z"
         }
     ] 
  }
        

Try it!