https://api.tesouro.com/api/v1/notifications/subscriptions
Prerequisites
Before creating a subscription:- A valid authentication token (see Authentication)
- A publicly accessible HTTPS endpoint that accepts POST requests and returns a
2xxstatus code - The following authorization scopes:
notification:subscription:read: list and view subscriptionsnotification:subscription:write: create and update subscriptions
Quick start
1
Set up your webhook endpoint
Your endpoint must:
- Accept HTTP POST requests
- Return a
2xxstatus code to acknowledge receipt - Be publicly accessible over HTTPS
200 OK immediately and queue the work.2
Create a subscription
201 Created:3
Verify your subscription
"isActive": true.Managing subscriptions
List subscriptions
Receive events for organizations below you
By default a subscription only receives events for your own organization ("scope": "SELF"). A bank, platform partner or fintech partner can set "scope": "DESCENDANTS" to also receive banking events for every business customer below it:
DESCENDANTS applies to the ledger and account event types (LEDGER_TRANSACTION, LEDGER_POSTING_EXCEPTION, LEDGER_ACCOUNT_EXCEPTION, ACCOUNT_STATUS_CHANGED and ACCOUNT_RESTRICTION_CHANGED). Other event types ignore scope.
Get a subscription
Update a subscription
UsePATCH to update the webhook URL:
Deactivate a subscription
Inactive subscriptions can’t be updated. To reactivate, set
"isActive": true first, then
apply further changes.