Calls

Save organization-level Voice AI configuration (superadmin)

POST
/api/calls/voice-ai/config

Persists the AI voice provider selection, ElevenLabs API key, and Sinch application credentials. Optionally generates a fresh ElevenLabs tool secret (32-byte hex). After save, attempts to auto-configure the ElevenLabs workspace post-call webhook and stores the returned HMAC webhookSecret. Webhook configuration failures are logged but don't fail the save. Superadmin only.

A regenerated tool secret is also pushed into the org's ElevenLabs workspace secret, which every registered webhook tool header references; if that push fails the response carries toolSecretSyncFailed: true and voice tool calls will fail auth until a re-save succeeds.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Only the supplied fields are updated (no field is required, since admins partially edit).

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/api/calls/voice-ai/config" \  -H "Content-Type: application/json" \  -d '{    "aiVoiceProvider": "elevenlabs",    "elevenlabsApiKey": "sk_eleven_xxxxxxxxxxxxxxxx",    "generateToolSecret": true,    "sinchSipDomain": "use1.vp.sip.sinch.com"  }'
{  "success": true,  "message": "Configuration saved"}