Menu

Expand
Rate this page:

Segmenting Contacts V2

Segments are similar to contact lists, except they update dynamically over time as information stored about your contacts or the criteria used to define your segments changes. When you segment your audience, you are able to create personalized Automation emails and Single Sends that directly address the wants and needs of your particular audience.

The Marketing Campaigns Segments V2 API allows you to create, edit, and delete segments as well as retrieve a list of segments or an individual segment by ID.

Note that Twilio SendGrid checks for newly added or modified contacts who meet a segment's criteria on an hourly schedule. Only existing contacts who meet a segment's criteria will be included in the segment searches within 15 minutes.

Segments built using engagement data such as "was sent" or "clicked" will take approximately 30 minutes to begin populating.

Segment samples and counts are refreshed approximately once per hour; they do not update immediately. If no contacts are added to or removed from a segment since the last refresh, the sample and UI count displayed will be refreshed at increasing time intervals with a maximum sample and count refresh delay of 24 hours.

Refresh Segment

The Refresh Segment operation allows customers with Marketing Campaigns Basic or Advanced plans to manually refresh segments. You can refresh a segment twice per day. Refreshes will be reset at midnight in the timezone stored for the segment. A segment cannot be refreshed more than once within one hour, and the endpoint has a rate limit of 10 requests per day that is reset at 0:00 UTC. Manually refreshing a segment does not affect the segment's backoff.

POST /v3/marketing/segments/2.0/refresh/{segment_id}

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

Manually refresh a segment by segment ID.

Request Body

object
user_time_zone
string

The user's timezone. The timezone is used to reset the refresh count at midnight in the user's local time. Only IANA time zone format is accepted.

required
{
  "user_time_zone": "America/Chicago"
}

Path Parameters

segment_id
string
default: None
required

Responses

object
job_id
string

The ID of the manual refresh job. Used only for internal purposes.

{
  "job_id": "1588e03b-50aa-454a-97d1-e1530345a5ec"
}
No response body.
object
error
string

A description of the error.

required
No response body.
object
error
string

A description of the error.

required
        
        
        
        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.

              
              
              

              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!

              Refer us and get $10 in 3 simple steps!

              Step 1

              Get link

              Get a free personal referral link here

              Step 2

              Give $10

              Your user signs up and upgrade using link

              Step 3

              Get $10

              1,250 free SMSes
              OR 1,000 free voice mins
              OR 12,000 chats
              OR more