Get the total contact consent count for each consent state.

Getting contact insights helps you interpret the bigger picture of contact engagement and list growth. To get the current consent state of all contacts in your account, make a GET call to the /contacts/counts endpoint. This endpoint returns the total contacts count and the total contact-consent count for each consent state. Optionally, to include the total number of new subscribers in the results, use new_subscribers in the include query parameter. For example:

{
    "total": 1564,
    "explicit": 44,
    "implicit": 1500,
    "pending": 13,
    "unsubscribed": 1,
    "new_subscriber": 6
}
  • total: The total number of contacts in the account.
  • explicit: The total number of explicitly confirmed contacts. Consent is obtained when you explicitly ask your potential contacts for permission to send them email. For example, if you send contacts a sign-up form and contacts use it to sign-up to receive your emails, they are explicitly giving you consent. Explicit consent it is good forever, or until the contact unsubscribes.
  • implicit: The total number of contacts implicitly confirmed. Consent is inferred based on actions, such as having an existing business relationship and making a purchase or donation. For example, to comply with Canada’s Anti-Spam Law (CASL), to maintain implied consent a contact must make a business action with you at least once every two years. Under the Unwanted Commercial Electronic Mail (CAN-Spam) act, there is no need to maintain implied consent because it is assumed until the receiver indicates they no longer wish to receive messages.
  • pending: Total number of contacts pending confirmation. If you send a contact a request for consent, the status is pending until the contact actually consents to receive emails from you.
  • unsubscribed: Total number of unsubscribed contacts. Consent is revoked when a contact has unsubscribed from receiving emails from you.
  • new_subscriber: The total number of contacts that are new subscribers. To get new subscriber counts, use new_subscriber in the include parameter. (Optional)

Example GET Contacts Counts Request

GET https://api.cc.email/v3/contacts/counts

Endpoint Requirements

User privileges: contacts:read

Authorization scopes: contact_data

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.cc.email/v3/contacts/counts?include=new_subscriber',
  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(
    'Accept: */*',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

curl --location --request GET 'https://api.cc.email/v3/contacts/counts?include=new_subscriber' \
--header 'Accept: */*' \
--header 'Content-Type: application/json'
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("https://api.cc.email/v3/contacts/counts?include=new_subscriber")
  .method("GET", body)
  .addHeader("Accept", "*/*")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();

Response Body

{
    "total": 1564,
    "explicit": 40,
    "implicit": 1509,
    "pending": 6,
    "unsubscribed": 6,
    "new_subscriber": 1
}

Try it!