> For the complete documentation index, see [llms.txt](https://docs.groundcover.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groundcover.com/automate/connected-apps/generic-webhook.md).

# Generic Webhook

{% hint style="info" %}
This capability is only available to BYOC deployments. Check out our [pricing page](https://www.groundcover.com/pricing) for more information about subscription plans and the available deployment modes.
{% endhint %}

## Configuring Webhook Integration in groundcover

1. In groundcover, go to **Integrations → Destinations**.
2. Click on Webhook Integration<br>

   <figure><img src="https://2771001740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUHgqKYgCiRKdOpWQdi52%2Fuploads%2FDn5FReatuIThAqx0BjWG%2Fimage.png?alt=media&amp;token=5be66059-5ff6-4b71-8136-9b235925402a" alt="" width="311"><figcaption></figcaption></figure>
3. Fill in a Webhook name
4. Fill Webhook details
   1. Select an HTTP method: `GET` / `POST` / `PUT` / `DELETE`
   2. Enter your URL
   3. Optional: Add Authentication headers, you can either add `basic auth` user and password, or an `API Key`. (Can't do both)
   4. Optional: Add custom headers, by adding key and value pairs
   5. Optional: Add a custom payload
      1. Note that the payload should be a JSON format, but can be used with Jinja2 formatting in order to render different payloads for different if/else conditions, see example below.

<figure><img src="https://2771001740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUHgqKYgCiRKdOpWQdi52%2Fuploads%2FZYCgun951s7DiQZbR5NI%2Fimage.png?alt=media&amp;token=d28a5f18-798f-4ccd-ae5f-968d33f33d04" alt="" width="375"><figcaption></figcaption></figure>

5. Optional: Test the connection-
   1. This will send a notification similar to the notification that will be send by monitors with `[TEST] Notification from groundcover` in the title to differentiate from 'real' notifications.
6. Save.

### Webhook Custom Payload Examples

#### Concatenating multiple variables into a single string

```
{
  "channel_name": "{{labels.cluster}} - {{labels.workload}}"
}
```

For an issue with '`cluster:prod`' and '`workload:sensor`', the above will be translated into: `"channel_name": "prod - sensor"`

#### Using if/else conditions for custom payloads:

Use jinja2 formatting in order to define the conditions to meet and the content to send

```
{% if labels.env == 'ga' %}
    {
        "title": "{{summary}}",
        "description": "{{description}}",
        "comment": "this is the GA env",
        "env": "{{labels.env}}"
    }
{% elif labels.env == 'beta' %}
    {
        "title": "{{summary}}",
        "description": "{{description}}",
        "comment": "this is the beta env",
        "env": "{{labels.env}}"
    }
{% endif %}
```

Or alternatively just use the conditions for part of the json:

```
{
  "key1":"value",
  "key2":"value",
  {% if labels.x == 'x' %}
    "key3": 'x',
  {% elif labels.y == 'y' %}
    "key3": 'bla',
  {% endif %}
  "key4":"value"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.groundcover.com/automate/connected-apps/generic-webhook.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
