Can't create a webhook subscription via API



I’m trying to create a webhook subscription via the API.
But the following command fails and the error “Sorry, you are not authorized to access this app”, and I don’t understand why.

curl -H "Content-Type: application/json" -XPOST "<<my-oath-access-token>>" -d '{ "subscriptionDetails" : { "subscriptionType" : "company.propertyChange", "propertyName" : "name" }, "enabled" : true }'

I also tried using a dev hapikey, and got the error “Unable to deduce user-id from this request.”

curl -H "Content-Type: application/json" -XPOST "https://api.hubaons?hapikey=<<my-hapi-key>>&user_id=<<my-user-id>>" -d '{ "subscriptionDetails" : { "subscriptionType" : "company.propertyChange", "propertyName" : "name" }, "enabled" : true }'

(tried with userid, user_id, user-id and userId)

Am I missing something? Is a special oauth scope needed for this, that’s missing from the docs?


Hi @fonji

I’m seeing the same this with a test app. I’m passing this along to our platform team and I’ll reply here as soon as I have an update.


Hi @dadams

Thank you for your answer and letting me know!
At least we can still manage those in the UI, but it will be great to automate the process.


Hi @dadams,

Is there an update on this issue?


Hi @dadams
Any updates on this issue.?


This is being worked on now, it should be fixed soon. In the meantime, it should still be possible to create the webhook subscriptions through the Webhook Subscriptions tab inside the settings for your app.


Hi Everyone,

This should be fixed, and you should be able to use the Developer HAPIkey from your developer portal to create webhook subscriptions for apps in that portal.


Hi, @dadams
Thanks for the update, But managing webhook via API is not triggering the event.
When an event happens in the application that event is not fired via API integration.


@Veeresh_Digasangi what event type did you set the subscription for? Are you seeing anything in the logs for the webhook in your app, either success or failure?


I have set “contact.creation” event, It’s got validated properly and got 204 response. But the event is not fired at on time when a new contact is created.


@Veeresh_Digasangi can you message me directly with more details for this? I’d need a link to the app that has the webhook setup and the Hub ID of a portal that has that app installed.