Skip to main content

How to Add a Webhook

Your system can register to events on the Corsa platform you want to be notified about and act upon.
  1. From the Settings → Developers menu, choose the Webhooks tab and press + Add webhook.
  2. Choose the events you want to receive webhooks for (choose at least one).
  3. Specify your server URL and a secret for validation on your server.

Webhook Handling

Headers

When receiving webhooks, inspect the following HTTP headers:

Verifying Signatures

It’s crucial to verify the signature of incoming webhooks to ensure they originated from the Corsa API and were not tampered with. Use the verifyWebhookSignature function exported from the SDK.

Event Types

The following webhook event types are available (defined in WebhookEventType):

Clients

Alerts & Cases

Transactions

Financial Operations

Members

Financial Instruments

Checklists

Attachments

Forms

The payload structure for each event type (WebhookEvent, EntityCreatedPayload, EntityUpdatedPayload) and the WebhookEventType enum can be imported from @corsa-labs/sdk. For detailed payload structures for each event type, see the Event Payloads reference. For a practical example of how to set up a webhook handler, see the Webhook Example.

Retries & Failure Handling

Corsa retries failed webhook deliveries automatically. A queued delivery attempt is considered failed if your endpoint returns a non-2xx status code or does not respond within 5 seconds. After the initial attempt and three queued retries fail, the delivery is marked as failed. Redirects are not followed, so your endpoint must return a 2xx response directly. Because retries can deliver the same event more than once, your handler should be idempotent — use the x-hook-delivery header as a unique key to deduplicate events on your side.

Signing Secret

The signing secret is a shared string used to verify that incoming webhook requests are authentic and have not been tampered with or spoofed. This ensures that the request is genuinely coming from the Corsa server. Make sure the signing secret you provide is stored securely and encrypted in your platform (for example, using AWS Secrets Manager). We use HMAC-based shared-key authentication. The signing process involves generating a signature using the shared key and comparing it with the one included in the webhook request.
The result is attached in the request headers under the X-Hub-Signature-256 header:
On your end, validate by using the same implementation (hashing the HTTP request body) and compare the result with the header. For increased security, use a cryptographically-secure string comparison function like crypto.timingSafeEqual.