# Webhook API creating a subscription

**URL:** <https://community.hubspot.com/t/webhook-api-creating-a-subscription/61523>\
**Category:** APIs & Integrations\
**Tags:** webhooks\
**Created:** [July 22, 2022, 11:39am UTC](https://community.hubspot.com/t/webhook-api-creating-a-subscription/61523 "2022-07-22T11:39:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jkroonen](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@Jkroonen](https://community.hubspot.com/u/Jkroonen)\
**Post date:** [July 22, 2022, 11:39am UTC](https://community.hubspot.com/t/webhook-api-creating-a-subscription/61523/1 "2022-07-22T11:39:48Z")

</div>

Hi,

We want to make use of the Webhook API of HubSpt. So we make use of the [HubSpot PHP API client](https://github.com/HubSpot/hubspot-php). I wrote a service class in our Laravel project to interact with the client.

We make use of OAuth 2.0 implementation. Any endpoint works as expected, except for “/webhook” endpoints. Below is the problem.

When I try to make the following HTTP request:

`POST https://api.hubapi.com/webhooks/v3/APP_ID/subscriptions- headers: { "Accept": "application/json", "Content-Type": "application/json", "Authorization": "Bearer ACCESS_TOKEN"}- body: { "event_type": "ticket.propertyChange", "property_name": "status", "active": true}`

The HubSpot respond with the following:

`HTTP 401 Unauthorized- body: { "status": "error", "message": "Authentication credentials not found. This API supports both API Key and OAuth 2.0 authentication and you can find more details at https://developers.hubspot.com/docs/methods/auth/oauth-overview", "correlationId": "8cf5ae15-0824-4941-b533-5c30d5c5aaa4", "category": "INVALID_AUTHENTICATION"}`

Has anyone run into the same problem and how did you solve it? Or am I doing something wrong?

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![Jkroonen](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@Jkroonen](https://community.hubspot.com/u/Jkroonen)\
**Post date:** [July 22, 2022, 1:53pm UTC](https://community.hubspot.com/t/webhook-api-creating-a-subscription/61523/2 "2022-07-22T13:53:18Z")

</div>

I’ve read the documentation again and some other threats, and now it works. I solved the problem by generating a “HubSpot Developer Key”. This must be used as “API Key”.

Now I getting the following response:

`HTTP 400 Bad Request- body: { ... "message": "Failed to handle unknown subscription type `ticket.propertyChange`. Please contact support."}`

Anyone encountered a similar issue?

---

<div class="post-metadata">

**Author:** ![Willson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/willson/32/84663_2.png) [@Willson](https://community.hubspot.com/u/Willson)\
**Post date:** [July 25, 2022, 2:14pm UTC](https://community.hubspot.com/t/webhook-api-creating-a-subscription/61523/3 "2022-07-25T14:14:05Z")

</div>

Hey @Jkroonen ,

You’re getting this response as the ‘ticket.propertyChange’ isn’t quite ready for release yet. This is a work in progress and our docs were a step ahead, apologies for the confusion.

We’re updating the docs and will roll this out as soon as it’s ready.

Thanks

---

<div class="post-metadata">

**Author:** ![caio-pizzol](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/caio-pizzol/32/33348_2.png) [@caio-pizzol](https://community.hubspot.com/u/caio-pizzol)\
**Post date:** [December 15, 2022, 6:57pm UTC](https://community.hubspot.com/t/webhook-api-creating-a-subscription/61523/4 "2022-12-15T18:57:42Z")

</div>

Hey everyone and HubSpot team @Willson ,

Apparently Webhooks endpoint only accepts API Keys but at the same time - [API Keys have been deprecated from HubSpot last Nov 30th 2022](https://developers.hubspot.com/docs/api/intro-to-auth)  
How should we proceed in this case? I tried authenticating with both OAuth and Private Apps access tokens but the only response I receive back is _ **401 Unauthorized** _

Any help here?

---

<div class="post-metadata">

**Author:** ![Willson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/willson/32/84663_2.png) [@Willson](https://community.hubspot.com/u/Willson)\
**Post date:** [December 16, 2022, 10:23am UTC](https://community.hubspot.com/t/webhook-api-creating-a-subscription/61523/5 "2022-12-16T10:23:21Z")

</div>

Hey @caio-pizzol ,

Our Webhooks APIs all work to create the config via a Developer App, not a standard HubSpot Account where the Hapikey is used.

As such, requests must be authenticated using a Developer API Key which is separate to the Hapikey functionality that we have deprecated. Please see here for more information:

> **[HubSpot Developer Documentation - HubSpot docs](https://developers.hubspot.com/docs)**

Thanks!

---

<div class="post-metadata">

**Author:** ![caio-pizzol](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/caio-pizzol/32/33348_2.png) [@caio-pizzol](https://community.hubspot.com/u/caio-pizzol)\
**Post date:** [December 16, 2022, 12:58pm UTC](https://community.hubspot.com/t/webhook-api-creating-a-subscription/61523/6 "2022-12-16T12:58:30Z")

</div>

Thanks for the quick reply @Willson

I wasn’t aware about Developer API Keys, thanks for the heads up.

It worked perfectly.

Cheers,

Caio
