Immediate call with curl
Reads the base URL and API key from the shell environment and keeps the client-generated idempotency key in the request header.
: "${AI_CALLS_API_KEY:?set AI_CALLS_API_KEY}"
: "${AI_CALLS_BASE_URL:?set AI_CALLS_BASE_URL}"
curl -sS -X POST "${AI_CALLS_BASE_URL%/}/api/v1/call-tasks" \
-H "authorization: Bearer ${AI_CALLS_API_KEY}" \
-H "content-type: application/json" \
-H "idempotency-key: call-$(date -u +%Y%m%dT%H%M%SZ)-001" \
--data '{
"profileId": "<CALL_PROFILE_ID>",
"countryCode": "US",
"toNumber": "<E164_PHONE_NUMBER>",
"toName": "Example Contact",
"schedule": { "mode": "now" },
"variables": {
"customerName": "Example Contact",
"reason": "appointment reminder"
}
}'