This information will be stored as a "Not PII" field and may be used for counting or other operations as SendGrid runs its systems. These fields generally cannot be redacted or removed. You should take care not to place PII in this field. SendGrid does not treat this data as PII, and its value may be visible to SendGrid employees, stored long-term, and may continue to be stored after you've left SendGrid's platform.
The SMTP API JSON string allows you to attach an unlimited number of unique arguments to your email up to 10,000 bytes. The arguments are used only for tracking. They can be retrieved through the Event API or the Email Activity page.
Note that unique arguments are only used in the SendGrid SMTP API and V2 Mail Send API. The V3 Mail Send API uses custom arguments (with the parameter custom_args
) instead of unique arguments.
When passing unique_args
please make sure to only use strings as shown in our examples. Any other type could result in unintended behavior.
These arguments can be added using a JSON string like this:
1{2"unique_args": {3"customerAccountNumber": "55555",4"activationAttempt": "1",5"New Argument 1": "New Value 1",6"New Argument 2": "New Value 2",7"New Argument 3": "New Value 3",8"New Argument 4": "New Value 4"9}10}
These arguments can then be seen in posts from the SendGrid Event Webhook. The contents of one of these POST
requests would look something like this:
1{2"sg_message_id": "145cea24eb8.1c420.57425.filter-132.3382.5368192A3.0",3"New Argument 1": "New Value 1",4"event": "processed",5"New Argument 4": "New Value 4",6"email": "useexampexample@example.com",7"email": "example@example.com",8"smtp-id": "<145cea24eb8.1c420.57425@localhost.localdomain>",9"timestamp": 1399331116,10"New Argument 2": "New Value 2",11"New Argument 3": "New Value 3",12"customerAccountNumber": "55555",13"activationAttempt": "1"14}
Bounces returned with the Return-Path cause unique_args
not to be attached to an event. This can cause issues when developing unique_args
POST
handling.
To apply different unique arguments to individual emails, you may use substitution tags. An example of this would look like:
1{2"sub": {3"-account_number-": ["314159", "271828"]4},5"unique_args": {6"customerAccountNumber": "-account_number-"7}8}