Set up webhooks
Register your webhook endpoints, check each request's signature, handle retries, duplicates and order, and find events your server missed.
Gravv sends an HTTPS POST to your webhook URL each time an event happens, such as a transfer completing, a deposit landing, a card being frozen or a customer passing KYC. This page covers what every event has in common: how to register your URL, check signatures, handle retries, duplicates and order, and find the events your server missed. The event catalogue lists each event and its fields.
Example. Chidi's 50.00 USD deposit lands while your server is down for a release. Gravv's delivery of transfer.inflow.completed fails, and Gravv tries again later. Your server comes back after the last attempt, so the event ends failed. You list the failed transfer events, read the stored event, and credit Chidi the 50.00 USD once, because you keep the event_id of every event you have already processed.
Register your webhook endpoints
You add endpoints in the Dashboard. There is no public API for it. Follow the steps in Webhooks.
transfer.inflow.completed. An endpoint with no events picked receives every event. When both endpoints take an event, each gets its own delivery, with the same event_id, and each is retried on its own.https URL. The Dashboard saves an http URL, but every delivery to it fails. Gravv refuses addresses on a private network. Do not redirect the URL, because a redirect turns the POST into a GET without a body.whsec_. The whole value, whsec_ included, is the signing key. Gravv signs requests with HMAC-SHA256, and you cannot choose another method. To change it, roll the secret.webhook.test event to an endpoint, even one that is turned off, and shows your server's answer. Each endpoint also shows its delivery rate over the last 7 days and its own deliveries.200 for them.Webhook payload structure
Every event has the same envelope. Only event_data changes with the event type.
| Field | Type | Description |
|---|---|---|
event_id | string | This event's own id. It stays the same on every retry and resend of the event, so deduplicate on it |
tenant_id | string | Your business |
transaction_id | string | The transaction the event is about, or "" when there is none |
event_category | string | The category, such as transfer, cards or customer. Webhook history filters by it |
event_type | string | The full type, such as transfer.inflow.completed |
event_group_id | string | The same for every event about one thing: one transfer, deposit, card or customer. The catalogue says which id it is for each family |
timestamp | string | When Gravv sent the event, in ISO 8601. It is not always the time of the change |
event_data | object | The event's own fields. See the catalogue |
idempotency_key | string | Only on some events. On transfer events it gives the order. See ordering |
Keys in event_data arrive in alphabetical order, and the characters <, > and & in strings arrive escaped as \u003c, \u003e and \u0026. Your JSON parser handles both. They matter only for the signature, which is why you check it on the bytes you received.
Each request carries these headers. Read header names without regard to case.
| Header | Value |
|---|---|
Content-Type | application/json |
X-Signature | The signature. See below |
X-Signature-Next | Only in the 24 hours after you roll the secret: the signature with the new secret |
X-Event-ID | The event's event_group_id, which every event about the same thing shares. It is not the event_id |
Verify webhook signatures
X-Signature is the lowercase hexadecimal HMAC-SHA256 of the exact request body, keyed with your whole webhook secret, whsec_ included. In the 24 hours after you roll the secret, X-Signature-Next carries the same signature made with the new secret. Check them before you act on an event:
X-Signature, and with X-Signature-Next when the request has it.401 when neither does.Checking both headers from the start means a secret roll never breaks your check, whether you swap the new secret in before or after the old one stops.
Roll a secret
Roll an endpoint's secret in the Dashboard when you want a new one. You choose what happens to the old one:
X-Signature is still signed with the old secret and X-Signature-Next with the new one. After 24 hours, X-Signature carries the new secret and X-Signature-Next is gone.X-Signature, from the moment you roll. Allow up to 5 minutes for the change to reach every delivery. Requests signed with the old secret after that did not come from Gravv.So that a roll never breaks your check, compute the signature with the secret you hold and accept the request when it matches either X-Signature or X-Signature-Next, as the handlers above do. That works before you swap in the new secret and after.
Both Dashboards roll the secret. In the current Dashboard, generating a new secret for the webhook is a roll that keeps the old one for 24 hours. Stopping the old secret at once is only in the new Dashboard. Either way, you cannot roll again until the old secret's 24 hours are over, except to stop it now.
Example. You roll the secret at 10:00 and keep the old one. Your server still holds the old secret, so its signature matches X-Signature. At 14:00 you deploy the new secret, and its signature now matches X-Signature-Next. At 10:00 the next day X-Signature switches to the new secret, and your check keeps passing without another change.
The signature has no timestamp, so it does not stop someone from sending a captured request a second time. Deduplicate on event_id, and a replayed request has no effect.
A manual resend is signed like an automatic delivery. It carries X-Signature, and X-Signature-Next during a roll, so your signature check works on it without a change.
Delivery, retries, and idempotency
Gravv treats any 2xx response as delivered. Any other status, a timeout or no response is a failed attempt. Gravv follows a redirect as a GET without the body, so keep the URL free of redirects.
200, and do the work afterwards. Gravv keeps up to 64 KiB of your response, which you can read on the event route. Respond with a JSON object or an empty body.max_retries on Get webhook event. After the last attempt the event is failed, and nothing retries it automatically. Read it or resend it, as described below.https. Every attempt fails before Gravv makes a call. The event records response_status_code 0, and each attempt shows in the calls with the text Not sent: Gravv could not prepare this delivery. It is retried automatically.event_id and treat a repeat as done. Do not deduplicate on X-Event-ID. Every event about the same transfer, card or customer shares it, so you would drop real updates.idempotency_key is <reference>:<sequence>. Apply an event only when its sequence is higher than the last one you applied. For other events, compare the status in event_data with the state you hold. timestamp does not give the order.idempotency_key and is identical to an earlier one for the same object. For example, when a card goes active, then freeze, then active again, Gravv sends no second active. After a change you make yourself, read the object.Find and resend missed events
Four routes show what Gravv sent you, in the environment of the key you use. They need no Idempotency-Key.
| Route | Use it to |
|---|---|
GET /v1/webhooks/history | List delivery records, newest first, and find the failed ones |
GET /v1/webhooks/event/{id} | Read one record: the event as stored, attempts, delivery_attempts, max_retries and your endpoint's last response |
GET /v1/webhooks/calls/{id} | See each attempt, retries and successes included: your status code, the time taken and any connection error |
POST /v1/webhooks/event/send/{id} | Send one stored event to the endpoint it was queued for, now |
Three different ids appear in these routes. Keep them apart:
| Id | Where you find it | What it is |
|---|---|---|
Record id | items[].id in history, and id on the event route | The delivery record. It is the {id} in the other three routes |
event_id on the event route | GET /v1/webhooks/event/{id} | The event_group_id, the same value as the X-Event-ID header |
payload.event_id | Inside payload on the event route | The event_id your endpoint received. Deduplicate on this one |
History filters. All filters are optional, and you can combine them:
event_type takes the category, such as transfer (which includes deposits into accounts), inflow, collection, cards, customer, external_account, applications.accounts, account or feature_access. A full type such as transfer.inflow.completed returns nothing.status is pending, processing, sent, failed or retrying. Any other value returns an empty list, not an error.start_date and end_date take 2026-10-13T10:00:00Z, 2026-10-13 or 2026-10-13T10:00:00. A date alone means 00:00 that day, so end_date=2026-10-13 leaves out the 13th.transaction_id matches the record's transaction. For a collection, that is the collection's id. For a transfer, it is the first id in associated_transactions, not the transfer reference.page starts at 1. limit is 50 by default and at most 100.Read the event and process it. payload on the event route is the event as Gravv stored it. You fetched it with your API key, so you can process it directly. Deduplicate on payload.event_id. Its keys are in a different order from the request Gravv sent you, so you cannot check a signature against it.
Or resend it. POST /v1/webhooks/event/send/{id} posts the stored event to the endpoint it was queued for and returns that endpoint's result. Only an event queued before you had several endpoints goes to your newest endpoint that is on. If you deleted the endpoint the event was queued for, the resend is refused. It takes no body. A scoped API key needs the webhook:create permission. The resend:
X-Signature (and X-Signature-Next during a roll), and has the same body format;200 even when your endpoint refused it, so read status_code in the response;Trace a transfer and resend a webhook and Set up webhooks and catch up on missed events walk through these routes with full requests.
Attempts. Gravv records every attempt, including a successful delivery and an attempt that failed before it was sent. attempts counts them all. The event route returns them in delivery_attempts, latest first, each with its response code, time, response headers, response body and error. It leaves out the request headers. For an attempt that failed before it was sent, error_message reads Not sent: Gravv could not prepare this delivery. It is retried automatically.
Errors. These routes return errors as HTTP 400 with {"data":null,"error":"<message>"}, including for an id that does not exist. A missing or wrong API key still gets 401, and too many requests get 429.
| Message | Why | Fix |
|---|---|---|
invalid event ID format or invalid event ID | The {id} is not a UUID | Use items[].id from history |
event not found, or event not found or not owned by tenant | No such record for your business, or it is in the other environment | Check the id, and use a key for the same environment |
event is already being processed | Gravv is delivering it right now | Wait a moment and try again |
the webhook endpoint this event was queued for was deleted | You deleted the endpoint the event was queued for | Add the endpoint again, or read payload and process it |
no webhook URL configured for tenant <id> category <category> | No URL is set | Set the URL in the Dashboard |
unsafe webhook url: webhook url must use https scheme | The URL is http, or private | Register a public https URL |
webhook delivery failed: <error> | Your endpoint did not respond within 30 seconds, or refused the connection | Fix the endpoint. Gravv schedules an automatic retry |
failed to process event data | Your endpoint's last response was JSON but not an object | Respond with a JSON object or an empty body |
circuit breaker open for webhooks: circuit breaker is open | Gravv's webhook service is failing briefly | Try again after about 30 seconds |
A scoped key without webhook:create gets 403 on the resend, with required_any ["webhook:create"].