Skip to main content

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

PropertyValue
Function Namevalidate-ultravox-key
HTTP MethodPOST
AuthenticationSupabase JWT (Bearer token)
Required RoleAny authenticated user

Request

Headers

Authorization: Bearer <supabase_jwt_token>
Content-Type: application/json

Body

FieldTypeRequiredDescription
api_keystringYesThe Ultravox API key to validate

Response

Success (200)

{
"valid": true
}

Invalid Key (200)

{
"valid": false
}

Error Responses

StatusCondition
401Missing or invalid authorization header
405HTTP method is not POST
500Internal server error during validation

Behavior

  • Authenticates the user via Supabase JWT
  • Extracts api_key from the request body
  • If api_key is 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=1 using the X-API-Key header
  • 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

APIMethodEndpointPurpose
UltravoxGET/api/calls?limit=1Lightweight test to verify API key validity