Skip to main content

Overview

Instead of polling APIs for status changes, register a webhook URL and Bastion will push events to you as they happen.

How it works

  1. Register a webhook. Provide a URL where you want to receive events.
  2. Bastion sends events. When something happens (conversion completed, compliance approved, etc.), Bastion POSTs a payload to your URL.
  3. You acknowledge. Return a 2xx response to confirm receipt.

Managing webhooks

You can register new webhook endpoints via the Bastion admin dashboard or the API. The HTTP endpoint must be publicly accessible and secured with a valid SSL/TLS certificate issued by a common certificate authority.

Webhook object

API endpoints

Create a webhook

Request

Security

Firewall

Bastion sends webhook notification events from a small set of IPs. To ensure your systems only process events sent by Bastion, configure a firewall to only accept requests from Bastion IPs. The set of Bastion IPs differs per environment. Configure your firewall to accept requests from all of the listed IPs for a given environment.

Event payload

All events follow the same general payload format: a unique ID, the type of the event, and event data that varies by type. Example event payload

Event types

Bastion sends webhooks for events including:
  • Compliance. Identity approved, rejected, or requires action.
  • Conversions. Status changes, deposit instructions ready.
  • Transfers. Crypto transfer confirmed or failed.
  • Deposits. Incoming blockchain transactions into your wallets.
See the notification references for the full list of event types and payload schemas: Deposits, Transfers, and Conversions.

Best practices

  • Return quickly. Respond with 2xx within a few seconds and process asynchronously.
  • Verify the sender. Validate the webhook sender IP to ensure authenticity.
  • Handle duplicates. Use idempotency keys. You may receive the same event more than once.
  • Monitor failures. Bastion retries failed deliveries (see below), but persistent failures may result in the webhook event being dropped.

Retry behavior

If your endpoint does not return a 2xx response, Bastion retries delivery using exponential backoff. Retries follow an exponential backoff schedule starting at 15 seconds, with a maximum retry window of 10 minutes from event creation: 15s → 30s → 60s → 120s → 240s (5 attempts over ~7.75 minutes) If Bastion does not receive a 2xx response within the 10-minute window, it drops the event and does not retry.