Webhooks Overview
Introduction to Moneyhub webhooks: the webhook envelope, receiving and responding, setup, and testing.
Webhooks are a way for Moneyhub to notify your application in real-time about events related to the users that you have created.
At a glance
| Topic | Summary |
|---|---|
| Delivery | An HTTPS POST to the webhook URL set on your API client |
| Formats | JSON (application/json) or signed JWT (application/jwt). See Webhook Format |
| Your response | Any 2xx within 5 seconds |
| Retries | None. Each webhook is sent once, so reconcile with the API |
| Order | Not guaranteed |
| Payloads | Mostly IDs. Fetch the latest data from the API |
| Authenticity | Verify JWT webhooks with Verifying JWT Webhooks, and optionally allow only Moneyhub source IP addresses |
| Events | Listed in all events, with a page for each |
New to webhooks? Try Receive Updates with Webhooks in Getting started, then use Building a Webhook Receiver for complete Node.js and Python examples. Testing and Troubleshooting Webhooks has a production checklist and fixes for common problems.
Schema
Every immediate webhook uses the same envelope. Only eventType and the contents of payload change from one event to another. Each event page documents its payload fields and shows a complete example.
| Name | Type | Description |
|---|---|---|
| id | string | Unique ID of the webhook |
| eventType | string[enum] | The event id, for example newTransactions |
| userId | string | The ID of the user the event relates to |
| payload | object | Event-specific data, described on each event's page |
Example webhook
{
"id": "abe168ce-1b2f-4c38-9c92-db5730485cb3",
"eventType": "newTransactions",
"userId": "5c79210bbac25ecb5e71ac40",
"payload": {
"accounts": [
{
"id": "6d0baf11-248e-4c11-9c04-97b7758b4e04",
"transactions": [
"d520402a-d982-43ee-b1d1-bdfd282249ea",
"613586bf-dac9-4996-9c03-7194a7d62297"
]
}
]
}
}Webhooks are sent as JSON by default, or as a signed JWT if you choose. Batched webhooks use a different envelope that lists events without their payloads. See Webhook Format for both.
Receiving webhooks
Building a Webhook Receiver walks through a complete receiver. The key points are below.
Response
We expect a 2xx response to mark the webhook as received. Any other status code, or no response, is recorded as a failed delivery.
Timeout
When we send webhooks, the request timeout is 5 seconds. Respond with 2xx straight away and process the webhook afterwards, for example from a queue.
Retries
We only attempt to send each webhook once. Failed deliveries are not retried, so use the API to reconcile your data rather than relying on receiving every webhook.
Order and duplicates
Webhooks can arrive in any order, including those from the same sync or payment. Make your processing idempotent: skip webhooks whose id you have already processed, and base updates on the resource IDs and statuses in the payload. See idempotency.
Security
Webhooks are sent over HTTPS. To confirm a webhook came from Moneyhub:
- use the JWT format and verify each webhook
- optionally, accept requests only from the Moneyhub source IP addresses
JSON webhooks are not signed. If you use JSON, fetch data from the API using the IDs in the payload rather than trusting the payload itself.
Transaction webhooks
When receiving transaction webhooks, we recommend fetching the transactions from our API to have the latest changes. Multiple transactions can be retrieved at once using our transactions endpoint.
The API may send multiple transaction webhooks for a single connection if that connection has multiple accounts, because transaction webhooks are sent per account.
Each webhook event is limited to 6,000 transaction IDs. If the triggering event (new, updated, or deleted transactions) contains more than 6,000 IDs, the API automatically splits them into multiple webhook events.
Setting up webhooks
You can configure webhook endpoints via the Admin portal when you add or edit your API clients.
Once you start receiving webhooks, you will be able to see a list of them when you drill down to the details of your API users.
Format
From the Client settings in the Admin Portal, you can select either JSON or JWT formatting for the webhook messages that we send you. You can use either format at any time, including for live production clients. See Webhook Format for both formats and Verifying JWT Webhooks for how to check a JWT webhook came from Moneyhub.
Immediate and batched delivery
Webhook delivery supports both immediate and batched destinations, configured independently per client:
- Immediate webhooks
- Webhook URL
- Webhook format
- Allowed events
- Batched webhooks
- Batched webhook URL
- Batched webhook format
- Batched allowed events
- Batch interval in days
Batched delivery queues matching events and sends them as a single batched webhook to the configured batched webhook URL.
Batch interval controls how often a batch is sent:
- minimum
1day - default
7days if not set
Clients can configure immediate only, batched only, or both.
To test batched webhooks without waiting for the batch interval, you can flush pending batched events for a sandbox client.
Testing
See Testing and Troubleshooting Webhooks for how to test your receiver, a production checklist, and solutions to common problems.
Available webhooks
Webhooks are grouped by what triggers them. Each group lists its events, and each event has its own page with the payload and a full example.
These webhooks are triggered by new financial records being synced or changes to existing records
Status updates for payments, pay files, and recurring payment consents
The outcomes of affordability reports and standard financial statements
Contextual changes to the financial situation trigger nudges
All events
Every published eventType, with the event name used in JWT webhooks. The JWT event name is always urn:com:moneyhub:events: followed by the eventType in kebab case.
| eventType | Group | JWT event name |
|---|---|---|
syncCompleted | Financial data | urn:com:moneyhub:events:sync-completed |
postConnectionEnrichmentCompleted | Financial data | urn:com:moneyhub:events:post-connection-enrichment-completed |
newTransactions | Financial data | urn:com:moneyhub:events:new-transactions |
updatedTransactions | Financial data | urn:com:moneyhub:events:updated-transactions |
deletedTransactions | Financial data | urn:com:moneyhub:events:deleted-transactions |
restoredTransactions | Financial data | urn:com:moneyhub:events:restored-transactions |
deletedAccount | Financial data | urn:com:moneyhub:events:deleted-account |
newRegularTransactions | Financial data | urn:com:moneyhub:events:new-regular-transactions |
updatedRegularTransactions | Financial data | urn:com:moneyhub:events:updated-regular-transactions |
counterpartyIdChanged | Financial data | urn:com:moneyhub:events:counterparty-id-changed |
paymentSubmitted | Payments | urn:com:moneyhub:events:payment-submitted |
paymentPending | Payments | urn:com:moneyhub:events:payment-pending |
paymentCompleted | Payments | urn:com:moneyhub:events:payment-completed |
paymentError | Payments | urn:com:moneyhub:events:payment-error |
payFileCreated | Payments | urn:com:moneyhub:events:pay-file-created |
recurringPaymentCreated | Payments | urn:com:moneyhub:events:recurring-payment-created |
affordabilityReportSuccess | Decisioning | urn:com:moneyhub:events:affordability-report-success |
affordabilityReportFailure | Decisioning | urn:com:moneyhub:events:affordability-report-failure |
standardFinancialStatementSuccess | Decisioning | urn:com:moneyhub:events:standard-financial-statement-success |
standardFinancialStatementFailure | Decisioning | urn:com:moneyhub:events:standard-financial-statement-failure |
reauthReminder | Nudges | urn:com:moneyhub:events:reauth-reminder |
refreshReminder | Nudges | urn:com:moneyhub:events:refresh-reminder |
balanceThreshold | Nudges | urn:com:moneyhub:events:balance-threshold |
youveBeenPaid | Nudges | urn:com:moneyhub:events:youve-been-paid |
spendingGoalProgress | Nudges | urn:com:moneyhub:events:spending-goal-progress |
spendingGoalReached | Nudges | urn:com:moneyhub:events:spending-goal-reached |
spendingGoalExceeded | Nudges | urn:com:moneyhub:events:spending-goal-exceeded |
discoverSpendingAnalysisNewConnections | Nudges | urn:com:moneyhub:events:discover-spending-analysis-new-connections |
addFirstConnection | Nudges | urn:com:moneyhub:events:add-first-connection |
New event types can be added. Ignore any you don't handle, and still respond with 2xx.
Updated 13 days ago
