POST that Sevalla sends to a webhook’s endpoint each time one of the events it subscribes to happens in your company, such as a deployment of an application finishing. This page describes the request your endpoint receives. To create webhooks, roll their secret and check deliveries in the dashboard, see Webhooks in the platform docs.
Request
string
ID of the webhook that sent the request.
string
ID of the event. The same on every retry, so use it to drop duplicates.
string
ID of this delivery attempt. A new one on every retry.
string
The event type, such as
APP_DEPLOY.object
The event’s details. Its fields depend on
type: see Event data.Event types
Set the events a webhook receives inallowed_events when you create or update it.
allowed_events accepts the three database events, but Sevalla doesn’t send them yet. A webhook subscribed only to database events receives no deliveries.is_preview set to true.
Event data
APP_CREATE
string
Application ID.
string
Company ID.
string
The application’s system name, such as
storefront-x7k2m.string
The name shown in the dashboard.
string
The location’s region ID, such as
europe-west3.APP_UPDATE and APP_DELETE
string
Application ID.
string
Company ID.
string
The application’s system name. In
APP_UPDATE, the value from before the update.string
The name shown in the dashboard. In
APP_UPDATE, the value from before the update.APP_DEPLOY
string
Company ID.
string
Application ID.
string
The application’s system name.
string
The name shown in the dashboard.
string
Deployment ID. Pass it to Get deployment for the details.
string
inProgress, success, failed or cancelled.string
The full commit SHA. Absent or
null for Docker image deployments.boolean
true for a preview app.STATIC_SITE_CREATE, STATIC_SITE_UPDATE and STATIC_SITE_DELETE
string
Static site ID.
string
Company ID.
string
The static site’s system name.
string
The name shown in the dashboard.
STATIC_SITE_DEPLOY
string
Company ID.
string
Static site ID.
string
The static site’s system name.
string
The name shown in the dashboard.
string
Deployment ID. Pass it to Get static site deployment for the details.
string
inProgress, then success, failed or cancelled.string
The repository URL.
string
The deployed branch.
null unless pull request previews are turned on for the static site.string
The commit SHA.
null unless pull request previews are turned on for the static site.boolean
true for a pull request preview.Verify requests
Thesvl-signature header contains the webhook’s signing secret itself, not a hash of the body. To check that a request comes from Sevalla, compare the header with the secret you stored, in constant time, and reject the request with 401 when it doesn’t match. Get webhook returns the secret in secret.
While a secret rollover is under way, deliveries carry the old secret until the period you chose ends, then the new one, so accept both. Roll webhook secret takes expire_in_hours from 0 (the default, which switches at once) to 24.
server.ts
Retries
When a delivery fails, Sevalla retries the event after 1 minute, 5 minutes, 10 minutes, 30 minutes, 1 hour, 2 hours, 4 hours, 8 hours, 16 hours and 1 day, each counted from the previous attempt. It retries only during the 4 days after the event, so the 10th retry, about 2 days and 8 hours after the event, is the last. If it fails too, the event isn’t sent again. See Retries in the platform docs.- Each retry is a new delivery with a new
event_delivery_idand the sameevent_id. Retries stop as soon as one delivery succeeds. - Retries go to the endpoint the webhook had when the event happened, and carry the current signing secret.
- Respond with a
2xxas soon as you’ve checked the signature, and do slow work afterwards, so a slow handler isn’t counted as a failure.
Manage webhooks with the API
A delivery’s
status is PENDING while Sevalla sends it, SUCCESS when your endpoint answered with a 2xx, and FAILED otherwise.