Menu

Expand
Rate this page:

Lists

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 a List by ID

GET /v3/marketing/lists/{id}

Base url: https://api.sendgrid.com

This endpoint returns data about a specific list.

Setting the optional parameter contact_sample=true returns the contact_sample in the response body. Up to 50 of the most recent contacts uploaded or attached to a list will be returned.

The full contact count is also returned.

Authentication

  • API Key

Headers

Authorization
string
default: Bearer <<YOUR_API_KEY_HERE>>
required

Path Parameters

id
string

The ID of the list on which you want to perform the operation.

default: None
required

Query String

contact_sample
boolean

Setting this parameter to the true will cause the contact_sample to be returned

default: False

Responses

object
id
string

The generated ID for your list.

maxLength: 36minLength: 36
name
string

The name you gave your list.

contact_count
integer

The number of contacts currently stored on the list.

_metadata
object
self
string

A link to this object.

contact_sample
object
id
string
format: uuidmaxLength: 36minLength: 36
required
first_name
string
last_name
string
unique_name
string
email
string
format: email
phone_number_id
string
external_id
string
anonymous_id
string
alternate_emails
array[string] or null
address_line_1
string
address_line_2
string
city
string
state_province_region
string
country
string
postal_code
string
phone_number
string
whatsapp
string
line
string
facebook
string
list_ids
array[string]
required
segment_ids
array[string]
custom_fields
object
created_at
string
format: date-time
required
updated_at
string
format: date-time
required
_metadata
object
self
string

A link to this object.

array[object]
message
string
required
field
string
error_id
string
parameter
string
Loading Code Sample...
        
        

        Get a List by ID

        Rate this page:

        Need some help?

        We all do sometimes. Get help now from the Twilio SendGrid Support Team.

        Running into a coding hurdle? Lean on the wisdom of the crowd by browsing the SendGrid tag on Stack Overflow or visiting Twilio's Stack Overflow Collective.

        Loading Code Sample...
              
              
              

              Thank you for your feedback!

              Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

              Sending your feedback...
              🎉 Thank you for your feedback!
              Something went wrong. Please try again.

              Thanks for your feedback!

              thanks-feedback-gif