Send advanced voice message

This method allows you to send advanced voice messages to one or more destination addresses.

Please log in to see full path URL. Learn why.
post
/tts/3/advanced
Request Body schema:
collapse all -
bulkId
string

The ID which uniquely identifies the request.

messages
required
Array of objects

Array of messages to be sent, one object per every message

Array
audioFileUrl
string

An audio file can be delivered as a voice message to the recipients. An audio file must be uploaded online, so that the existing URL can be available for file download. Size of the audio file must be below 4 MB. Supported formats of the provided file are aac, aiff, m4a, mp2, mp3, mp4 (audio only), ogg, wav and wma. Our platform needs to have permission to make GET and HEAD HTTP requests on the provided URL. Standard http ports (like 80, 8080, etc.) are advised.

callTimeout
integer <int32>

Maximum possible duration of the call to be set, shown in seconds.

callTransfers
Array of objects

Call transfers object enables transferring the ongoing call to another recipient(s) and establish a communication between your original recipient and additional one.

Array
callTransferMaxDuration
integer <int32>

Maximum duration of the transferred call, specified in seconds.

equals
string

Criteria for establishing call transfer, if dtmf is evaluated.

transferTo
required
string

Phone number of the recipient that will receive transferred call. Must be written in E.164 standard (Example: 41793026727).

if
required
string

Specifies what to evaluate. Can be dtmf or anyDtmf.

callbackData
string [ 0 .. 700 ] characters

Additional client's data that will be sent on the notifyUrl. The maximum value is 700 characters. Example: Text containing some additional data needed in Delivery Report.

deliveryTimeWindow
object

Scheduling object that allows setting up detailed time windows in which the message can be sent. Consists of from, to and days properties. Days property is mandatory. Days in the week are written as their full names: Monday-Sunday. Days parameter must be populated as a list, between two square brackets. Example: ['MONDAY', 'TUESDAY', 'WEDNESDAY']. From and to properties should be either both included, to allow finer time window granulation or both omitted, to include whole days in the delivery time window. From and to parameters are objects, that consist of hour and minute fields that hold integer values. For example, from: [ hour: 15, minute:45 ]. For complete json, please check out our example. Note: delivery time window is set in UTC timezone.

days
Array of strings
Items Enum: "MONDAY" "TUESDAY" "WEDNESDAY" "THURSDAY" "FRIDAY" "SATURDAY" "SUNDAY"
from
required
object
hour
integer <int32>
minute
integer <int32>
to
required
object
hour
integer <int32>
minute
integer <int32>
destinations
required
Array of objects

Message destination addresses. Destination address must be in the E.164 standard format (Example: 41793026727). Maximum number of destination addresses is 20k.

Array
messageId
string

The ID that uniquely identifies the message sent.

to
required
string

Message destination addresses. Destination address must be in the E.164 standard format (Example: 41793026727).

dtmfTimeout
integer <int32>

The waiting period for end user to enter DTMF digits. Default value is 10 seconds.

from
string

Numeric sender ID in E.164 standard format (Example: 41793026727). This is caller ID that will be presented to the end user where applicable.

language
string

If the message is in text format, the language in which the message is written must be defined for correct pronunciation. More about Text-to-speech functionality and supported TTS languages can be found here. If not set, default language is English [en]. If voice is not set, then default voice for that specific language is used. In the case of English language, the voice is [Joanna].

machineDetection
string

Used for enabling detection of answering machine after the call has been answered. It can be set to hangup or continue. When set to hangup, if a machine is detected call will hang up. When set to continue, if a machine is detected, then voice message starts playing into voice mail after the answering message is finished with its greeting. If machineDetection is used, there is a minimum of 4 seconds detection time, which can result in delay of playing the message. Answering machine detection is additionally charged. For more information please contact your account manager and check documentation on Answering Machine Detection.

maxDtmf
integer <int32>

Defines the maximum number of DTMF codes entered by end user that would be collected.

notifyContentType
string

Preferred Delivery report content type. Can be application/json or application/xml. Read more.

notifyContentVersion
integer <int32>

Specifies the version of the Delivery report to be sent. Can be 1 (deprecated version 1) or 2 (current version 2). The default is version 2. Read more.

notifyUrl
string

The URL on your callback server on which the Delivery report will be sent.

pause
integer <int32>

Period of time in seconds between end user answering the call and message starting to be played. Minimal value is 0 and maximum value is 10 seconds. Default value is 0.

repeatDtmf
string

Specify DTMF code that is used as an indicator to repeat the voice message to the end user. The # key cannot be collected, as it is reserved for user input termination. Message can be repeated up to 5 times.

retry
object

Used to define if the delivery of the Voice messages should be retried in case the first try doesn't succeed. Additional retries will be made according to the schedule defined by minPeriod and maxPeriod parameters and platform's internal retry logic. If the minPeriod differs maxPeriod, delivery will be retried in the following manner: after 1 min, 2 min, 5 min, 10 min, 20 min, 30 min, 1 hour, 2 hours, 4 hours, 8 hours, 16 hours, 24 hours or until maxPeriod is reached. If the retry attempt for the maxPeriod is reached, the maxPeriod will be used for all subsequent retries. If the minPeriod and the maxPeriod are defined as equal values, the period of time between retries will be equal to this value. Message delivery will be retried until the successful delivery or message validity or maxCount value is reached.

maxCount
required
integer <int32>

Specify the maximum number of retry attempts. Maximum value of the maxCount is 4. If the value is higher than 4, it will be set to 4.

maxPeriod
required
integer <int32>

Defines the maximum waiting time (in minutes) after the previous failed attempt to try to deliver the message again. Supported values are 1 min, 2 min, 5 min, 10 min, 20 min, 30 min, 1 hour, 2 hours, 4 hours, 8 hours, 16 hours, 24 hours. If entered a value that isn't from the previous list but that's smaller than 24 hours, it is used the next bigger value from the list. If entered value that is bigger than 24 hours than it is used 24 hours.

minPeriod
required
integer <int32>

Defines the minimal waiting time (in minutes) after the previous failed attempt to try to deliver the message again. Supported values are 1 min, 2 min, 5 min, 10 min, 20 min, 30 min, 1 hour, 2 hours, 4 hours, 8 hours, 16 hours, 24 hours. If entered a value that isn't from the previous list but that's smaller than 24 hours, it is used the next bigger value from the list. If entered value that is bigger than 24 hours than it is used 24 hours.

ringTimeout
integer <int32>

Ringing duration, unless there are no operator limitations. Default value is 45. Note: There are no limitations on the Voice platform regarding this value, however, most of the operators have their own ring timeout limitations and it is advisable to keep the ringTimeout value up to 45 seconds.

sendAt
string <date-time>

Used for scheduled Voice messages (message not to be sent immediately, but at scheduled time).

sendingSpeed
object

Sending rate defined in number of messages sent per second, minute, hour or day. First message will be sent immediately (or at sendAt time if scheduling is used) and subsequent messages will be sent respecting defined speed. For example, if sendingSpeed is defined as 10 messages per hour, messages will be sent every 6 minutes. If this parameter is defined, validityPeriod is ignored.

speed
integer <int32>

Defines the number of messages that will be sent per specified time unit.

timeUnit
string

Defines time unit used for calculating sending speed. Possible values: second, minute, hour and day.

speechRate
number <double>

The reproduction speed of speech in the resulting message. Effective only when using text. Supported range is from 0.5 (slow down speech) to 2 (speed up speech). Values less than 0.5 will be replaced with 0.5, and values higher than 2 will be replaced with 2. Default value is 1.

text
string

Text of the message that will be sent. Message text can be up to 1400 characters long and cannot contain only punctuation. Adding pauses between the words and extending the duration of the voice message is possible by using the comma character β€œ,”. For example, if you want to have a 3 second pause after each word, then the text parameter should look like this β€œone,,,,,,two,,,,,,three,,,,,,”. Each comma creates a pause of 0.5 seconds. SSML (Speech Synthesis Markup Language) is supported and can be used to fully customize pronunciation of the provided text.

validityPeriod
integer <int32>

The message validity period shown in minutes. When the period expires, it will not be allowed for the message to be sent. A validity period longer than 48h is not supported (in this case, it will be automatically set to 48h).

voice
object

Used to define voice in which text would be synthesized. It has two parameters: name and gender. When only name is provided, then that exact voice with that name will be used to synthesize text. If only gender is provided, then text is synthesized with first voice in given gender. If voice is not set, then default voice is used.

gender
string

Gender of the voice. Can be male or female.

name
string

Name of the voice. Example: Joanna

Responses

default

successful response

400

Bad Request

401

Unauthorized

403

Forbidden

4XX

Error responses

500

Internal Server Error

5XX

Error responses

Request samples

Content type
Example

Advanced message example

Copy
Collapse all
{
  • "bulkId": "BULK-ID-123-xyz",
  • "messages":
    [
    • {
      • "from": "41793026700",
      • "destinations":
        [
        • {
          • "to": "41793026727",
          • "messageId": "MESSAGE-ID-123-xyz"
          },
        • {
          • "to": "41793026731"
          }
        ],
      • "text": "Test Voice message.",
      • "language": "en",
      • "voice":
        {
        • "name": "Joanna",
        • "gender": "female"
        },
      • "speechRate": 1,
      • "notifyContentType": "application/json",
      • "validityPeriod": 720,
      • "sendAt": "2023-08-10T07:36:42.005+0000",
      • "repeatDtmf": "123",
      • "maxDtmf": 1,
      • "ringTimeout": 45,
      • "dtmfTimeout": 10,
      • "callTimeout": 130,
      • "callTransfers":
        [
        • {
          • "equals": "2",
          • "transferTo": "41793026700",
          • "callTransferMaxDuration": 45,
          • "if": "DTMF"
          },
        • {
          • "transferTo": "41793026701",
          • "callTransferMaxDuration": 45,
          • "if": "anyDtmf"
          }
        ],
      • "callbackData": "DLR callback data",
      • "pause": 3,
      • "retry":
        {
        • "minPeriod": 1,
        • "maxPeriod": 5,
        • "maxCount": 5
        },
      • "sendingSpeed":
        {
        • "speed": 5,
        • "timeUnit": "minute"
        },
      • "machineDetection": "continue",
      • "deliveryTimeWindow":
        {
        • "from":
          {
          • "hour": 6,
          • "minute": 0
          },
        • "to":
          {
          • "hour": 15,
          • "minute": 30
          },
        • "days":
          [
          • "MONDAY",
          • "TUESDAY",
          • "WEDNESDAY",
          • "THURSDAY",
          • "FRIDAY",
          • "SATURDAY",
          • "SUNDAY"
          ]
        }
      }
    ]
}

Response samples

Content type
Copy
Collapse all
{
  • "bulkId": "5028e2d42f19-42f1-4656-351e-a42c191e5fd2",
  • "messages":
    [
    • {
      • "to": "41793026727",
      • "status":
        {
        • "groupId": 1,
        • "groupName": "PENDING",
        • "id": 26,
        • "name": "PENDING_ACCEPTED",
        • "description": "Message accepted, pending for delivery."
        },
      • "messageId": "4242f196ba50-a356-2f91-831c4aa55f351ed2"
      },
    • {
      • "to": "41793026731",
      • "status":
        {
        • "groupId": 1,
        • "groupName": "PENDING",
        • "id": 26,
        • "name": "PENDING_ACCEPTED",
        • "description": "Message accepted, pending for delivery."
        },
      • "messageId": "5f35f896ba50-a356-43a4-91cd81b85f8c689"
      }
    ]
}

Encountering issues

Contact our support

What's new? Check out

Release Notes

Unsure about a term? See

Glossary

Research panel

Help shape the future of our products
Learn more
Service status

Copyright @ 2006-2025 Infobip ltd.