# Cannot replace custom parameters from single send email API

**URL:** <https://community.hubspot.com/t/cannot-replace-custom-parameters-from-single-send-email-api/28689>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [December 2, 2020, 10:00pm UTC](https://community.hubspot.com/t/cannot-replace-custom-parameters-from-single-send-email-api/28689 "2020-12-02T22:00:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcornelljames](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dcornelljames/32/76793_2.png) [@dcornelljames](https://community.hubspot.com/u/dcornelljames)\
**Post date:** [December 2, 2020, 10:00pm UTC](https://community.hubspot.com/t/cannot-replace-custom-parameters-from-single-send-email-api/28689/1 "2020-12-02T22:00:50Z")

</div>

Hello,

I have created a custom property called category\_total using the portal dashboard. I am trying to set this value in an email template and send the email using the single send email API as specified in documentation here:

> **[Marketing API | Marketing Email - HubSpot docs](https://developers.hubspot.com/docs/api-reference/legacy/marketing/marketing-emails/guide)**
>
> Learn how to create, update, and retrieve data for your emails using the Marketing Emails v3 API.

i.e. POST to [https://api.hubapi.com/marketing/v3/transactional/single-email/send](https://api.hubapi.com/marketing/v3/transactional/single-email/send) using my API key  
I have tried using the following JSON as specified by other posts I have seen in the forum:

`{`` "emailId":38143921416,`` "message":{`` "to":"dcornell@gmail.com"`` },`` "contactProperties":[`` {`` "name":"firstName",`` "value":"Bubba"`` }``],`` "customProperties":[`` {`` "name":"category_total",`` "value":"4071434"`` }``]``}`

When using this format, I get the following error returned from the API:

{

“status”: “error”,

“message”: “Invalid input JSON on line 6, column 26: Cannot deserialize instance of `java.util.LinkedHashMap` out of START\_ARRAY token”,

“correlationId”: “5f0520aa-8c32-4c6e-af04-4c0d8e406570”

}

This error seems to indicate that I should not be using arrays but rather name-value pairs. If I change the format to:  
{“emailId”:38143921416,  
“message”:{“to”:“[dcornell@gmail.com](mailto:dcornelljames@gmail.com)”},  
“contactProperties”:{“firstName”:“Bubba”},  
“customProperties”:{“contact.category\_total”:“999999”,“category\_total”:“990990909”}  
}

then the message is successfully sent and the contact property is overidden to show a first name of “Bubba”. However, the custom property is not getting set.  
Please advise and thanks in advance.

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [December 3, 2020, 7:47pm UTC](https://community.hubspot.com/t/cannot-replace-custom-parameters-from-single-send-email-api/28689/2 "2020-12-03T19:47:22Z")

</div>

Hi @dcornelljames ,

Thanks for adding the question!

@RiccardoPisani , @thesnappingdog , @MichaelC would any of you be able to lend a hand here?

---

<div class="post-metadata">

**Author:** ![MichaelC](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/michaelc/32/9055_2.png) [@MichaelC](https://community.hubspot.com/u/MichaelC)\
**Post date:** [December 3, 2020, 9:02pm UTC](https://community.hubspot.com/t/cannot-replace-custom-parameters-from-single-send-email-api/28689/3 "2020-12-03T21:02:12Z")

</div>

Im not sure you are naming your custom property correctly, it might be a guess but at least we can do a lookup to confirm if it is or not.

Have you checked the property system name in the email?

Go to your email in the marketing tab \> open email in edit mode \> click settings \> scroll down to plain text and web version \> click “customize” button. The name within the brackets {{ }} is the official system name for your property.

Thats my primary guess for now anyway - hope it helps!

 ![35011i82E0C0365BF9B099.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/0/5009998fe3309b611605877feb15f3d8a980c6f3.png)

---

<div class="post-metadata">

**Author:** ![dcornelljames](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dcornelljames/32/76793_2.png) [@dcornelljames](https://community.hubspot.com/u/dcornelljames)\
**Post date:** [December 4, 2020, 4:57am UTC](https://community.hubspot.com/t/cannot-replace-custom-parameters-from-single-send-email-api/28689/4 "2020-12-04T04:57:54Z")

</div>

My template is one of the defaults with my custom parameter inline. This is what the text of the email is using the instructions you have mentioned:  
---------

Hello {{contact.firstname}},

Plain text emails have minimal formatting so your reader can really focus on what you have to say. Introduce yourself and explain why you’re reaching out.

{{contact.category\_total}}

Every email should try to lead the reader to some kind of action. Use this space to describe why the reader should want to click on the link below. Put the link on its own line to really draw their eye to it.

Link text

Now it’s time to wrap up your email. Before your signature, thank the recipient for reading. You can also invite them to send this email to any of their colleagues who might be interested.

All the best,

Your full name

Your job title

--------

You will see the custom parameter “contact.category\_total” in the middle. You will also see the standard parameter “contact.firstname” at the top. When I run with the below JSON, the contact.firstname gets populated with Bubba, but the custom parameter does not.

{

“emailId”:38143921416,

“message”:{

“[to":"dcornelljames@gmail.com](mailto:to%22:%22dcornelljames@gmail.com)”

},

“contactProperties”:

{

“firstName”:“Bubba”

}

,

“customProperties”:

{

“contact.category\_total”:“4071434”

}

}

This is a screen grab of the resulting email:  
 ![]()

I have tried  
“contact.category\_total”:“9999999”

“contact.category\_total”:9999999

“category\_total”:“9999999”

“category\_total”:9999999

None seem to work.

---

<div class="post-metadata">

**Author:** ![MichaelC](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/michaelc/32/9055_2.png) [@MichaelC](https://community.hubspot.com/u/MichaelC)\
**Post date:** [December 4, 2020, 5:42am UTC](https://community.hubspot.com/t/cannot-replace-custom-parameters-from-single-send-email-api/28689/5 "2020-12-04T05:42:29Z")

</div>

Try to move it to contact properties instead of custom properties area of your code. It looks as if it is a self made contact property. Worth a try.  
“contactProperties”:  
{  
“firstName”:“Bubba”,  
“contact.category\_total”:“4071434”  
//Try the different versions of the property names here  
}

---

<div class="post-metadata">

**Author:** ![dcornelljames](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dcornelljames/32/76793_2.png) [@dcornelljames](https://community.hubspot.com/u/dcornelljames)\
**Post date:** [December 4, 2020, 4:54pm UTC](https://community.hubspot.com/t/cannot-replace-custom-parameters-from-single-send-email-api/28689/6 "2020-12-04T16:54:25Z")

</div>

That was it. So I guess there is a difference between a “custom property” and a “self made property” as you call it? Somewhat confusing but it gets me over this hurdle. Thanks!

---

<div class="post-metadata">

**Author:** ![MichaelC](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/michaelc/32/9055_2.png) [@MichaelC](https://community.hubspot.com/u/MichaelC)\
**Post date:** [December 5, 2020, 6:31am UTC](https://community.hubspot.com/t/cannot-replace-custom-parameters-from-single-send-email-api/28689/7 "2020-12-05T06:31:52Z")

</div>

Well I agree that this was confusing and missleading. Maybe @dennisedson can forward the information to someone in charge of API documentation to cleary things for future matter in the documentation. Happy the problem got solved - have a nice weekend @dcornelljames

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [December 7, 2020, 3:55pm UTC](https://community.hubspot.com/t/cannot-replace-custom-parameters-from-single-send-email-api/28689/8 "2020-12-07T15:55:31Z")

</div>

Thanks @MichaelC , I alerted the team 😃
