Webhooks
If the optional notification_config
parameter is provided, the API will make an HTTP POST request to the URL specified in that parameter with details in the request body when the job either completes successfully or fails.
To use a webhook URL with restricted access, authorization headers can also be provided in the notification_config
parameter.
Details on using the notification_config
parameter can be found on the submission details page.
Here is an example of the POST request body sent after a successful topic extraction job:
{
"job": {
"id": "r3PVAeLM4sjr",
"created_on": "2022-02-01T15:34:37.913Z",
"completed_on": "2022-02-01T15:34:47.189Z",
"metadata": "This is a test",
"status": "completed",
"type": "topic_extraction"
}
}
attention
-
The API will make a POST request, not a GET request, to the
notification_config.url
parameter. The request body will contain the job details. -
You can unsubscribe from a webhook by responding to the webhook request with a
200
response code. -
If a webhook invocation does not receive a
200
response, Rev AI will retry the callback URL every 30 minutes until either 24 hours have passed or a200
response code is received.
Good third-party tools for webhook testing are Webhook.site and RequestBin.
Learn the basics of webhooks and then see an example of sending email notifications on job completion with webhooks.