Webhooks for pre-recorded audio
Webhooks for pre-recorded audio
Webhooks for pre-recorded audio
Webhooks are custom HTTP callbacks that you can define to get notified when your pre-recorded audio transcripts are ready.
This guide covers webhooks for pre-recorded audio transcription. For webhooks with streaming audio, see Webhooks for streaming speech-to-text.
To use webhooks, you need to set up your own webhook receiver to handle webhook deliveries.
Create a test webhook endpoint with webhook.site to test your webhook integration.
To create a webhook, set the webhook_url parameter when you create a new transcription. The URL must be accessible from AssemblyAI’s servers.
When the transcript is ready, AssemblyAI will send a POST HTTP request to the URL that you specified.
Your webhook endpoint must return a 2xx HTTP status code within 10 seconds to indicate successful receipt. If a 2xx status is not received within 10 seconds, AssemblyAI will retry the webhook call up to a total of 10 attempts. If at any point your endpoint returns a 4xx status code, the webhook call is considered failed and will not be retried.
AssemblyAI sends all webhook deliveries from fixed IP addresses:
The webhook delivery payload contains a JSON object with the following properties:
The webhook payload only contains the transcript_id and status. It doesn’t include the transcript text or error details. If the status is "error", make a GET /v2/transcript/{transcript_id} request to retrieve the error message from the error field in the response. See Retrieve a transcript with the transcript ID below.
When you retrieve the transcript using the transcript ID, the JSON response will include a webhook_status_code field. This field contains the HTTP status code that AssemblyAI received when calling your webhook endpoint, allowing you to verify that the webhook was delivered successfully.
You can authenticate webhook deliveries from AssemblyAI by including a custom HTTP header in the request.
To add an authentication header, include the auth header name and value in set_webhook().
To add an authentication header, include the auth header name and value in set_webhook().
To associate metadata for a specific transcription request, you can add your own query parameters to the webhook URL.
Now, when you receive the webhook delivery, you’ll know the customer who requested it.
Webhook deliveries can fail for multiple reasons. For example, if your server is down or takes more than 10 seconds to respond.
If a webhook delivery fails, AssemblyAI will attempt to redeliver it up to 10 times, waiting 10 seconds between each attempt. If all attempts fail, AssemblyAI considers the delivery as permanently failed.