You can add categories to the X-SMTPAPI header of the emails you send via SendGrid. This will allow you to track emails based on your own categorization system.

Categories must be in 7bit encoding using the US-ASCII character set.

Currently, there is no limit to the number of categories you can track. However, we recommend no more than ~100 total unique categories as this will increase your ease of use in the Statistics area. Additionally, a high rate of unique categories on your account can negatively impact the rate at which we process the messages you send.


You can use SendGrid's SMTP API to add these categories to your email. The following should be added to the email's header:

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

Example Category Header

  "category": "Example Category"

In this example, SendGrid would associate statistics for the email containing that header with the category Example Category.


You can assign up to 10 categories per message:

  "category": [

Categories should be used to group messages together by broad topic. If you need to attach unique data or identifiers to a message, use Unique Arguments instead.

See a mistake? Edit this page