API support for custom headers
The Headers field is a JSON object used to add custom fields to a message header. For example, you can add your own Message-ID.
You can add the following standard fields to the message header: Message-ID, List-Unsubscribe, and List-Unsubscribe-Post. Standard fields overwrite existing values in the message header. Non-standard fields must start with X-User- and are appended to the message header. For example:
{
"Message-ID": "<msg0001@example.com>",
"X-User-UID1": "UID-1-000001",
"X-User-UID2": "UID-2-000001"
}The JSON object above adds three fields to the message header: Message-ID, X-User-UID1, and X-User-UID2. The following image shows the result in the EML file.

You can add a maximum of 10 message headers in the JSON object. Both standard and non-standard fields must follow the standard header syntax.
The following list explains possible error messages:
user header num exceeds the limit: The number of headers in the JSON object exceeds the limit.some user header has invalid name: A header name is invalid. This error occurs if you use a disallowed standard header, such as From or To, or a custom header that does not start with X-User-.
some user header length exceeds the limit: The total length of a header, including its name and value, exceeds the allowed limit.
some user header has invalid grammar: The name or value of a header does not follow the required RFC syntax.
the format of the message-id is incorrect. please refer to RFC 5322 section 3.6.4: This error is specific to theMessage-IDfield and indicates that the value does not follow the required syntax.
If you found this helpful, please click Like.