Validate Ultravox Key
Validates an Ultravox API key by making a lightweight GET request to the Ultravox calls endpoint. Returns whether the key is valid without storing it.
Endpoint
| Property | Value |
|---|---|
| Function Name | validate-ultravox-key |
| HTTP Method | POST |
| Authentication | Supabase JWT (Bearer token) |
| Required Role | Any authenticated user |
Request
Headers
Authorization: Bearer <supabase_jwt_token>
Content-Type: application/json
Body
| Field | Type | Required | Description |
|---|---|---|---|
api_key | string | Yes | The Ultravox API key to validate |
Response
Success (200)
{
"valid": true
}
Invalid Key (200)
{
"valid": false
}
Error Responses
| Status | Condition |
|---|---|
| 401 | Missing or invalid authorization header |
| 405 | HTTP method is not POST |
| 500 | Internal server error during validation |
Behavior
- Authenticates the user via Supabase JWT
- Extracts
api_keyfrom the request body - If
api_keyis missing, returns{ "valid": false, "error": "API key is required" }with status 200 - Makes a test request to
GET https://api.ultravox.ai/api/calls?limit=1using theX-API-Keyheader - Returns
{ "valid": true }if the Ultravox API responds with HTTP 200 - Returns
{ "valid": false }if the request fails for any reason - Does not store the key -- this is a validation-only function
External APIs Called
| API | Method | Endpoint | Purpose |
|---|---|---|---|
| Ultravox | GET | /api/calls?limit=1 | Lightweight test to verify API key validity |
Related Functions
- Save Ultravox Integration -- Validate and store the Ultravox API key
- Validate Telnyx Key -- Validate a Telnyx API key