# Custom Webhook

thatthatSuppose users want to create a webhook for custom use cases, like they want a pipeline or release to be triggered based on the options that they desire so what they can do is they can create a **Generic webhook**. This only requires a **POST** request to be sent on the URL provided and then the pipeline or release will be triggered.\
\
**Steps to create a Generic Webhook for release**

**Pre-requisites:**

* An Active cluster
* A Release that has been created from the Release Templates section

**Steps**

1. On click of the **create webhook** button, a modal window appears in which we can enter the details for webhook creation

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FPUTDn5cl7TMwY8CCqYgI%2Fimage-20240418-130634.png?alt=media&#x26;token=91ee8c5b-6246-44d6-8067-32549b8e1dd0" alt=""><figcaption></figcaption></figure>

2. After this select the webhook type as **Generic**

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FQU5TDWOAlR2IGgwvndQI%2Fimage-20240418-130707.png?alt=media&#x26;token=e40167be-f320-4d7f-9581-ead435d31383" alt=""><figcaption></figcaption></figure>

3. After this select the release type as the **release**

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2F5hiGqe6S697TFZ0w1u6H%2Fimage-20240418-130923.png?alt=media&#x26;token=7d098e3c-28d2-401e-9892-3c0a5c6dd342" alt=""><figcaption></figcaption></figure>

4\. After the trigger type **release** has been selected, select the release which needs to be triggered on the success of the POST request

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2Fryz24ZaRtdj3mLk9CNZH%2Fimage-20240418-131459.png?alt=media&#x26;token=2dc72e8a-d9df-44c2-8eb3-6452b2927969" alt=""><figcaption></figcaption></figure>

5. Once all the options are selected, the map parameters button will be enabled users can click on the button to move to the next step

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FfPY4LUos01CeL7cI9GvW%2Fimage-20240418-133716.png?alt=media&#x26;token=2bd9d575-9187-4f00-ab0d-d11cd6d437f3" alt=""><figcaption></figcaption></figure>

6. On moving to the next step, users can select the desired options for mapping the parameters. Once all the options are chosen users can click on save to create the **Generic webhook.**

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2F5rtUF6J7CbHrEJHKLpvZ%2Fimage-20240418-134325.png?alt=media&#x26;token=acbb3c29-faf9-40c8-8e49-5109e8f4a608" alt=""><figcaption></figcaption></figure>

7. The webhook once created will be shown in the webhook list view

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2F5xoBb5D3oX21TfZQy5b1%2Fimage-20240418-135022.png?alt=media&#x26;token=45c094a2-e389-4662-9a45-546c1ccf88ad" alt=""><figcaption></figcaption></figure>

8. To get the URL of the generic webhook that is created, click on the edit button of the webhook

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FBU8IWb66OxvqQvJRiWC4%2Fimage-20240418-141903.png?alt=media&#x26;token=61a5d756-881e-4395-bbf9-55d17130ec50" alt=""><figcaption></figcaption></figure>

Now we can use this URL for sending POST requests, after completion of any action we can send a POST request to this URL and the selected Release will be triggered.

### **Steps to create Generic Webhook for pipeline** <a href="#steps-to-create-generic-webhook-for-pipeline" id="steps-to-create-generic-webhook-for-pipeline"></a>

**Pre-requisites:**

* An Active cluster
* A microservice

Follow the same steps until **Step 2** of Creating Webhooks for release<br>

**Steps:**

1. Select the trigger type as pipeline

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FlgCfmfkWcFqDaNS217WM%2Fimage-20240418-143615.png?alt=media&#x26;token=34ba3e43-0cdc-4c04-bdfa-86917759606f" alt=""><figcaption></figcaption></figure>

2. Now select the pipeline that needs to be triggered

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FtrfpxDOq09m98jIKoahZ%2Fimage-20240418-143649.png?alt=media&#x26;token=95588d9f-c62c-471e-b275-030c36c6d136" alt=""><figcaption></figcaption></figure>

\
3\. After selecting the pipeline, select the environment in which the webhook needs to be created

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FFRRA5OHPlMY02KtLoWsi%2Fimage-20240419-041615.png?alt=media&#x26;token=e4b8efaa-32c4-452f-8f86-ca8b8980b559" alt=""><figcaption></figcaption></figure>

**Remember to select the environment the same in which the cluster has been created**\
\
**4.** After selecting the environment, users will be shown an option to select the cluster<br>

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FBvIa2kLFxEaXeO2SFgki%2Fimage-20240419-041636.png?alt=media&#x26;token=78d6ceae-a33c-488c-9237-8c2f41fa8275" alt=""><figcaption></figcaption></figure>

5. Once the cluster has been selected, select the microservice

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FB5VqjdfHIeQn1Y79iyC3%2Fimage-20240419-041713.png?alt=media&#x26;token=2f71f08a-8da9-4947-9429-0caf72ec20ff" alt=""><figcaption></figcaption></figure>

6. After selecting the microservice, users can move to the **Map parameters** step, to select the run parameters for the pipeline

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FlPZyZtYdjUJvAyrYYZcx%2Fimage-20240419-041758.png?alt=media&#x26;token=45e65e0c-d9f5-4e37-b5c5-dc7ccd1d9315" alt=""><figcaption></figcaption></figure>

7. In **Map parameters,** users can select all the options as they desire

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FWYy6Zet2lR3qiXhNpPKJ%2Fimage-20240419-041822.png?alt=media&#x26;token=7dfb27cc-2073-438b-a64d-ae0966694fa9" alt=""><figcaption></figcaption></figure>

8. Once all this is done, users can click on the **Save** button to create the webhook for the pipeline

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FgmXioMLlYx5W8mjE8yZG%2Fimage-20240419-041859.png?alt=media&#x26;token=40e2d3af-d3cc-4bb8-9ab6-cca0c42f72a2" alt=""><figcaption></figcaption></figure>

9. The created webhook will be shown in the webhook list view

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2Fb4jWGZK8dev6lD9zFzD4%2Fimage-20240419-041940.png?alt=media&#x26;token=d8d1b62c-2fb6-41d0-ad06-3bd34aeb46e0" alt=""><figcaption></figcaption></figure>

10. To get the URL of the generic webhook that is created, click on the edit button of the webhook

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FlZTtdavXlAgzMgNtm1hk%2Fimage-20240419-042014.png?alt=media&#x26;token=5fe38df4-4e2f-472e-a852-8cea6fa33eb8" alt=""><figcaption></figcaption></figure>

Now we can use this URL for sending POST requests, after completion of any action we can send a POST request to this URL and the selected Release will be triggered.<br>

This is how webhooks are created for Generic use cases, where we can just send a POST request to the URL and the desired pipeline/release will be triggered.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ozone.one/ozone-end-user-guide/documentation/ci-cd/triggers/triggering-a-pipeline-and-or-a-release-run/custom-webhook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
