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
| Property | Value |
|---|---|
| Function Name | verify-telephony-config |
| HTTP Method | GET |
| Authentication | Supabase JWT (Bearer token) |
| Required Role | Any 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
| Status | Condition |
|---|---|
| 401 | Missing or invalid authorization header |
| 403 | User is not an agency user |
| 405 | HTTP method is not GET |
| 500 | Failed to retrieve agency credentials |
| 500 | Internal server error |
| 502 | Ultravox 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_credentialsRPC function - Builds a
virsyn_dbstatus 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
ultravoxstatus 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: trueonly when both the Virsyn DB and Ultravox report telephony as configured
Database Tables Read
| Table | Operation | Purpose |
|---|---|---|
users | Read | Verify agency membership |
RPC Functions Called
| Function | Purpose |
|---|---|
get_agency_credentials | Retrieve credentials and resource IDs for comparison |
External APIs Called
| API | Method | Endpoint | Purpose |
|---|---|---|---|
| Ultravox | GET | /api/accounts/me/telephony_config | Fetch current Telnyx configuration from Ultravox |
Related Functions
- Provision Telephony -- Run full provisioning to fix configuration issues
- Import Telnyx to Ultravox -- Re-sync Telnyx config to Ultravox if out of sync