Skip to navigation

Make Your First Call

View as Markdown

1. Find your agent ID

Open the dashboard, go to Agents, and select the agent you want to use. Copy the agent ID.

2. Set environment variables

export FORMANT_API_BASE="https://api.voice.formantai.com"
export FORMANT_API_KEY="YOUR_API_KEY"
export FORMANT_AGENT_ID="123"

3. Start a call

curl -X POST "$FORMANT_API_BASE/v1/call" \
-H "Authorization: Bearer $FORMANT_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"agent_id\": $FORMANT_AGENT_ID,
\"parameters\": [
{ \"name\": \"customer_phone\", \"value\": \"+919876543210\" },
{ \"name\": \"customer_name\", \"value\": \"Rahul\" }
]
}"

4. Store the response

Save the returned trace_id. If your request includes a conversation_id, save that too.

5. Check results

curl "$FORMANT_API_BASE/v1/conversations?agent_id=$FORMANT_AGENT_ID&limit=20" \
-H "Authorization: Bearer $FORMANT_API_KEY"

6. Move to production

  • Add idempotency_key to prevent duplicate calls.
  • Configure webhooks for call completion events.
  • Monitor 429 responses and concurrent call limits.
  • Store conversation_id, trace_id, and webhook event_id in your system.