confluence Webhooks registration for non admin user
Asked by Ganga L:

How do we register for webhooks from a non admin user account. Is that feature available?

In our application, we are trying to read confluence pages and display it to user. So we are looking up for webhook based sync process to keep the data updated. But we see that the webhook registration is restricted to admin users. How do we go with non admin user sync in this case. Do you have any other alternative?


Answers:
author: Earl McCutcheon
body: Hi All,

[@Dario B](https://community.atlassian.com/t5/user/viewprofilepage/user-id/502402) just added a new workaround to the [CONFCLOUD-36613](https://jira.atlassian.com/browse/CONFCLOUD-36613) feature request that I am reposting below to make sure it gets extra visibility, hope this helps y'all out:

Workaround {#toc-hId--440185300}
--------------------------------

**WARNING!**  
There is one security concern regarding webhooks created using the way explained below: even though they can only be created by admins, there are no other permissions checks. If a regular user creates a restricted page, admins won't be able to access it via Confluence UI/API, but they will be able to receive webhooks related to this page. The information of course is very limited, but they will be able to see a title of a page, for example. We fixed this for regular webhooks a couple of years ago, but here it's not possible since there is no user to check permissions against.

There exists a private API that can be used for this purpose. However, **the endpoint discussed below is intended for internal use only** . Therefore, it is not part of the official [Confluence Cloud REST APIs,](https://developer.atlassian.com/cloud/confluence/rest/v2/intro/) **it is not supported and it can change without any notice**.

Once this has been said: you can register, list or delete Webhooks in Confluence Cloud by using the internal REST API endpoint /wiki/rest/webhooks/1.0/webhook.

The endpoint works the same way as the /rest/webhooks/1.0/webhook endpoint documented for Jira Cloud in the [Webhook documentation page, section: Registering a webhook using the Jira REST API (Other integrations)](https://developer.atlassian.com/cloud/jira/platform/webhooks/#registering-a-webhook-using-the-jira-rest-api--other-integrations-)

**To register a webhook using REST:**

1. Send a POST request using below format to: <https://your-domain.atlassian.net/wiki/rest/webhooks/1.0/webhook>  

   ```
   {  "name": "Webhook (test comment created)",  "url": "https://www.example.com/webhooks",  "events": [    "comment_created"  ]} 
   ```

<!-- -->

1. The response will return the webhook in JSON with additional information, including the user that created the webhook, the created timestamp, etc.

For a complete list of events, etc, please refer to the [Confluence Cloud Webhook documentation page](https://developer.atlassian.com/cloud/confluence/modules/webhook/).

**To unregister (that is, delete) a webhook using REST:**

* Execute a DELETE to the following URL: [https://your-domain.atlassian.net/wiki/rest/webhooks/1.0/webhook/\<Webhook-ID\>](https://your-domain.atlassian.net/wiki/rest/webhooks/1.0/webhook/)

Example:  
The following would delete the webhook with an ID of 70:  

```
curl --user EmailAddress:ApiToken -X DELETE -H "Content-Type: application/json" https://your-domain.atlassian.net/wiki/rest/webhooks/1.0/webhook/70
```

**To query a webhook using REST:**

* To get all webhooks (registered using this method) for a Confluence Cloud site, send a GET request to: <https://your-domain.atlassian.net/wiki/rest/webhooks/1.0/webhook>.

Example:  

```
curl --user EmailAddress:ApiToken -X GET -H "Content-Type: application/json" https://your-domain.atlassian.net/rest/webhooks/1.0/webhook
```

* To get a specific webhook by its ID, perform a GET with the following URL: [https://your-domain.atlassian.net/rest/webhooks/1.0/webhook/\<Webhook-ID\>](https://your-domain.atlassian.net/rest/webhooks/1.0/webhook/)

Example: the following would get a webhook with an ID of 72  

```
curl --user EmailAddress:ApiToken -X GET -H "Content-Type: application/json" https://your-domain.atlassian.net/rest/webhooks/1.0/webhook/72
```


author: Shannon S
body: Ganga,

It's not currently possible to register Webhooks with Confluence Cloud. Have a look at the feature requests below:

* [CONFCLOUD-36613](https://jira.atlassian.com/browse/CONFCLOUD-36613) *Allow Confluence Webhook Administration*
* [CONFCLOUD-55179](https://jira.atlassian.com/browse/CONFCLOUD-55179) *Webhooks for Confluence*

In the event that this is implemented, the ability to register webhooks is restricted to the admin user, so it's unlikely it will be implemented for non-admin users.

In the event that you're actually developing add-ons for use with Confluence Cloud, have a look at this development article on the ones that are available to use for development purposes:

* [Developer - Confluence Cloud Webhooks](https://developer.atlassian.com/cloud/confluence/modules/webhook/)

Let me know if you have any questions about this.

Regards,

Shannon


Tags: cloud

confluence-cloud

webhook