Rate this page:

Suppression Groups

Defining an Unsubscribe Group When Sending

The method used to specify an unsubscribe group for an email depends on how you will be sending that email:

  • When sending an SMTP message, add the group's ID to the X-SMTPAPI header.
  • When sending an email via the Web API v2, add the group's ID in the x-smtpapi parameter.
  • When sending an email via the Web API v3, define the group's ID in the asm.group_id parameter.

You may only specify one group per send, and you should wait one minute after creating the group before sending with it.

When passing asm_group_id please make sure to only use integers as shown in our examples. Any other type could result in unintended behavior.

{
  "asm_group_id": 1
}

Defining Unsubscribe Groups to display on the Manage Preferences page

To specify which groups to display on the Manage Preferences page of an email, add the group IDs to the X-SMTPAPI header of an SMTP message, or in the x-smtpapi parameter of a mail.send API call. If you omit the asm_groups_to_display header, your default groups is shown on the Manage Preferences page instead.

You can specify up to 25 groups to display.

{
  "asm_groups_to_display": [1, 2, 3]
}

Groups

You can find your group IDs by looking at the Group ID column in the Unsubscribe Groups UI, or by calling the GET method of the groups resource.

Related Articles:

Additional Resources

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the SendGrid tag on Stack Overflow.

      
      
      

      Thank you for your feedback!

      We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

      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