Webhooks

This feature requires a premimum subscription to be used. For more details, see Plans and pricing.

Hybiscus supports calling webhooks (HTTP POST requests) to notify you of your report being completed. You can provide a list of up to 3 webhooks to be called once your report is ready. To enable the webhooks, you must add a webhooks key to the config key in the Report schema, with a list of objects:

{
    "type": "Report",
    "config": {
        ...,
        "webhooks": [
            {
                "url": "<<WEBHOOK_URL>>",
                "auth_header": "<<AUTHORIZATION_TOKEN>>" # Optional
            }
        ]
    },
    ...
}

The auth_header key is optional, and can be used to authorize requests to your webhook endpoints. The value of auth_header will be sent in the header of the webhook request as follows:

Authorization: Bearer <<auth_header>>

Each webhook request will be a HTTP POST request with the following JSON body:

{
    "event": "report.completed",
    "task_id": "<<task_id>>",
    "url": "<<REPORT_URL>>"
}

The url key will hold the complete URL to access the report via the /api/v1/get-report endpoint (however you will still require authentication either via a header or URL query parameter. See here for more details).

Note If you have enabled cloud storage upload of your report, the URL endpoint will not work as you must access your report at your provided cloud storage location.

Failed reports

If the report fails to generate, the JSON body will be the following:

{
    "event": "report.failed",
    "task_id": "<<task_id>>",
    "url": "<<REPORT_URL>>"
}

Retries

Webhook endpoints will retried with exponential backoff, up to 8 times, with a 30 second multiplier each time. Therefore, the intervals will be 30 seconds, 1 minute, 2 minutes, 4 minutes, 8 minutes, 16 minutes, 32 minutes and finally 64 minutes.

Missing something?

Hybiscus is continuously improving and adding new features. If you think we are missing a critical feature, please do not hesitate to contact us and offer your feedback at info@hybiscus.dev