Phone calls
Have an agent place outbound calls, answer inbound calls on your numbers, and read transcripts and outcomes.
Place a call#
Needs agents.write and at least one phone number on the account. to must be E.164.
curl -X POST https://api.voicemint.io/api/v1/agents/calls \
-H "Authorization: Bearer $VOICEMINT_API_KEY" -H "Content-Type: application/json" \
-d '{"agent_id": "AGENT_ID", "to": "+919876543210", "variables": {"name": "Asha", "order_id": "A-77"}}'
# -> 201 {"call_id": "...", "status": "ringing", "credits_reserved": 50, ...}from_number_id picks the number to call from (default: your default number). Calls are limited per account (3 a minute, 30 an hour by default: 429). A few minutes of credits are held when the call starts and the unused part is returned when it ends; the call is billed per started minute as the phone provider reports it. A call the agent never answered (busy, no answer, our engine at capacity) is not billed.
Read the outcome#
GET /agents/calls/{call_id} returns the status, end_reason, duration, billable minutes, transcript, summary, sentiment, voicemail, dispositions (extracted fields) and any workflows run during the call. GET /agents/calls lists calls with filters (agent_id, status, date_from, date_to). For real-time updates, subscribe to call.ended webhooks instead of polling.
Inbound calls and numbers#
Route a number to an agent and it answers calls to that number:
curl -X PATCH https://api.voicemint.io/api/v1/agents/numbers/NUMBER_ID \
-H "Authorization: Bearer $VOICEMINT_API_KEY" -H "Content-Type: application/json" \
-d '{"agent_id": "AGENT_ID"}'Numbers also take business hours, holidays and after-hours actions (routing), and caller screening (block and allow lists).
Buying numbers#
GET /agents/numbers/available searches a provider's numbers and POST /agents/numbers buys one. With an API key this needs the separate numbers.purchase permission (not included in agents.write or all.write): buying spends real money. The number's setup price and first month's rent are charged from your credits before the purchase (refunded if the provider refuses), and the account owner gets an email. The rent then renews every 30 days; if it cannot be charged the number becomes past_due, is retried daily and is released after a grace period. GET /agents/numbers/billing shows the prices, your balance and limits, and every number charge. Errors: 402 not enough credits, 429 daily or total number limit reached, 503 number pricing not configured yet. Releasing a number (DELETE /agents/numbers/{id}) needs the same permission. Indian numbers need an approved India compliance application (see Security & compliance).