Voice Message - Amazon Pinpoint SMS and Voice

Voice Message

The Amazon Pinpoint SMS and Voice API lets you create voice messages from a text script, and then deliver those messages to your customers over the phone.

URI

/v1/sms-voice/voice/message

HTTP methods

POST

Operation ID: SendVoiceMessage

Creates a new voice message and sends it to a recipient's phone number.

Responses
Status codeResponse modelDescription
200SendVoiceMessageResponse

An object that contains the Message ID of a voice message that was sent successfully.

400BadRequestException

The destination number is blocked by AWS because it has a high risk of being used for fraudulent activities, or because of regulatory reasons.

429TooManyRequestsException

You've issued too many requests to the resource. Wait a few minutes, and then try again.

500InternalServiceErrorException

The API encountered an unexpected error and couldn't complete the request. You might be able to successfully issue the request again in the future.

OPTIONS

Responses
Status codeResponse modelDescription
200None

200 response

Schemas

Request bodies

{ "Content": { "CallInstructionsMessage": { "Text": "string" }, "PlainTextMessage": { "LanguageCode": "string", "Text": "string", "VoiceId": "string" }, "SSMLMessage": { "LanguageCode": "string", "Text": "string", "VoiceId": "string" } }, "OriginationPhoneNumber": "string", "ConfigurationSetName": "string", "DestinationPhoneNumber": "string", "CallerId": "string" }

Response bodies

{ "MessageId": "string" }
{ "Message": "string" }
{ "Message": "string" }
{ "Message": "string" }

Properties

BadRequestException

The input that you provided to the API is invalid.

PropertyTypeRequiredDescription
Message

string

False

A description of the error that the API encountered.

CallInstructionsMessageType

An object that defines a message that contains text formatted using Amazon Pinpoint Call Instructions markup.

Note

The ability to send messages using Amazon Pinpoint Call Instructions is currently a pre-production feature. It isn't currently available to all customers.

PropertyTypeRequiredDescription
Text

string

True

The text, in Amazon Pinpoint Call Instructions markup, to deliver to the recipient.

InternalServiceErrorException

This error occurs when there is an unexpected issue with the Amazon Pinpoint SMS and Voice API service.

PropertyTypeRequiredDescription
Message

string

False

A description of the error that the API encountered.

PlainTextMessageType

An object that defines a message that contains unformatted text.

PropertyTypeRequiredDescription
LanguageCode

string

False

The language to use when delivering the message. For a complete list of supported languages, see the Amazon Polly Developer Guide.

Text

string

True

The plain (not SSML-formatted) text to deliver to the recipient.

VoiceId

string

False

The name of the voice that you want to use to deliver the message. For a complete list of supported voices, see the Amazon Polly Developer Guide.

SSMLMessageType

An object that defines a message that contains SSML-formatted text.

PropertyTypeRequiredDescription
LanguageCode

string

False

The language to use when delivering the message. For a complete list of supported languages, see the Amazon Polly Developer Guide.

Text

string

True

The SSML-formatted text to deliver to the recipient.

VoiceId

string

False

The name of the voice that you want to use to deliver the message. For a complete list of supported voices, see the Amazon Polly Developer Guide.

SendVoiceMessageRequest

A request to create and send a new voice message.

PropertyTypeRequiredDescription
CallerId

string

False

The phone number that appears on recipients' devices when they receive the message.

Note

You can't specify a CallerId parameter if your account is in the sandbox.

ConfigurationSetName

string

False

The name of the configuration set that you want to use to send the message.

Content

VoiceMessageContent

False

An object that contains a voice message and information about the recipient that you want to send it to.

DestinationPhoneNumber

string

True

The phone number that you want to send the voice message to.

Although it isn't required, we recommend that you specify the phone number in E.164 format to ensure prompt and accurate delivery. You can use the Phone Number Validate resource in the Amazon Pinpoint API to convert phone numbers to E.164 format.

OriginationPhoneNumber

string

True

The long code to send the message from. This value should be one of the dedicated long codes that's assigned to your AWS account. Although it isn't required, we recommend that you specify the long code in E.164 format, for example +12065550100, to ensure prompt and accurate delivery of your message.

This isn't necessarily the phone number that appears on recipients' devices when they receive the message, because you can specify the CallerId property in the request.

SendVoiceMessageResponse

An object that contains the Message ID of a voice message that was sent successfully.

PropertyTypeRequiredDescription
MessageId

string

False

A unique identifier for the voice message.

TooManyRequestsException

This error occurs when there is an unexpected issue with the Amazon Pinpoint SMS and Voice API service.

PropertyTypeRequiredDescription
Message

string

False

A description of the error that the API encountered.

VoiceMessageContent

An object that contains the voice message that you want to send.

PropertyTypeRequiredDescription
CallInstructionsMessage

CallInstructionsMessageType

False

An object that defines a message formatted using Amazon Pinpoint Call Instructions markup.

PlainTextMessage

PlainTextMessageType

False

An object that defines a message that contains unformatted text.

SSMLMessage

SSMLMessageType

False

An object that defines a message that contains SSML-formatted text.

See also

For more information about using this API in one of the language-specific AWS SDKs and references, see the following:

SendVoiceMessage