The Webhooks API can only be accessed using your Developer API key — “Webhooks are set up for a HubSpot app, not individual accounts.”
You can set up and manage Webhooks via a Private App, but it must be done in-app – “You can also manage webhooks in a private app. In private apps, webhook settings can only be edited in the in-app settings for your private app, and cannot currently be edited through the API.”. Otherwise, if you try to use your Private App token using the Webhooks API, you'll get an error (as you noted)
If you have a Public App (using OAuth) you can use the Developer API key and The Webhooks API to setup and manage your webhook subscriptions. If you are using a Private App, it must be done in-app.
Yes, it is possible to update the webhook URL or hit the specified endpoints using an access token for private apps in HubSpot. HubSpot is deprecating API keys in favor of OAuth access tokens, you should be able to perform these actions with an access token.
Here is a step-by-step guide on how to achieve this:
1. Obtain the Access Token
First, ensure you have the access token for your private app:
Navigate to your HubSpot account.
Go to Settings > Integrations > Private Apps.
Create a new private app and ensure you have the appropriate scopes (permissions) for managing webhooks.
Copy the access token provided.
2. Update Webhook Settings Using Access Token
You can use the access token to authenticate your requests to the HubSpot API. Here is an example using the curl command to update webhook settings.
Update Subscription Endpoint
To update webhook subscriptions, you can use the following curl command:
Replace YOUR_ACCESS_TOKEN with your actual access token, {appId} with your app ID, and https://your-new-webhook-url.com with your new webhook URL. You can also adjust maxConcurrentRequests as needed.
Example Using a Programming Language
If you prefer using a programming language like Python, here is an example using the requests library:
Make sure your private app has the necessary scopes to manage webhooks. Using the Authorization: Bearer YOUR_ACCESS_TOKEN header in your requests will authenticate them correctly.
If you encounter any issues, double-check your access token and permissions, and ensure your requests are correctly formatted.
Good luck and please give me a shout if I can help with anything.
May 21, 20249:45 AM - edited May 21, 20249:46 AM
Member
Webhook through accesstoken for private apps
SOLVE
i tried hitting the curls you provided and i got this as response, and could you please share the scopes that are required to hit these.
{
"status": "error",
"message": "The scope needed for this API call isn't available for public use. If you have questions, contact support or post in our developer forum.",
Hii James, Thanks for the time and assistance. You provided the curl to hit it with api key, but i need it to hit through ACCESS TOKEN,Thats my actual requirement. You again provided the curl which i have already tried and got the response using api key.
The Webhooks API can only be accessed using your Developer API key — “Webhooks are set up for a HubSpot app, not individual accounts.”
You can set up and manage Webhooks via a Private App, but it must be done in-app – “You can also manage webhooks in a private app. In private apps, webhook settings can only be edited in the in-app settings for your private app, and cannot currently be edited through the API.”. Otherwise, if you try to use your Private App token using the Webhooks API, you'll get an error (as you noted)
If you have a Public App (using OAuth) you can use the Developer API key and The Webhooks API to setup and manage your webhook subscriptions. If you are using a Private App, it must be done in-app.