Help Center / api
Setting up webhooks
Setting Up Webhooks
Webhooks notify your application when events happen in your account. Receive real-time updates without polling.
How Webhooks Work
- Event occurs (e.g., domain registered)
- We send HTTP POST to your endpoint
- Your server processes the event
- Responds with 200 OK
Creating a Webhook
- Go to Settings > Webhooks
- Click Add Endpoint
- Enter your URL (must be HTTPS)
- Select events to receive
- Save
Webhook Events
Domain Events
| Event | Description |
|---|---|
| domain.registered | New domain registered |
| domain.transferred | Domain transferred in |
| domain.renewed | Domain renewed |
| domain.expired | Domain expired |
| domain.deleted | Domain deleted |
VPS Events
| Event | Description |
|---|---|
| server.created | New server deployed |
| server.started | Server powered on |
| server.stopped | Server powered off |
| server.deleted | Server terminated |
| server.resized | Server plan changed |
Billing Events
| Event | Description |
|---|---|
| invoice.created | New invoice generated |
| invoice.paid | Payment received |
| payment.failed | Payment attempt failed |
Webhook Payload
{
"id": "evt_1234567890",
"type": "domain.registered",
"created": 1640000000,
"data": {
"domain": "example.com",
"registrant": "user@email.com",
"expiration": "2025-01-01"
}
}
Verifying Webhooks
Verify requests are from us using signatures:
const crypto = require('crypto')
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex')
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
)
}
// In your endpoint
app.post('/webhook', (req, res) => {
const signature = req.headers['x-osir-signature']
const isValid = verifyWebhook(req.rawBody, signature, webhookSecret)
if (!isValid) {
return res.status(401).send('Invalid signature')
}
// Process event
res.status(200).send('OK')
})
Retry Policy
If your endpoint fails, we retry:
| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | 5 minutes |
| 3 | 30 minutes |
| 4 | 2 hours |
| 5 | 24 hours |
After 5 failures, the webhook is disabled.
Testing Webhooks
- Go to your webhook settings
- Click Send Test Event
- Select event type
- View the request/response
Webhook Logs
View delivery history:
- Go to Webhooks > Select endpoint
- Click Logs
- See all attempts and responses
- Replay failed events
Best Practices
- Respond quickly - Return 200 within 30 seconds
- Process async - Queue events for background processing
- Verify signatures - Always validate requests
- Handle duplicates - Events may be sent more than once
- Log everything - Keep records for debugging