Search…
Webhooks

Introduction

With our GraphQL API you can request data and perform actions on your accounts, cards, transactions, etc. In this communication process, you (or your user) ask Swan to execute operations and we respond.
How to execute operations with our API
With webhooks, when an external event happens and a resource is updated on our side, we initiate the request to one of your endpoints. This allows you to process events that were not initiated by you - through our API, and in real-time, rather than a few minutes or hours later.
How to get data using a webhook
Banking data is sensitive; that's why we require authentication to access it! And webhooks simply aren't that secure. So we won't send sensitive banking data through them, you'll just get a notification that something happened. To access sensitive data impacted by an event, you'll need to query our API.

Add and configure a webhook

You can configure a webhook from our dashboard. A webhook object possesses 4 characteristics:
  • status: a webhook can be Enabled or Disabled
  • label: input a short text of your choice
  • endpoint URL: the URL we will request
  • events: the list of event types where we request endpoint URL
Once a webhook is created, you can get more information on its usage and see all requests up to that point. This allows you to troubleshoot any errors you might encounter and see what Swan got back as a response. You can access filters on the eventId or the resourceId to search for specific events that were fired.
​
For security reasons, you'll have to manually configure your webhooks once you go live, in the live section.
If we encounter an error during a webhook request, we'll replay it up to 4 times. If all the tries fail, we'll then let you replay it manually. With just a click, you can catch the event you missed and synchronize your processes.

Event data sent

We send a POST request with the following body :
1
{
2
"eventType": "Transaction.Booked",
3
"eventId": "513e7027-8320-42f1-bdb5-3ca630b9a4c6",
4
"eventDate": "2021-08-18T09:35:46.673Z",
5
"projectId": "ea0e5a52-63ab-4eb8-9645-eaf42357694f",
6
"resourceId": "bosci_46976252125703bac107f4f8a4ca5b3d",
7
"retryCount": 0
8
}
Copied!
This example is an event triggered by the creation of a new transaction with the id bosci_46976252125703bac107f4f8a4ca5b3d. Each event is described by two data: eventType which tells you what action was performed and on which resource type, and eventIdwhich is unique for this action. For security reasons, we do not provide further information on our request. For more information on the resource impacted by the event, you must query our API.
Every request we make to your endpoint must be answered with the HTTP 200 code. If we receive another code, we consider it an error and retry the call a few seconds later. We make a maximum of three tries per request. After that, you can still replay the request manually if you need to.

Event types

The first part of the eventType will tell you what resources to query in an API call. In the following table, you will find all the event types and examples of their functional triggers.
This list of triggers is not exhaustive because the events are based on Swan's resources. transaction.created is an event type that is triggered every time there is a new transaction on your project. This could be a card payment, an incoming Sepa Credit Transfer, a received Sepa direct debit, or even a new type of transaction that hasn't been developed yet.
Account.Closed
An account was closed
Account.Created
An onboarding was finalized
Account.Updated
An account name was changed
AccountHolder.Created
An onboarding was finalized
AccountHolder.Updated
A Banking Verification Status was updated by our compliance dept.
AccountMembership.Bound
A user was bound with the accountMembership
AccountMembership.Created
A new accountMembership was created
AccountMembership.Disabled
An accountMembership was disabled
AccountMembership.Resumed
A suspended accountMembership was resumed
AccountMembership.Suspended
An accountMembership was suspended
AccountMembership.Updated
An accountMembership was updated by an action
AccountStatement.Generated
An accountStatement was generated
CapitalDepositCaseEvent.Created
A CapitalDepositCase was created
CapitalDepositCaseEvent.Updated
A CapitalDepositCase was updated
Card.Created
A new virtual card was created
Card.Updated
A physical card was printed, a spending limit was updated ...
Consent.Canceled
A consent was canceled by the partner
Consent.Created
A consent was created for a sensitive operation
Consent.Expired
A consent expired without being refused or granted
Consent.Granted
The user accepted a sensitive operation
​
​