Single Send API not recognizing personalization token input

I am trying to set up an API call to send an email in Hubspot by following this documentation: https://legacydocs.hubspot.com/docs/methods/email/transactional_email/single-send-overview

The personalization token’s internal name in Hubspot is ‘reports_list’.

The body of the api request is this:

{“emailId”:XXX,

“message”:{“to":"XXX@XXX.com”},

“customProperties”:[{“name”:“reports_list”,“value”:“<ul><li>first list element</li><li>second list element</li></ul>”}]}

(I replaced the email ID and email address with ‘XXX’ for what are hopefully obvious reasons)

I then run the following code:

var apiRequest = new RestRequest($'/email/public/v1/singleEmail/send?hapikey={apiKey}");

// (code to set up the body, a json object, the exact value of which is pasted above in bold)

apiRequest.AddJsonBody(body)

var apiResponse = client.Post(apiRequest)

The email sends correctly, to the specified user, with the specified email ID, but instead of replacing the ‘reports_list’ personalization token in the email with “<ul><li>first list element</li><li>second list element</li></ul>”, it just uses the default value.

Any ideas what might be going wrong?

Hi @NWackowski,

When I make a request: POST https://api.hubapi.com/email/public/v1/singleEmail/send with payload below:

{"emailId": XXXXX,"message": { "to": "test@example.com"},"customProperties": [{ "name": "report_list", "value": "<ul><li>first list element</li><li>second list element</li></ul>"}]}

It’s working fine for me (see below):

One thing to check is that you’ve included the correct token in the email template. It should be {{ custom.propertyName }} so in your case {{ custom.report_list }} . See screenshot below: