Skip to contentSkip to navigationSkip to topbar
On this page

Get List Contact Count



API Overview

api-overview page anchor

Lists are static collections of Marketing Campaigns contacts. This API allows you to interact with the list objects themselves. To add contacts to a list, you must use the Contacts API.

You can also manage your lists using the Contacts menu in the Marketing Campaigns UI(link takes you to an external page). For more information about lists and best practices for building them, see "Building your Contact List".


GET/v3/marketing/lists/{id}/contacts/count

Base url: https://api.sendgrid.com (The Twilio SendGrid v3 API)

This endpoint returns the number of contacts on a specific list.


Authentication

authentication page anchor
Property nameTypeRequiredDescription
Authorizationstringrequired
Default: Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
idstringrequired
200404
SchemaExample
Property nameTypeRequiredDescriptionChild properties
contact_countinteger

billable_countinteger
Get List Contact CountLink to code sample: Get List Contact Count
1
const client = require('@sendgrid/client');
2
client.setApiKey(process.env.SENDGRID_API_KEY);
3
4
const id = "ZGkrHSypTsudrGkmdpJJ";
5
6
const request = {
7
url: `/v3/marketing/lists/${id}/contacts/count`,
8
method: 'GET',
9
10
}
11
12
client.request(request)
13
.then(([response, body]) => {
14
console.log(response.statusCode);
15
console.log(response.body);
16
})
17
.catch(error => {
18
console.error(error);
19
});