Skip to content

The webhooks resource lets you register HTTP endpoints to receive push events. See Webhooks overview for setup and event format.

Methods

MethodWhat 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

EventWhen it fires
upload.createdA post is created (draft, scheduled, or immediate)
upload.startedProcessing begins
upload.completedAll channels succeeded
upload.failedAll channels failed
upload.partial_failureSome channels succeeded, some failed
channel.publishedA specific channel succeeded
channel.failedA 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.