Skip to main content

Verify Telephony Config

Checks whether Telnyx is properly configured in the agency's Ultravox account and compares the configuration state between the Virsyn database and Ultravox. Useful for debugging telephony issues, verifying after provisioning, and detecting configuration drift.

Endpoint

PropertyValue
Function Nameverify-telephony-config
HTTP MethodGET
AuthenticationSupabase JWT (Bearer token)
Required RoleAny authenticated agency user

Request

Headers

Authorization: Bearer <supabase_jwt_token>

Query Parameters

No query parameters.

Response

Success (200)

{
"virsyn_db": {
"has_ultravox_key": true,
"has_telnyx_key": true,
"has_telnyx_public_key": true,
"telnyx_application_id": "app-id-string",
"telnyx_outbound_profile_id": "profile-id-string",
"telephony_configured": true
},
"ultravox": {
"telnyx_configured": true,
"has_api_key": true,
"has_public_key": true,
"application_id": "app-id-string",
"call_creation_allow_all_agents": true,
"api_key_prefix": "KEY...",
"public_key_prefix": "PUB..."
},
"in_sync": true,
"sync_issues": null,
"ready_for_calls": true
}

When the Ultravox API key is not configured, ultravox will be null with an error message:

{
"virsyn_db": {
"has_ultravox_key": false,
"has_telnyx_key": false,
"has_telnyx_public_key": false,
"telnyx_application_id": null,
"telnyx_outbound_profile_id": null,
"telephony_configured": false
},
"ultravox": null,
"error": "Ultravox API key not configured"
}

Sync Issues Detected

When configurations are out of sync, sync_issues will contain descriptive strings:

{
"in_sync": false,
"sync_issues": [
"Application ID mismatch between Virsyn and Ultravox",
"Virsyn shows configured but Ultravox has no Telnyx config"
],
"ready_for_calls": false
}

Error Responses

StatusCondition
401Missing or invalid authorization header
403User is not an agency user
405HTTP method is not GET
500Failed to retrieve agency credentials
500Internal server error
502Ultravox API returned an error

Behavior

  • Authenticates the user via Supabase JWT and verifies they belong to an agency
  • Retrieves agency credentials using the get_agency_credentials RPC function
  • Builds a virsyn_db status object showing which credentials exist and what resource IDs are stored
  • If the Ultravox API key is present, fetches the current telephony configuration from Ultravox via GET https://api.ultravox.ai/api/accounts/me/telephony_config
  • Builds an ultravox status object with Telnyx configuration details (key prefixes shown for verification without exposing full keys)
  • Compares the two configurations and identifies sync issues:
    • Application ID mismatch between Virsyn and Ultravox
    • Virsyn marked as configured but Ultravox has no Telnyx config
    • Ultravox has Telnyx config but Virsyn is not marked as configured
  • Returns ready_for_calls: true only when both the Virsyn DB and Ultravox report telephony as configured

Database Tables Read

TableOperationPurpose
usersReadVerify agency membership

RPC Functions Called

FunctionPurpose
get_agency_credentialsRetrieve credentials and resource IDs for comparison

External APIs Called

APIMethodEndpointPurpose
UltravoxGET/api/accounts/me/telephony_configFetch current Telnyx configuration from Ultravox