Use this file to discover all available pages before exploring further.
Webhooks allow you to receive the complete transcript via HTTP callback when a streaming session ends. This is in addition to the real-time WebSocket responses you receive during the session, such as partial and finalized turns. These WebSocket messages are delivered continuously as audio is processed, while the webhook is sent once after the session terminates and contains only the finalized turns.
When the streaming session ends, AssemblyAI sends a POST HTTP request to the URL you specified. The webhook contains the complete transcript from the session.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:
The webhook delivery payload contains the complete transcript from the streaming session as a JSON object. The payload includes the session ID and an array of messages containing all the transcript turns.
{ "session_id": "273e79fd-99e9-4e1d-91da-90f56a132d01", "messages": [ { "turn_order": 0, "turn_is_formatted": true, "end_of_turn": true, "transcript": "Smoke from hundreds of wildfires in Canada is triggering air quality alerts throughout the US Skylines from Maine to Maryland to Minnesota are gray and smoggy, and in some places the air.", "end_of_turn_confidence": 0.5005, "words": [ { "start": 4880, "end": 5040, "text": "Smoke", "confidence": 0.76054, "word_is_final": true }, { "start": 5280, "end": 5360, "text": "from", "confidence": 0.761065, "word_is_final": true } ], "utterance": "", "type": "Turn" } ]}
Key
Type
Description
session_id
string
The unique identifier for the streaming session.
messages
array
An array of transcript turn objects from the session.
messages[].turn_order
integer
The order of the turn in the session (0-indexed).
messages[].turn_is_formatted
boolean
Whether the transcript has been formatted.
messages[].end_of_turn
boolean
Whether this message represents the end of a turn.
messages[].transcript
string
The transcribed text for this turn.
messages[].end_of_turn_confidence
number
Confidence score for the end of turn detection.
messages[].words
array
Word-level details including timestamps and confidence scores.
To secure your webhook endpoint, you can include custom authentication headers in the webhook request. When configuring your streaming session, provide the webhook_auth_header_name and webhook_auth_header_value parameters.AssemblyAI will include this header in the webhook request, allowing you to verify that the request came from AssemblyAI.
When implementing webhooks for streaming speech-to-text, consider the following best practices:
Always verify authentication: If you configure an authentication header, always verify it in your webhook receiver to ensure requests are from AssemblyAI.
Respond quickly: Return a response from your webhook endpoint as quickly as possible. If you need to perform time-consuming processing, do it asynchronously after returning the response.
Handle failures gracefully: Your webhook endpoint should handle errors gracefully and return appropriate HTTP status codes.
Use HTTPS: Always use HTTPS for your webhook URL to ensure the transcript data is encrypted in transit.
Log webhook deliveries: Keep logs of webhook deliveries for debugging and auditing purposes.