Initiate Call - Voice API

This API allows to initiate voice calls using the Alohaa platform based on a specified campaign, targeting a particular phone number, and using either pre-recorded audio messages or text-to-speech.

Endpoint Description

POST https://voice-api.alohaa.ai/v1/call

Parameters

Request Headers

Field
Value
Description
Mandatory

Content-Type

application/json

Specifies the content type of the request.

Yes

x-metro-api-key

*************************

API key for authentication purposes.

Yes

Request Body

Field
Data Type
Description
Mandatory

campaign_id

String

The identifier for the document (audio file) to access, typically retrieved from call logs.

Yes

number

String

Target phone number (10 digits without country code).

Yes

media_type

String

Type of media to be used for the call (AUDIO or TEXT).

Yes

audio_url

String

URL to a publicly accessible audio file (.wav format). If media_type is AUDIO.

Conditional

text

String

Text to be converted into speech if media_type is TEXT.

Conditional

Good to know:

  • 'campaign_id' setup is facilitated by the Alohaa team.

  • Ensure that the 'audio_url' is publicly accessible and in the supported .wav format when using 'AUDIO'.

Sample Request

{
  "x-metro-api-key": "****************"
}

Responses

Success Response

{
  "success": true,
  "response": {
    "call_id": "7243506445d971bd24cf510e"
  }
}

Failure Response

{
  "success": false,
  "error": {
    "code": 1009,
    "reason": "Invalid schema or Missing Data sent"
  }
}

Error Codes

Code
Description

1000

Internal Server Error. Something went wrong!

1002

Invalid API key ID

1009

Invalid schema or Missing Data sent

1022

Organisation does not exist

1032

No associated DIDs found

1033

Voice API not found

1034

Error in converting text to speech

1035

audioUrl is required for mediaType AUDIO

1036

text is required for mediaType TEXT

Last updated