Endpoint reference

Create an outbound Voice AI call.

Use this endpoint when a tenant application needs StateSet Voice to place a customer-facing call with a specific phone route, agent, and greeting.

Endpoint contract

PropertyValue
MethodPOST
Path/api/v1/make-call
AuthenticationAuthorization: Bearer ${STATESET_VOICE_API_KEY}
Content typeapplication/json
Primary useCreate an outbound call for a tenant-scoped Voice AI Agent.

Request body

FieldRequiredDescription
toYesCustomer destination phone number. Use E.164 format for production traffic.
fromNoCaller ID or Twilio number. Defaults to the tenant phone route when omitted.
agent_keyNoStable agent key that resolves to the published production agent version.
agent_version_idNoExplicit agent version for controlled rollout, QA, or staged testing.
greetingNoOpening message for the outbound call. Keep this approved by the business owner.
org_idNoOrganization context when one tenant serves multiple business units.

Example request

curl -sS -X POST "https://voice.stateset.app/api/v1/make-call" \
  -H "Authorization: Bearer ${STATESET_VOICE_API_KEY}" \
  -H "content-type: application/json" \
  -d '{
    "to": "+15555555678",
    "from": "+15555551234",
    "agent_key": "support_primary",
    "greeting": "Hi, this is Acme calling about your appointment."
  }'

Example response

{
  "ok": true,
  "call_sid": "CA1234567890abcdef1234567890abcdef",
  "status": "queued",
  "to": "+15555555678",
  "from": "+15555551234"
}

Error and retry behavior

StatusActionNotes
400Do not retry automatically.Fix phone number, route, payload, agent key, or tenant configuration.
401/403Rotate or scope credentials.Tenant runtime keys must not be confused with admin keys.
429Back off with jitter.Preserve a business idempotency key so retries cannot create duplicate customer calls.
500/503Retry only when call creation is not already accepted.Reconcile against call logs before issuing a second call.

Production checklist

  • Persist call_sid with the business workflow that requested the call.
  • Reconcile final state from GET /api/v1/call-logs and webhook events.
  • Gate outbound traffic by tenant, phone route, allowed hours, DNC policy, and launch approval.
  • Alert on failed call creation, no-answer spikes, provider failures, and duplicate-call prevention.