Get List Contact Count
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. 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.
Property nameTypeRequiredDescription
Authorizationstring
required
Default:
Bearer <<YOUR_API_KEY_HERE>>
Property nameTypeRequiredDescription
idstring
required
200404
SchemaExample
Property nameTypeRequiredDescriptionChild properties
contact_countinteger
Optional
billable_countinteger
Optional
1const client = require("@sendgrid/client");2client.setApiKey(process.env.SENDGRID_API_KEY);34const id = "id";56const request = {7url: `/v3/marketing/lists/${id}/contacts/count`,8method: "GET",9};1011client12.request(request)13.then(([response, body]) => {14console.log(response.statusCode);15console.log(response.body);16})17.catch((error) => {18console.error(error);19});