Handling webhooks with Python SDK
Use webhooks to receive transcription results with the Soniox Python SDK
Python SDK provides helper functions to work with Webhooks.
Configure webhook delivery
If webhook is enabled during transcription creation, Soniox will send a POST request to your webhook URL with the transcription status result.
For transcribe, you must pass webhook_auth_header_name and webhook_auth_header_value explicitly in the config.
Environment variables (SONIOX_API_WEBHOOK_HEADER and SONIOX_API_WEBHOOK_SECRET) are only used by webhook helpers
and verification (see below).
You can also append additional metadata as query parameters:
If you are uploading a local file, you can also use the convenience helper (reads webhook secret and header automatically from environment if present):
Example (FastAPI + ngrok)
Expose your local server (for example with ngrok), then create a transcription that points to the public ngrok URL and verify the webhook payload on your FastAPI server:
Webhook verification
Verify webhook signatures to ensure the request really came from Soniox (and not a third party posting to your endpoint).
You can verify signatures manually:
Or rely on unwrap to validate and parse in one step:
If you prefer, you can also use client.stt.transcribe_file_with_webhook and client.webhooks
with SONIOX_API_WEBHOOK_HEADER and SONIOX_API_WEBHOOK_SECRET set in your environment.