Hi,
I’m having some issues understanding the engagement api.
Here’s what I’m doing with the results of each call:
I start from this situation, the filter has only CALLS selected:
I then POST a request to create a new CALL engagement:
curl -X 'POST' -H 'Content-Type: application/json' "https://api.hubapi.com/engagements/v1/engagements?hapikey=${APIKEY}" --data '{
"engagement": {
"type": "CALL"
},
"associations": {
"contactIds": [
51
],
"ownerIds": [
1
]
},
"metadata": {
"toNumber": "+35310000000",
"fromNumber": "+353123456789",
"status": "IN_PROGRESS"
}
}'
{
"associationCreateFailures": [],
"engagement": {
"id": 10141331606,
"portalId": 8642268,
"active": true,
"createdAt": 1607615292658,
"lastUpdated": 1607615292658,
"type": "CALL",
"timestamp": 1607615292658,
"allAccessibleTeamIds": [],
"queueMembershipIds": [],
"gdprDeleted": false
},
"associations": {
"contactIds": [
51
],
"companyIds": [],
"dealIds": [],
"ownerIds": [
1
],
"workflowIds": [],
"ticketIds": [],
"contentIds": [],
"quoteIds": []
},
"attachments": [],
"metadata": {
"toNumber": "+35310000000",
"fromNumber": "+353123456789",
"status": "IN_PROGRESS"
}
}
I refresh the page and this is what I see (up to this point is all as expected):
After a few seconds I send a PATCH request:
curl -X 'PATCH' -H 'Content-Type: application/json' "https://api.hubapi.com/engagements/v1/engagements/10141331606?hapikey=${APIKEY}" --data '{
"metadata": {
"status": "COMPLETED",
"durationMilliseconds": "29000"
}
}'
{
"engagement": {
"id": 10141331606,
"portalId": 8642268,
"active": true,
"createdAt": 1607615292658,
"lastUpdated": 1607615332412,
"type": "CALL",
"timestamp": 1607615292658,
"allAccessibleTeamIds": [],
"queueMembershipIds": [],
"gdprDeleted": false
},
"associations": {
"contactIds": [],
"companyIds": [],
"dealIds": [],
"ownerIds": [
1
],
"workflowIds": [],
"ticketIds": [],
"contentIds": [],
"quoteIds": []
},
"attachments": [],
"metadata": {
"toNumber": "+35310000000",
"fromNumber": "+353123456789",
"status": "COMPLETED",
"durationMilliseconds": 29000
}
}
I then refresh the page again and here’s the problem:
It appears that the PATCH requests creates another call instead of updating the existing one.
Can someone help?
Thanks.





