Base URL: https://api.lionvoice.app/api/v1. Sprache, Lion-AI und Telefonie — ein Produkt. Das Gehirn heißt überall Lion-AI; Engine-IDs sind intern und in API-Antworten optional.
Base URL: https://api.lionvoice.app/api/v1
Die API hat keinen Modellwahl-Parameter — Lion-AI ist das einzige sichtbare Gehirn.
5-Minuten-Quick-Start für Entwickler
1. Erzeuge im Dashboard einen API-Key (API keys) — das Secret erscheint nur einmal. 2. Lege einen Agenten an. 3. Hänge eine Telefonnummer (E.164) an und mappe sie. 4. Starte einen Test-Outbound-Anruf.
export LV_KEY='lv_live_…'
# 1) who am I
curl -sS https://api.lionvoice.app/api/v1/tenant \
-H "Authorization: Bearer $LV_KEY"
# 2) create an agent
curl -sS https://api.lionvoice.app/api/v1/agents \
-H "Authorization: Bearer $LV_KEY" \
-H "Content-Type: application/json" \
-d '{
"name":"Reception",
"language":"en",
"voice":"Lion-AI Warm",
"prompt":"You are a receptionist. Address the caller as you.",
"first_message":"Hi, how can I help?",
"max_duration_sec":600
}'
# 3) attach a number
curl -sS https://api.lionvoice.app/api/v1/phone-numbers \
-H "Authorization: Bearer $LV_KEY" \
-H "Content-Type: application/json" \
-d '{"number_e164":"+37052636333","label":"Reception"}'
# 4) test outbound (use your own test line)
curl -sS https://api.lionvoice.app/api/v1/calls \
-H "Authorization: Bearer $LV_KEY" \
-H "Content-Type: application/json" \
-d '{"to_number":"+447554522255","agent_id":1}'
Authentifizierung
Create a key in the dashboard (API keys) or POST /keys. The secret is shown once. Send it as Bearer or X-LV-Api-Key. Ping does not need a key. A revoked key returns 401.
Not a public REST write (password stays in the vault). Dashboard → SIP / VoIP: host, port, username, password, transport. LionVoice registers like a softphone. Then map the DID under Phone numbers.
POST/keys{"label"} — full secret only on create. DELETE /keys?id=.
POST /webhook-secret/regenerate
Headers: Authorization: Bearer lv_live_…. Rotates the HMAC key used for X-LV-Signature. The full secret is returned once (same pattern as POST /keys). GET /tenant never returns it. After rotate, the previous secret stops verifying immediately — update your receiver first.
curl -sS -X POST https://api.lionvoice.app/api/v1/webhook-secret/regenerate \
-H "Authorization: Bearer $LV_KEY"
# Response 201
{
"ok": true,
"webhook_secret": "hex64…",
"prefix": "269d7d4b",
"note": "Save this secret now — it is not returned on GET /tenant."
}
Webhooks
Setze webhook_url am Agenten (nur https). Nach jedem beendeten Anruf POSTet LionVoice JSON einmal (8 s). Prüfe X-LV-Signature mit dem Secret aus POST /webhook-secret/regenerate (einmal sichtbar; GET /tenant nur Prefix). 2xx = OK. Event: call.completed.
Beginner — Create a webhook
Dashboard → Webhooks: URL + events → Create. Secret shown once. Test webhook. Snippet to verify HMAC.
HTTPS only. HMAC header X-LV-Signature: t=<unix>,v1=<hex> over timestamp + "." + raw body. Reject timestamps older than five minutes. Return 2xx. Deduplicate on id (event_id). A retry is a new delivery_id. Delivery logs store status, HTTP, time, event_id, delivery_id — not the payload.
# Headers
X-LV-Event: call.ended
X-LV-Delivery-Id: del_01J…
X-LV-Timestamp: 1757232000
X-LV-Signature: t=1757232000,v1=hexhmac
# Body (no transcript / phone in test events)
{
"id": "evt_01J…",
"type": "call.ended",
"created_at": "2026-09-07T09:00:00+00:00",
"data": {
"call_id": "6c202718-…",
"duration_sec": 84,
"status": "completed"
}
}
Developer — Webhook API
POST /v1/webhooks
GET /v1/webhooks
DELETE /v1/webhooks/{id}
POST /v1/webhooks/{id}/test
POST /v1/webhooks/{id}/rotate-secret
GET /v1/webhooks/{id}/deliveries
GET /v1/webhooks/snippet?lang=php
Same engine as the dashboard. Agent webhook_url remains a legacy subscriber for call.ended.
Fehler
Form: {"ok":false,"error":"code","message":"…"}. Wiederholbar: 429 und 5xx. Nicht: 400, 401, 403, 404. 409 meist nicht.
{
"ok": false,
"error": "insufficient_balance",
"message": "Your wallet balance is too low."
}
HTTP
Retry?
Typical error
400
No
valid_to_number_required
401
No
unauthorized
403
No
plan / cap
404
No
not_found
409
Usually no
conflict
429
Yes, exponential backoff
rate_limited
500
Yes
engine
SDKs
Offizielle Clients sind geplant. Heute: kopiere die curl-, PHP-, JavaScript- und Python-Beispiele unten. Importiere die OpenAPI-Datei (/openapi.json) in Postman.