Greetings.
As mentioned in your post regarding the Engagements API, the Engagements API should still accept empty values for the hs_owner_id field. However, I’m getting the following error when trying to do so:
SDK Code:
$result = $client->engagements()->create($engagement, $associations, $metadata);
Endpoint:
https://api.hubapi.com/engagements/v1/engagements
Payload
{
"json": {
"engagement": {
"active": true,
"type": "NOTE",
"ownerId": null,
"timestamp": 1658247956000
},
"associations": {
"contactIds": [
123
]
},
"metadata": {
"body": "...."
},
"attachments": []
}
}
Error Message:
{
"validationResults": [
{
"isValid": false,
"message": "0 was not a valid owner ID",
"error": "INVALID_OWNER_ID"
}
]
}
However, I do not encounter this issue when using different engagement types such as MEETING and CALL.
Hey, @deandamasig
Thanks for reaching out! I am going to try to reproduce the issue on my end. Once I reproduce, I’ll get it onto my internal resources.
Thank you! — Jaycee
Hi @Jaycee_Lewis. Where you able to reproduce the issue?
Hey, @deandamasig. I get the same validation error using
"null"
as well as omitting it completely. I have a request out to my internal resources to either get the correct formatting or to update the documentation.
I’ll follow up here as soon as I know more.
Thanks again! — Jaycee
Hey, @deandamasig
Quick follow-up. I had time to test again today and received a successful response. Here are my request body and the response:
-
Request body
{
"engagement": {
"active": true,
"type": "NOTE",
"timestamp": 1658247956000
},
"associations": {
"contactIds": [
301
]
},
"metadata": {
"body": "...."
}
}
-
Response — 200 OK
"associationCreateFailures": [],
"engagement": {
"id": 23960621691,
"portalId": 22245342,
"active": true,
"createdAt": 1658855734601,
"lastUpdated": 1658855734601,
"type": "NOTE",
"timestamp": 1658247956000,
"allAccessibleTeamIds": [],
"bodyPreview": "....",
"queueMembershipIds": [],
"bodyPreviewIsTruncated": false,
"bodyPreviewHtml": "<html>\n <head></head>\n <body>\n ....\n </body>\n</html>"
},
"associations": {
"contactIds": [
301
],
"companyIds": [],
"dealIds": [],
"ownerIds": [],
"workflowIds": [],
"ticketIds": [],
"contentIds": [],
"quoteIds": []
},
"attachments": [],
"metadata": {
"body": "...."
}
}
Intend of using “null” which the system interprets as “0” (zero) I just removed ownerId completely as a property in the body.
I hope this helps get you moving forward 
Have fun coding! — Jaycee