> ## Documentation Index
> Fetch the complete documentation index at: https://docs.honeycomb.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples: Webhook Templates

> Copy and adapt example webhook payload templates for Discord, OpsGenie, and incident.io to customize how Honeycomb alert data is delivered to your tools.

Use the example templates below as inspiration when creating custom webhooks.

## Discord Payload Template

To learn more, visit [Discord's Developer Documentation](https://discord.com/developers/docs/resources/webhook#execute-webhook).

### Discord Template Example

```go-template theme={}
{
  "username": "Honeycomb Triggers",
  "avatar_url": "https://i.imgur.com/4M34hi2.png",
  "embeds": [
    {
      "title": ":bee: {{ .Alert.Summary }}",
      "url": "{{ .Resource.URL}}",
      "description": "{{ .Description }}",
      "color": {{ if eq .Alert.Status "TRIGGERED"}}1127128{{ else }}14177041{{ end }},
    "fields": [
      {
        "name": "Status",
        "value": "{{ .Alert.Status }}",
        "inline": true
      }
    ]
    }
  ]
}
```

## Incident.io Payload Template

To learn more, visit [Incident.io Documentation](https://api-docs.incident.io/tag/Alert-Events-V2).

### Incident.io Template Example

```go-template theme={}
{

  "deduplication_key": "{{ .Alert.InstanceID }}",
  "description": "{{ .Description }}",
  "metadata": {
    "team": "my-team",
    "result_url": "{{ .Result.URL }}"
  },
  "source_url": "{{ .URL }}",
  "status": "{{ if eq .Alert.Status "TRIGGERED"}}firing{{ else }}resolved{{ end }}",
  "title": "[{{ .Environment }}] {{ .Name }}"
}
```

## OpsGenie Payload Template

<Info>
  OpsGenie requires that an "Authorization" header be included with the value of the header in the format: `GenieKey YOUR-APIKEY`
</Info>

To learn more, visit [OpsGenie Documentation](https://docs.opsgenie.com/docs/alert-api#create-alert).

### OpsGenie Template Example

```go-template theme={}
{
  "message": "{{ .Alert.Summary }}",
  "alias": "{{ .Alert.InstanceID }}",
  "description": "{{ .Alert.Description }}",
  "note": "{{ .Description }}",
  "source": "{{ .URL }}",
  "details": {
    "env": "{{ .Environment }}",
    "team": "my-team",
    "result_url": "{{ .Result.URL }}"
  }
}
```

## Grouped Trigger Payload Template

Triggers with an alert type of `"on_group_change"` report which groups changed during an evaluation, instead of listing every group currently over the threshold.
Use `.Result.NewlyTriggeredGroups` and `.Result.RecoveredGroups` to send a payload that names only what changed.
To learn more, visit [Custom Webhook Variables](/notify/webhooks/variables#variables-for-triggers).

This example is not specific to any destination, and shows two ways to include group data.
The `newly_triggered` field passes the groups through as-is with `toJson`, while the `recovered` field loops over each group to build a readable label from its key and value pairs.

### Grouped Trigger Template Example

```go-template theme={}
{
  "title": "[{{ .Environment }}] {{ .Name }}",
  "status": "{{ if eq .Alert.Status "TRIGGERED" }}firing{{ else }}resolved{{ end }}",
  "source_url": "{{ .URL }}",
  "result_url": "{{ .Result.URL }}",
  "newly_triggered": {{ toJson .Result.NewlyTriggeredGroups }},
  "recovered": [
    {{ range $i, $group := .Result.RecoveredGroups }}{{ if $i }},{{ end }}{
      "group": "{{ range $j, $pair := $group.Group }}{{ if $j }}, {{ end }}{{ $pair.Key }}={{ $pair.Value }}{{ end }}",
      "value": {{ $group.Result }}
    }{{ end }}
  ]
}
```

<Note>
  When looping over a list to build JSON, use `{{ if $i }},{{ end }}` to separate entries.
  This places a comma before every entry except the first, which keeps the payload valid when the list is empty or contains a single group.
</Note>
