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 |
list() | List your endpoints |
get(id) | Fetch one |
update(id, params) | Change URL, events, or secret |
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'],
secret: 'whsec_...', // optional — used to sign each delivery
})Available events
| Event | When it fires |
|---|---|
upload.created | A post is created (draft, scheduled, or immediate) |
upload.started | Processing begins |
upload.completed | All channels succeeded |
upload.failed | All channels failed |
upload.partial_failure | Some channels succeeded, some failed |
channel.published | A specific channel succeeded |
channel.failed | A specific channel failed |
Inspect deliveries
Socifyr keeps the last 100 delivery attempts for each webhook:
typescript
const deliveries = await socifyr.webhooks.deliveries(hook.id)
for (const d of deliveries) {
console.log(d.event, d.statusCode, d.deliveredAt)
}Failed deliveries are retried 3 times with exponential backoff.
Verifying signatures
Socifyr signs every delivery with HMAC-SHA256. See Webhook signatures for verification code.