# Invalid input JSON

**URL:** <https://community.hubspot.com/t/invalid-input-json/122639>\
**Category:** APIs & Integrations\
**Tags:** starter\
**Created:** [December 17, 2024, 11:54am UTC](https://community.hubspot.com/t/invalid-input-json/122639 "2024-12-17T11:54:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SSattary](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@SSattary](https://community.hubspot.com/u/SSattary)\
**Post date:** [December 17, 2024, 11:54am UTC](https://community.hubspot.com/t/invalid-input-json/122639/1 "2024-12-17T11:54:20Z")

</div>

Please could someone assist me?  
I definitely have the property setup in Hubspot with the internal name “min\_battery\_percentage”  
I definitely have the write permissions on my app authorisation code.  
Why am I still getting the following messages?

```lia-code-sample
data = {'min_battery_percentage': 17.0}

bearer_token = str("Bearer " + os.getenv("HUBSPOT_AUTH"))

payload = data
 json_payload = json.dumps(payload)
 headers = {
 'Authorization': bearer_token,
 'accept': "application/json",
 'content-type': "application/json"
 }
 # Make a GET request to the API
 response = requests.request("PATCH", url, headers=headers, data=json_payload)

```

`'{"status":"error","message":"Invalid input JSON on line 1, column 24: Unrecognized token \'min_battery_percentage\': was expecting (JSON String, Number, Array, Object or token \'null\', \'true\' or \'false\')","correlationId":"5dadc2ba-c921-4325-8c71-d10587de7136"}'`

Thanks in advance

---

<div class="post-metadata">

**Author:** ![evaldas](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/evaldas/32/69160_2.png) [@evaldas](https://community.hubspot.com/u/evaldas)\
**Post date:** [December 17, 2024, 2:53pm UTC](https://community.hubspot.com/t/invalid-input-json/122639/2 "2024-12-17T14:53:32Z")

</div>

Hi @SSattary,

HubSpot expects properties to be nested under “properties” in the payload.  
Instead of:

`data = {'min_battery_percentage': 17.0}`

Use:

```lia-code-sample
data = {
 'properties': {
 'min_battery_percentage': 17.0
 }
}

```

Depending on your property, you may also need to update the ‘17.0’ to be a string value:

```lia-code-sample
data = {
 'properties': {
 'min_battery_percentage': '17.0'
 }
}

```

Hope this helps!

---

<div class="post-metadata">

**Author:** ![SSattary](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@SSattary](https://community.hubspot.com/u/SSattary)\
**Post date:** [December 19, 2024, 10:21am UTC](https://community.hubspot.com/t/invalid-input-json/122639/3 "2024-12-19T10:21:37Z")

</div>

This definitely helped the situation as the Error message has changed, thank you. I’ve tried sending 17.0 as a float and string, but get the following error message.

`2024-12-19 10:11:51.293593 :: WARNING - Uploading to Hubspot failed: 200 - {"id":"44291661796","properties":{"createdate":"2024-10-07T17:46:55.792Z","hs_all_owner_ids":"973091571","hs_count_is_unworked":"0","hs_count_is_worked":"1","hs_created_by_user_id":"71829241","hs_is_unworked":"false","hs_object_id":"44291661796","hs_object_source":"CRM_UI","hs_object_source_id":"userId:71829241","hs_object_source_label":"CRM_UI","hs_object_source_user_id":"71829241","hs_pipeline":"contacts-lifecycle-pipeline","hs_time_to_first_engagement":"6275352795","hs_updated_by_user_id":"71829241","hs_user_ids_of_all_owners":"71829241","hubspot_owner_assigneddate":"2024-10-07T17:46:55.792Z","hubspot_owner_id":"973091571","lastmodifieddate":"2024-12-19T08:56:22.656Z","lifecyclestage":"lead","min_battery_percentage":"17.0","notes_last_updated":"2024-12-19T08:56:08.587Z"},"createdAt":"2024-10-07T17:46:55.792Z","updatedAt":"2024-12-19T08:56:22.656Z","archived":false}`

Any suggestions would be greatly appreciated. I’m Patching to

`https://api.hubapi.com/crm/v3/objects/contacts/<customer id number>`

---

<div class="post-metadata">

**Author:** ![SSattary](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@SSattary](https://community.hubspot.com/u/SSattary)\
**Post date:** [December 19, 2024, 2:13pm UTC](https://community.hubspot.com/t/invalid-input-json/122639/4 "2024-12-19T14:13:12Z")

</div>

Thank you this has definitely helped as the error message has changed. I’ve tried sending 17.0 as a float and string, but get the same message below. Any suggestions?  
I’m posting to:

`https://api.hubapi.com/crm/v3/objects/contacts/<customer_id>`

`2024-12-19 10:11:51.293593 :: WARNING - Uploading to Hubspot failed: 200 - {"id":"44291661796","properties":{"createdate":"2024-10-07T17:46:55.792Z","hs_all_owner_ids":"973091571","hs_count_is_unworked":"0","hs_count_is_worked":"1","hs_created_by_user_id":"71829241","hs_is_unworked":"false","hs_object_id":"44291661796","hs_object_source":"CRM_UI","hs_object_source_id":"userId:71829241","hs_object_source_label":"CRM_UI","hs_object_source_user_id":"71829241","hs_pipeline":"contacts-lifecycle-pipeline","hs_time_to_first_engagement":"6275352795","hs_updated_by_user_id":"71829241","hs_user_ids_of_all_owners":"71829241","hubspot_owner_assigneddate":"2024-10-07T17:46:55.792Z","hubspot_owner_id":"973091571","lastmodifieddate":"2024-12-19T08:56:22.656Z","lifecyclestage":"lead","min_battery_percentage":"17.0","notes_last_updated":"2024-12-19T08:56:08.587Z"},"createdAt":"2024-10-07T17:46:55.792Z","updatedAt":"2024-12-19T08:56:22.656Z","archived":false}`

Sorry if you’ve recieved this twice, I thought it posted, but can’t find it anywhere
