This guide covers webhooks for pre-recorded audio
transcription. For webhooks with
streaming audio, see Webhooks for streaming
speech-to-text.
Create a webhook for a transcription
- Python
- Python SDK
- JavaScript
- JavaScript SDK
To create a webhook, set the
webhook_url parameter when you create a new transcription. The URL must be accessible from AssemblyAI’s servers.Handle webhook deliveries
When the transcript is ready, AssemblyAI will send aPOST 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.
Static Webhook IP addressesAssemblyAI sends all webhook deliveries from fixed IP addresses:
| Region | IP Address |
|---|---|
| US | 44.238.19.20 |
| EU | 54.220.25.36 |
Delivery payload
The webhook delivery payload contains a JSON object with the following properties:| Key | Type | Description |
|---|---|---|
transcript_id | string | The ID of the transcript. |
status | string | The status of the transcript. Either completed or error. |
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.
Webhook status code
When you retrieve the transcript using the transcript ID, the JSON response will include awebhook_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.
Retrieve a transcript with the transcript ID
- Python
- Python SDK
- JavaScript
- JavaScript SDK
Authenticate webhook deliveries
You can authenticate webhook deliveries from AssemblyAI by including a custom HTTP header in the request.- Python
- JavaScript
To add an authentication header, include the auth header name and value in
set_webhook().- Python
- Python SDK
- JavaScript
- JavaScript SDK
To add an authentication header, include the auth header name and value in
set_webhook().