If you want to receive automatic alerts regarding Rollee's successful tasks regarding your Users, Accounts or endpoints, Webhooks provide a solution for it. The User API allows you to configure Webhooks related to Account and User events. These events are for example when an Account is connected/updated, when a User is created / updated / deleted and when Rollee has new data for a specific account and endpoint.

Setting up Webhooks

Webhooks are simply HTTP requests done from Rollee Backend whenever an event happens. When setting up a Webhook, we allow you to specify:

  • the URL the request is made;
  • the method of the HTTP request (POST or PUT);
  • additional headers sent in the request (for identification or security purposes)

To create a Webhook, check our API for Webhooks or you can do the following requests:

User events

Set up request:

curl -X PUT -H "Authorization: Bearer <YOUR_TOKEN>" --url 'https://api.getrollee.com/api/v0.5/webhooks/users' -d '{"url": "<YOUR_URL>", "method": "POST", "headers": {"your_header":"<YOUR_HEADER>"} }'
curl -X PUT -H "Authorization: Bearer <YOUR_TOKEN>" --url 'https://api.sand.getrollee.com/api/v0.5/webhooks/users' -d '{"url": "<YOUR_URL>", "method": "POST", "headers": {"your_header":"<YOUR_HEADER>"} }'

Example of the content that you will receive:

{
    "action": "create_user",     # this can be also update_user or delete_user
    "data": {
        "accounts_number": 0,
        "created_at": "2024-04-25T19:32:49.765013012Z",
        "id": "d8ee0653-1293-47fe-990c-45971109de76",
        "link": "https://connectv2.stage.getrollee.com/v0.4/session/11123432-45d1-4557-5ffe-432199401b23",
        "session": "11123432-45d1-4557-5ffe-432199401b23",
        "session_expires_at": "2024-04-26T19:32:49.790255Z"
    }
}

Account events

Set up request:

curl -X PUT -H "Authorization: Bearer <YOUR_TOKEN>" --url 'https://api.getrollee.com/api/v0.5/webhooks/accounts' -d '{"url": "<YOUR_URL>", "method": "POST", "headers": {"your_header":"<YOUR_HEADER>"} }'
curl -X PUT -H "Authorization: Bearer <YOUR_TOKEN>" --url 'https://api.sand.getrollee.com/api/v0.5/webhooks/accounts' -d '{"url": "<YOUR_URL>", "method": "POST", "headers": {"your_header":"<YOUR_HEADER>"} }'

Example of the content that you will receive:

{
    "action": "create_account",     # this can be also update_account
    "data": {
        "connected": false,
        "created_at": "2024-04-25T19:35:45.403630579Z",
        "datasource_id": "c547aea6-cd31-4283-b380-76aee3822976",
        "id": "a0c39256-8183-4c38-8960-e1eaf0a47381",
        "updated_at": "2024-04-25T19:35:45.403630579Z",
        "user_id": "d8ee0653-1293-47fe-990c-45971109de76"
    }
}

Endpoint events

curl -X PUT -H "Authorization: Bearer <YOUR_TOKEN>" --url 'https://api.getrollee.com/api/v0.5/webhooks/endpoints' -d '{"url": "<YOUR_URL>", "method": "POST", "headers": {"your_header":"<YOUR_HEADER>"} }'
curl -X PUT -H "Authorization: Bearer <YOUR_TOKEN>" --url 'https://api.sand.getrollee.com/api/v0.5/webhooks/accounts' -d '{"url": "<YOUR_URL>", "method": "POST", "headers": {"your_header":"<YOUR_HEADER>"} }'

Example of the content that you will receive:

{
    "action": "update_endpoint",
    "data": {
        "account_id": "e8aa62c6-b5ac-4b0b-bb07-faee7cec9e0b",
        "end_date": 1714033804,
        "endpoint": "profile",    # this will contain the name of the endpoint so it can be also income, activity, wallet, etc
        "request_id": "64cfa098-3a27-450c-89b3-d0892d856461",
        "start_date": 1713744000,
        "user_id": "d8ee0653-1293-47fe-990c-45971109de76"
    }
}

This kind of Webhook is intended to be used as a notification to inform that new data is available. The source of truth for the data is the API, so when a Webhook is received, it means that the API is ready to be queried on the corresponding account, endpoint and date range, and will provide up to date data for those parameters.

Retry policy

Since Webhooks usage can fail due to network issues, Rollee's Webhook implementation has a retry policy that ensure that you will receive all events at least once. The events are retried for a period of 3 days.