The webhooks resource lets you register HTTP endpoints to receive push events. See Webhooks overview for setup and event format.
Methods
| Method | What it does |
|---|---|
create(params) | Register an endpoint (a signing secret is generated for you) |
list() | List your endpoints |
get(id) | Fetch one |
update(id, params) | Change URL, events, active flag, or description |
delete(id) | Remove |
deliveries(webhookId) | Inspect recent delivery attempts |
Register a webhook
typescript
const hook = await socifyr.webhooks.create({
url: 'https://myapp.com/webhooks/socifyr',
events: ['upload.completed', 'upload.failed', 'upload.partial_failure'],
description: 'Production endpoint',
})
// Store hook.secret — it signs every delivery and is needed for verificationAvailable events
| Event | When it fires |
|---|---|
upload.completed | All channels succeeded |
upload.failed | All channels failed |
upload.partial_failure | Some channels succeeded, some failed |
platform.success | A specific platform succeeded |
platform.failed | A specific platform failed |
See Webhook events for payload examples of each.
Inspect deliveries
Socifyr keeps the last 50 delivery attempts for each webhook:
typescript
const deliveries = await socifyr.webhooks.deliveries(hook.id)
for (const d of deliveries) {
console.log(d.event, d.status, d.statusCode, d.attemptedAt)
}Failed deliveries are retried up to 5 times with exponential backoff starting at 10s.
Verifying signatures
Every delivery is signed with HMAC-SHA256 in the X-Webhook-Signature header. See Webhook signatures for verification code — or use the SDK's verifyWebhookSignature() helper directly.