Skip to content

Webhooks

Webhooks push an HTTP POST to a URL you control whenever something happens to a report in your organization: created, updated, triaged, and so on. Use them to sync reports into your own tracker, notify a channel, or trigger automation. A channel’s transmit steps deliver through webhooks too; see the Channels API.

In the app, open Webhooks and add one with:

  • a name,
  • the URL to deliver to, and
  • the events you want to receive (checkboxes).

You can subscribe to any of these report events:

EventFires when
Report::CreatedA report is created.
Report::UpdatedA report is updated.
Report::ReadA report is read.
Report::DestroyedA report is deleted.
Report::Inbox::ReceivedA report lands in the inbox.
Report::Inbox::StoredAn inbox report is stored.
Report::Processing::ClosedA report is closed.
Report::Processing::ReopenedA closed report is reopened.

Event types have stable ids you attach when subscribing. List them:

List subscribable events
curl https://api.disclosebot.io/v1/webhook_event_types \
-H "Authorization: Bearer disclosebot_svc_xxxxxxxx" \
-H "Accept: application/vnd.api+json"

Each item has a name (e.g. Events::Report::Created) and a short_name (Report::Created).

Webhooks are a full CRUD resource (GET/POST/PATCH/DELETE /v1/webhooks). Subscribe by attaching a trigger_event_types relationship, referencing ids from the discovery endpoint:

Create a webhook subscribed to two events
curl -X POST https://api.disclosebot.io/v1/webhooks \
-H "Authorization: Bearer disclosebot_svc_xxxxxxxx" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "webhook",
"attributes": { "name": "My integration", "url": "https://example.com/hooks", "enabled": true },
"relationships": {
"trigger_event_types": {
"data": [
{ "type": "trigger_event_type", "id": "<created-id>" },
{ "type": "trigger_event_type", "id": "<closed-id>" }
]
}
}
}
}'

See the Platform API reference for the full webhook and event-type schemas.

When a subscribed event fires, we POST a JSON body to your URL. Every delivery is signed, has one shape, and is recorded so you can see what we sent and what you answered. That is covered on its own page: Webhook deliveries.

The one-time signing secret is in the response to creating the webhook, under data.attributes.signing_secret. Store it then; it cannot be read back.

If a secret is lost or exposed, open the webhook in the app and choose Rotate. The new secret is shown once, on that page, and cannot be read back afterwards either.

Rotation takes effect immediately and there is no overlap: the previous secret stops signing at once, so every consumer still verifying with it will reject deliveries until you give them the new one. Have somewhere to put it before you press the button.

A rotated secret does not re-sign anything already sent. Deliveries signed with the old secret keep the signature they were sent with, and only new ones use the new secret.