Cannot update properties with blank values on batch upsert request

Hi everyone,
I have been trying to nullify properties of custom objects via batch upsert request. I have tried this with a basic update request and this works as expected. However, when I have tried this with a batch upsert request the property is not successfully updated.
Here is an example of a basic update request succesffully updating the property:
Request:

curl --request PATCH \

--url https://api.hubapi.com/crm/v3/objects/2-31908300/14507441252 \

--header ‘authorization: Bearer YOUR_ACCESS_TOKEN’ \

--header ‘content-type: application/json’ \

--data '{

“properties”: {

"deleted\_at": ""

}

}’

Response:

HTTP 200

{

“id”: “14507441252”,

“properties”: {

"deleted\_at": "",

"hs\_createdate": "2024-08-13T09:47:36.607Z",

"hs\_lastmodifieddate": "2024-08-13T09:50:57.681Z",

"hs\_object\_id": "14507441252",

"hs\_object\_source": "INTEGRATION",

"hs\_object\_source\_id": "3559509",

"hs\_object\_source\_label": "INTEGRATION"

},

“createdAt”: “2024-08-13T09:47:36.607Z”,

“updatedAt”: “2024-08-13T09:50:57.681Z”,

“archived”: false

}

And here is an example of a batch update request unsuccessfully updating the property:
Request:

curl --request POST \

--url https://api.hubapi.com/crm/v3/objects/2-31908300/batch/upsert \

--header ‘authorization: Bearer YOUR_ACCESS_TOKEN’ \

--header ‘content-type: application/json’ \

--data '{

“inputs”: [

{

  "idProperty": "uuid",

  "id": "b755045b-ae0e-4ccb-a972-8cc5740f2bcc",

  "properties": {

    "delted\_at": ""

  }

}

]

}’

Response:

HTTP 200

{

“status”: “COMPLETE”,

“results”: [

{

  "id": "14507441243",

  "properties": {

    "hs\_createdate": "2024-08-13T09:47:36.607Z",

    "hs\_lastmodifieddate": "2024-08-13T09:47:37.347Z",

    "hs\_object\_id": "14507441243",

    "hs\_object\_source": "INTEGRATION",

    "hs\_object\_source\_id": "3559509",

    "hs\_object\_source\_label": "INTEGRATION"

  },

  "createdAt": "2024-08-13T09:47:36.607Z",

  "updatedAt": "2024-08-13T09:47:37.347Z",

  "archived": false

}

],

“startedAt”: “2024-08-13T09:52:49.284Z”,

“completedAt”: “2024-08-13T09:52:49.412Z”

}

As you can see, this fails to update the property, which I have checked on the website.
How can I nullify blank properties via a batch upsert request?
Thanks


@almrdog wrote:

Hi everyone,
I have been trying to nullify properties of custom objects via batch upsert request. I have tried this with a basic update request and this works as expected. However, when I have tried this with a batch upsert request the property is not successfully updated.
Here is an example of a basic update request succesffully updating the property:
Request:

curl --request PATCH \

--url https://api.hubapi.com/crm/v3/objects/2-31908300/14507441252 \

--header ‘authorization: Bearer YOUR_ACCESS_TOKEN’ \

--header ‘content-type: application/json’ \

--data '{

“properties”: {

"deleted\_at": ""

}

}’

Response:

HTTP 200

{

“id”: “14507441252”,

“properties”: {

"deleted\_at": "",







"hs\_createdate": "2024-08-13T09:47:36.607Z",







"hs\_lastmodifieddate": "2024-08-13T09:50:57.681Z",







"hs\_object\_id": "14507441252",







"hs\_object\_source": "INTEGRATION",







"hs\_object\_source\_id": "3559509",







"hs\_object\_source\_label": "INTEGRATION"

},

“createdAt”: “2024-08-13T09:47:36.607Z”,

“updatedAt”: “2024-08-13T09:50:57.681Z”,

“archived”: false

}

And here is an example of a batch update request unsuccessfully updating the property:
Request:

curl --request POST \

--url https://api.hubapi.com/crm/v3/objects/2-31908300/batch/upsert \

--header ‘authorization: Bearer YOUR_ACCESS_TOKEN’ \

--header ‘content-type: application/json’ \

--data '{

“inputs”: [

{







  "idProperty": "uuid",







  "id": "b755045b-ae0e-4ccb-a972-8cc5740f2bcc",







  "properties": {







    "delted\_at": ""







  }







}

]

}’

Response:

HTTP 200

{

“status”: “COMPLETE”,

“results”: [

{







  "id": "14507441243",







  "properties": {







    "hs\_createdate": "2024-08-13T09:47:36.607Z",







    "hs\_lastmodifieddate": "2024-08-13T09:47:37.347Z",







    "hs\_object\_id": "14507441243",







    "hs\_object\_source": "INTEGRATION",







    "hs\_object\_source\_id": "3559509",







    "hs\_object\_source\_label": "INTEGRATION"







  },







  "createdAt": "2024-08-13T09:47:36.607Z",







  "updatedAt": "2024-08-13T09:47:37.347Z",







  "archived": false







}

],

“startedAt”: “2024-08-13T09:52:49.284Z”,

“completedAt”: “2024-08-13T09:52:49.412Z”

}

As you can see, this fails to update the property, which I have checked on the website.
How can I nullify blank properties via a batch upsert request?
Thanks


First, make sure that the property name is correct; a typo like “delted_at” instead of “deleted_at” could cause the update to fail. Additionally, rather than using an empty string (“”) to nullify the property, try setting the property to null in your batch request. This approach might better communicate to the API that you intend to clear the property’s value.

Hi HMir, did you receive my initial reply to your comment? I fixed the typo but the value still fails to be overwritten with a blank value…

Thanks for spotting the typo. However with this change and also changing the value to null, it still fails to clear the value as you can see in this new api request:

Request:

curl --request POST \

--url https://api.hubapi.com/crm/v3/objects/2-31908300/batch/upsert \

--header ‘authorization: Bearer YOUR_ACCESS_TOKEN’ \

--header ‘content-type: application/json’ \

--data '{

“inputs”: [

{

“idProperty”: “uuid”,

“id”: “b755045b-ae0e-4ccb-a972-8cc5740f2bcc”,

“properties”: {

“deleted_at”: null

}

}

]

}’

Response:

HTTP 200

{

“status”: “COMPLETE”,

“results”: [

{

“id”: “14507441243”,

“properties”: {

“deleted_at”: “2024-08-08T15:55:21Z”,

“hs_createdate”: “2024-08-13T09:47:36.607Z”,

“hs_lastmodifieddate”: “2024-08-13T09:47:37.347Z”,

“hs_object_id”: “14507441243”,

“hs_object_source”: “INTEGRATION”,

“hs_object_source_id”: “3559509”,

“hs_object_source_label”: “INTEGRATION”

},

“createdAt”: “2024-08-13T09:47:36.607Z”,

“updatedAt”: “2024-08-13T09:47:37.347Z”,

“archived”: false

}

],

“startedAt”: “2024-08-14T08:27:18.496Z”,

“completedAt”: “2024-08-14T08:27:18.561Z”

}