---
title: "Webhooks"
description: "Signed webhooks: events, headers and HMAC signature verification."
url: https://www.gyrohosting.com/developers/en/guides/webhooks.html
language: en
openapi: https://www.gyrohosting.com/developers/openapi.json
api_version: 2.30.0
---

# Webhooks

Create a webhook with `POST /cloud/webhooks`; the 64-hex secret is shown once. Verify every delivery:

```
import hmac, hashlib, time
def valid(secret, ts, body, signature):
    if abs(time.time() - int(ts)) > 300: return False
    mac = hmac.new(secret.encode(), (ts + "." + body).encode(), hashlib.sha256).hexdigest()
    return hmac.compare_digest("sha256=" + mac, signature)
```

Headers: `X-Gyro-Event`, `X-Gyro-Delivery`, `X-Gyro-Timestamp`, `X-Gyro-Signature`. Answer 2xx within 4 seconds.
