Webhooks
Learn how to setup webhooks for Soniox Speech-to-Text API.
Webhooks are custom HTTP callbacks that you can define to get notified when your transcripts are ready. To use webhooks, you need to set up your own webhook receiver to handle webhook deliveries.
Create a webhook for a transcription
To create a webhook, use webhook_url
when creating a transcription. The URL
must be accessible from Soniox's servers.
Code example using webhook url as payload:
For easier development on your local machine, you can use tools like Cloudflare tunnel, ngrok or VS Code port forwarding to receive webhooks locally.
Handle webhook deliveries
When the transcript is ready or an error has occurred, Soniox will send a POST HTTP request to the URL that you specified.
Delivery payload
id
stringThe ID of the transcription.
status
stringThe status of the transcription. Possible values are completed
and error
.
Example:
Authenticate webhook deliveries
You can authenticate webhook deliveries from Soniox by including a custom HTTP header in the request.
Add webhook_auth_header_name
and webhook_auth_header_value
parameters
when creating a transcription.
Example:
Add metadata to webhook deliveries
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.
Handling failed webhook deliveries
Webhook deliveries can fail for multiple reasons. For example, if your server is down or takes too long to respond.
If a webhook delivery fails, Soniox will attempt to redeliver it multiple times. If all attempts fail, Soniox considers the delivery as permanently failed.
When creating a transcription you will get an ID of the transcription. If the webhook delivery fails, you can use this ID to retrieve the transcript later.