Webhooks API
Receive real-time notifications when events occur in your projects.
Available Events
| Event | Description |
|---|---|
project.created |
New project created |
snapshot.completed |
Snapshot captured |
comment.created |
New comment added |
comment.resolved |
Comment resolved |
member.invited |
Team member invited |
Create Webhook
POST /v1/webhooks
Content-Type: application/json
{
"url": "https://yourapp.com/webhooks/inpera",
"events": ["comment.created", "snapshot.completed"],
"secret": "whsec_your_secret"
}
Webhook Payload
{
"id": "evt_abc123",
"type": "comment.created",
"createdAt": "2024-12-24T12:00:00Z",
"data": {
"comment": {
"id": "cmt_xyz",
"text": "..."
},
"project": {
"id": "proj_abc"
}
}
}
Verifying Signatures
All webhooks are signed:
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(`sha256=${expected}`)
);
}
Retry Policy
Failed deliveries are retried:
- Attempt 1: Immediate
- Attempt 2: 5 minutes
- Attempt 3: 30 minutes
- Attempt 4: 2 hours
- Attempt 5: 24 hours
List Webhooks
GET /v1/webhooks
Update Webhook
PATCH /v1/webhooks/{webhookId}
{
"events": ["comment.created"],
"enabled": true
}
Delete Webhook
DELETE /v1/webhooks/{webhookId}
Testing
Test your endpoint:
POST /v1/webhooks/{webhookId}/test
Sends a test event to verify your endpoint.