Overview

Blnk uses webhooks to send you real-time notifications about crucial transaction events happening in your ledger. Our webhook follows this structure:

{
  "event": "name_of_event",
  "data": {
    "field": "value"
  }
}
FieldDescriptionType
eventIndicates the type of event, e.g., transaction.applied.String
dataContains the request payload, detailing the relevant information.Object

Supported events

Here are a list of supported events:

Ledgers

Event nameDescription
ledger.createdWhen a ledger is created.

Balances

Event nameDescription
balance.createdWhen a balance is created.

Balance monitors

Event nameDescription
balance.monitorWhen a balance monitor is triggered due its conditions being met.

Transactions

Event nameDescription
transaction.appliedWhen a transaction is applied or committed.
transaction.inflightWhen a transaction is inflight
transaction.voidWhen an inflight transaction is voided.
transaction.scheduledWhen a transaction is successfully scheduled.
transaction.rejectedWhen a transaction is rejected

Bulk transactions

Event nameDescription
bulk_transaction.appliedWhen all items in a bulk transactions have been applied.
bulk_transaction.inflightWhen all items in a bulk transactions are successfully inflight.
bulk_transaction.failedWhen a bulk transaction fails.

Identities

Event nameDescription
identity.createdWhen an identity is created.

Handling error notifications

In addition to transaction events, Blnk also allows you to send error notifications to Slack via a specified webhook provided by your Slack workspace. This is very useful for monitoring and quickly addressing issues that may arise during transaction processing.

To learn how to get your Slack webhook URL, go to: Slack API: Sending messages using incoming webhooks.


Configuring notifications in Blnk

To set up how you receive notifications from Blnk, you need to update your blnk.json configuration file. This file allows you to specify the webhook URLs that Blnk sends notifications to — both for your application and Slack.

If you do not have a blnk.json file, please create a new json file — it contains essential settings for running your Blnk server.

Next, copy & paste the configuration JSON into it.

Update the notification object as follows:

  • slack:
    • webhook_url: The webhook URL provided by your Slack workspace.
  • webhook:
    • url: Your application’s webhook URL where Blnk sends transaction event notifications to.
    • headers: Optional headers that you may need to include in the notification request to authenticate the message. This can include authentication tokens or content type specifications.

Below is an example of a notifications configuration:

blnk.json
{
  "notification": {
    "slack": {
      "webhook_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
    },
    "webhook": {
      "url": "http://server:5001/webhooks",
      "headers": {
        "Content-Type": "application/json",
        "Authorization": "Bearer <your_auth_token>"
      }
    }
  }
}

Need help?

We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool.

To ask questions or discuss issues, please contact us or join our Discord community.

Love building with Blnk? We’d love to hear your feedback. Tell us here.