Event definitions cannot be deleted

With the API endpoint when you create a previously defined event definition that was deleted, we get this error: OBJECT_ALREADY_EXISTS even if the definition is not listed (either when looking at the web UI OR using the event definition query API).

I realised that the web UI append a _v2, _v3 and so on to the event definition names.

So how can it ever by possible to use the API to completely delete an event definition or verify if the name has already been taken in the past? This behaviour makes impossible to use the API in the context of stand alone applications!

Hi @MDrapeau

Please share the API endpoint that you are using and also share the screenshot of the error you are facing.

Thanks!

Very simple, just do those curl commands:

1) Create definition:

curl --request POST --url https://api.hubapi.com/events/v3/event-definitions --header ‘authorization: Bearer PRIVATE_APP_TOKEN’ --header ‘content-type: application/json’ --data ‘{“label”: “labela1”, “primaryObject”: “CONTACT”}’

2) Delete definition:

curl --request DELETE --url https://api.hubapi.com/events/v3/event-definitions/labela1 --header ‘authorization: Bearer PRIVATE_APP_TOKEN’

3) List definition, nothing returned:

curl --request GET \
--url https://api.hubapi.com/events/v3/event-definitions \
--header ‘authorization: Bearer PRIVATE_APP_TOKEN’

4) Repeat 1 to re-create the definition and you get this error:

{“status”:“error”,

“message”:“pe44007092_labela1 already exists”,

“correlationId”:“bf4755ce-9740-4411-a5ce-61c2a0a3892c”,

“context”:{“name”:[“pe44007092_labela1”]},

“category”:“OBJECT_ALREADY_EXISTS”,

“subCategory”: “InboundDbObjectTypeError.OBJECT_TYPE_ALREADY_EXIST”}