AloAi outbound call API

Have an AloAi voice agent call a contact.

Start a call from an AloAi voice agent to a contact, triggered by your own system: a new lead, a missed appointment, a form fill. You pick the agent and the contact, and optionally the line it calls from. If the number isn't a contact yet, Aloware creates one, and the call lands in the contact's history.

  • Method: POST
  • Auth: your account API token, in the body as api_token
  • Format: JSON in, JSON out
  • Required: api_token, bot_id, and who to call (to, contact_phone_number or contact_id)
Billed: AloAi calls through the API count as automated, paid usage under Aloware's billing terms.

Endpoint

POST /api/v1/webhook/aloai-outbound-call

Fields

api_tokenRequired. Your Aloware API token.
bot_idRequired. The AloAi bot that makes the call. It must be an outbound voice bot in your account.
toThe contact's number, in E.164 format. Same as contact_phone_number, named like the SMS API.
contact_phone_numberThe contact's number, in E.164 format.
contact_idThe ID of a contact already in Aloware.
fromOne of your line's numbers to call from, in E.164 format. Same as line_phone_number.
line_phone_numberOne of your line's numbers to call from, in E.164 format.
line_idThe ID of the line to call from.

Send one of to, contact_phone_number or contact_id. Leave the line out and the call comes from the bot's default outbound line.

Request examples

With phone numbers

{
    "api_token": "[API_TOKEN]",
    "bot_id": 1,
    "from": "+18552562001",
    "to": "+18181234567"
}

An existing contact, from a line

curl -X POST \
  https://app.aloware.io/api/v1/webhook/aloai-outbound-call \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "api_token": "[API_TOKEN]",
    "bot_id": 1,
    "line_id": 1234,
    "contact_id": 456
  }'

From the bot's default line

{
    "api_token": "[API_TOKEN]",
    "bot_id": 1,
    "to": "+18181234567"
}

Responses

202: call started

{
    "message": "AloAi outbound call initiated."
}

429: at the limit

Your account already has as many AloAi outbound calls running as it's allowed. No call is queued. The Retry-After header says how many seconds to wait before you try again.

{
    "errors": {
        "rate_limit": [
            "Oops! This account has reached its AloAi outbound call limit. Please retry in a moment."
        ]
    }
}

422: not started

The errors object names each field that is missing or wrong.

{
    "message": "The given data was invalid.",
    "errors": {
        "bot_id": [
            "The bot_id must be a valid outbound voice AloAi bot belonging to your company."
        ]
    }
}

Safe retries

This endpoint takes an optional Idempotency-Key header, so a retry after a timeout runs only once. See Safe retries.

Put your own Aloware API token in place of [API_TOKEN].

Need another endpoint?

For other API functions or any question about this one, email support@aloware.com with what you're trying to do.

Need a hand?

Our support team can help you set this up.

Contact support