Custom Headers
The simplest way to authenticate data connections is to pass headers that your server can check. Use theheaders field in the data connection config to send literal key-value pairs on the outbound WebSocket connection.
Data connection with custom headers
Shared Secrets
For stronger verification, shared secrets let your server cryptographically verify that a connection is from Ultravox and hasn’t been tampered with. Ultravox uses HMAC-SHA256 signatures — when shared secrets are configured, every outbound data connection WebSocket request includes three headers:| Header | Description |
|---|---|
X-Ultravox-Call-ID | The UUID of the call initiating the connection. |
X-Ultravox-Signature-Timestamp | ISO 8601 UTC timestamp of when the connection was made. |
X-Ultravox-Signature | HMAC-SHA256 signature(s), comma-separated if multiple secrets are configured. |
Setting Shared Secrets
Shared secrets can be set at the call level or on an agent’s call template. Secrets must be between 16 and 127 characters. They are write-only and never returned in API responses.Setting shared secrets during call creation
Setting shared secrets on an agent template
Verifying Signatures
When your data connection server receives an incoming WebSocket connection from Ultravox, verify it with these steps:Timestamp Verification
- The
X-Ultravox-Signature-Timestampheader contains the time the connection was initiated. - Verify that this timestamp is recent (e.g. within the last minute) to prevent replay attacks.
Signature Verification
- Ultravox signs each connection using HMAC-SHA256.
- The signature is in the
X-Ultravox-Signatureheader. - To verify:
- Concatenate the call ID (
X-Ultravox-Call-ID) with the timestamp. - Create an HMAC-SHA256 hash using your shared secret as the key.
- Compare this hash with the provided signature.
- Concatenate the call ID (
Verifying Data Connection Signature
Multiple Signatures
- The
X-Ultravox-Signatureheader may contain multiple comma-separated signatures. - This supports key rotation without downtime — configure both old and new secrets, then remove the old one once your server is updated.
- Your server should check if any of the provided signatures match.