Getting started
Quickstart
Five requests from zero to your phone ringing. Everything runs against https://klaw-voice.netlify.app.
1. Create an account
curl -X POST https://klaw-voice.netlify.app/api/auth/signup \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","name":"Your Name","password":"a-strong-password"}'
The response includes {"token": "..."} — a session token you can use as a Bearer token immediately. For long-lived integrations mint an API key instead (step 2).
2. Mint an API key
curl -X POST https://klaw-voice.netlify.app/api/auth/api-key -H "Authorization: Bearer $TOKEN"
Returns a klw_... key once — store it now; only a hash is kept server-side. Use it as Authorization: Bearer klw_... on every call below. See Authentication.
3. Create an agent — persona, voice, and number in one call
curl -X POST https://klaw-voice.netlify.app/api/agents/quickstart \
-H "Authorization: Bearer $KLAW_KEY" -H "Content-Type: application/json" \
-d '{
"preset": "receptionist",
"business_name": "Sunrise Dental",
"instructions": "You are the friendly front desk for Sunrise Dental. Book cleanings, answer hours questions, capture callbacks.",
"voice_id": "EXAVITQu4vr4xnSDxMaL",
"with_number": true,
"area_code": "415"
}'
Response: {"agent": {...}, "phone_number": "+1415...", "number_error": null}. Only preset is required — everything else is optional refinement. If number provisioning fails you still get the agent plus a number_error you can retry.
4. Hear it — the agent calls you
curl -X POST https://klaw-voice.netlify.app/api/agents/$AGENT_ID/test-call \
-H "Authorization: Bearer $KLAW_KEY" -H "Content-Type: application/json" \
-d '{"phone":"+14155550132"}'
Your phone rings within seconds. US/Canada numbers only; capped at 5 test calls per day.
5. Watch the transcript
curl https://klaw-voice.netlify.app/api/calls/$CALL_ID -H "Authorization: Bearer $KLAW_KEY"
Poll every few seconds while the call runs — the response carries status and a growing transcript array. Terminal statuses: completed, failed, busy, no-answer, canceled.
Next
- Place a call with objectives and idempotency.
- Receive calls on your new number.
- Webhooks instead of polling.