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.

1
2
3
{
  "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 the asm_groups_to_display header is omitted, your default groups will be shown on the Manage Preferences page instead.

You can specify up to 25 groups to display.

1
2
3
{
  "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: