<!-- https://www.gatehills.com/en/guides/webhooks -->
# How to receive events with webhooks

**In short**

- Webhooks send a signed HTTPS POST to your server each time something happens: a domain is about to expire, is renewed, is transferred, a certificate is issued…
- You set them up in the client area under “Webhooks”, next to “API keys”: for reseller accounts and Domain Club members.
- Up to 5 endpoints per account, each with its own events and signing secret.
- Failed deliveries are retried automatically for about 2 days.

Gatehills **webhooks** tell your server about events the moment they happen: domain expiry and renewal, transfers, hosting and SSL certificates. You add up to 5 HTTPS endpoints in the client area, choose the events for each one and check the HMAC signature of every request. They are available to reseller accounts and Domain Club members.

With webhooks your billing system, CRM or script learns about events right away, without asking the API again and again.

![The Webhooks page with the New endpoint form: endpoint URL, list of events with checkboxes and the Create endpoint button](https://www.gatehills.com/media/568-f0c9adc4ae6d.webp)
*1. Webhooks in the menu · 2. Endpoint URL · 3. Events · 4. Create endpoint*

## Create a webhook endpoint

1. **Open Webhooks** Sign in to the client area and click “Webhooks” in the menu (1). You need the same access as for API keys: a reseller account or an active Domain Club membership, and the “Manage API keys (resellers)” function.
2. **Enter the endpoint URL** Under “New endpoint”, write the “Endpoint URL” (2), for example “https://example.com/gatehills/webhook”. It must start with “https://”, use the standard port 443 and point to a public server.
3. **Choose the events** Under “Events” (3) tick the events you want to receive: domain expiry and renewal, transfers, hosting and SSL certificates. All are ticked at first except “webhook.ping”; untick the ones you do not need. Choose at least one.
4. **Create and copy the secret** Click “Create endpoint” (4). The “Signing secret” (starting with “whsec\_”) appears once: copy it now and store it on your server.
5. **Send a test** On the endpoint card click “Send a test event”. A “webhook.ping” event arrives within a minute; check it in “Last deliveries”.

![The signing secret shown once, the endpoint card with Save, Send a test event, New secret and Delete, and the Last deliveries table](https://www.gatehills.com/media/569-0ed2b5952ff9.webp)
*1. Signing secret, shown only once · 2. Send a test event · 3. Last deliveries with status and attempts*

## Check the signature

Every request is a `POST` with a JSON body and these headers:

- `Gatehills-Event`: the event type, for example `domain.expired`.
- `Gatehills-Delivery`: the event ID, the same in every retry. Use it to ignore duplicates.
- `Gatehills-Signature`: `t=TIMESTAMP,v1=SIGNATURE`, where `v1` is the HMAC-SHA256 of `t + "." + body` with your secret.

Compute the signature on the raw body, compare it with `v1` and reject requests with a `t` older than 5 minutes. Answer with any 2xx status within 10 seconds. The body contains only data about the domain or service (dates, amounts, names), never emails or phone numbers.

## Manage your endpoints

- **Change the events or pause**: tick or untick the events, or untick **Active**, then click **Save**. A paused endpoint shows **Paused** and receives nothing.
- **New secret**: creates a new signing secret, shown once. The old one stops working immediately, so update your server right away.
- **Delete**: removes the endpoint.
- **Last deliveries**: shows **When**, **Event**, **Status** (**Waiting**, **Delivered**, **Failed**) with the HTTP code of your server, and the number of **Attempts**. A failed delivery is retried after 1 minute, then with growing pauses for about 2 days; after that it is marked **Failed**.

## What are webhooks?

**Webhooks** are automatic HTTP requests that one service sends to another when something happens. Instead of asking the Gatehills API every few minutes whether a domain has been renewed, your server receives a message at the moment of the event.

Each request is signed with HMAC-SHA256, a keyed hash defined in [RFC 2104](https://www.rfc-editor.org/rfc/rfc2104). Only Gatehills and your server know the secret. A valid HMAC signature therefore proves that the request comes from Gatehills and was not changed on the way.

**Events you can choose, by group**

| Group | Example events |
|---|---|
| Domains | domain.expiry\_reminder, domain.expired, domain.renewed, domain.autorenew\_failed, domain.restored |
| Transfers | domain.transfer\_submitted, domain.transfer\_completed, domain.transfer\_failed, domain.transferred\_out |
| Hosting | hosting.activated, hosting.expiry\_reminder, hosting.suspended, hosting.moved |
| SSL certificates | certificate.issued, certificate.expiry\_reminder, certificate.failed, certificate.revoked |
| Test | webhook.ping, sent only when you click “Send a test event” |

### How often is a failed delivery retried?

A delivery fails when your webhook endpoint does not answer with a 2xx status within 10 seconds. A redirect also counts as a failure. Gatehills then tries again with growing pauses.

**Retry schedule of a delivery**

| Attempt | When it is sent |
|---|---|
| 1 | Within about a minute of the event |
| 2 | 1 minute after the first failure |
| 3 | 5 minutes later |
| 4 | 30 minutes later |
| 5 | 2 hours later |
| 6 | 6 hours later |
| 7 | 12 hours later |
| 8 | 24 hours later |

After 8 failed attempts, about 45 hours after the first one, the delivery is marked **Failed** and is not sent again. The number of attempts appears in **Last deliveries**.

> **Common mistakes**
>
> - **URL with http:// or another port**: only `https://` on port 443 is accepted.
> - **Internal or private address**: the URL must point to a public server, not `localhost` or a private network.
> - **Signature checked on parsed JSON**: compute it on the raw body exactly as received, or it will not match.
> - **Slow endpoint**: answer within 10 seconds and do the heavy work afterwards, or the delivery counts as failed.
> - **Secret lost**: it is never shown again. Click **New secret** and update your server.
> - **"Too many test events"**: you can send up to 5 test events per hour.

### Which events are available?

Domain events (expiry reminders, expired, renewal page, redemption, deletion, restore, renewed, auto-renewal done or failed), transfers in and out, hosting events (activation, expiry, suspension, moves…) and SSL certificate events (issued, expiring, failed, revoked…), plus `webhook.ping` for tests.

### Can I receive the same event twice?

Yes, if your server did not confirm in time the event is sent again. `Gatehills-Delivery` stays the same in every attempt, so you can recognise duplicates.

### How many endpoints can I have?

Up to 5 per account. Each one has its own events and secret.

### What happens if my Domain Club membership ends?

The endpoints stay but receive no events and cannot be changed until you renew. See [Domain Club](/en/guides/domain-club).

### Do I need an API key for webhooks?

No, webhooks only need the secret. But you usually use them together with an API key to act on the events. See [API keys](/en/guides/api-keys).

### How do I avoid processing the same event twice?

Save the `Gatehills-Delivery` value of every event you have handled. If a request arrives with a value you already have, answer with a 2xx status and do nothing else.

### Does Gatehills follow redirects from my endpoint?

No. A 3xx answer counts as a failed delivery. Give the final `https://` address of your endpoint.

**Related guides**

- [Create and manage API keys](/en/guides/api-keys)
- [Notifications and push](/en/guides/notifications)
- [Renewals and auto-renewal](/en/guides/renewals)
- [Domain Club](/en/guides/domain-club)
