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.
Status code | Response model | Description |
---|---|---|
200 | SendVoiceMessageResponse | An object that contains the Message ID of a voice message that was sent successfully. |
400 | BadRequestException | The destination number is blocked by AWS because it has a high risk of being used for fraudulent activities, or because of regulatory reasons. |
429 | TooManyRequestsException | You've issued too many requests to the resource. Wait a few minutes, and then try again. |
500 | InternalServiceErrorException | 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
Status code | Response model | Description |
---|---|---|
200 | None | 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.
Property | Type | Required | Description |
---|---|---|---|
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.
Property | Type | Required | Description |
---|---|---|---|
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.
Property | Type | Required | Description |
---|---|---|---|
Message | string | False | A description of the error that the API encountered. |
PlainTextMessageType
An object that defines a message that contains unformatted text.
Property | Type | Required | Description |
---|---|---|---|
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.
Property | Type | Required | Description |
---|---|---|---|
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.
Property | Type | Required | Description |
---|---|---|---|
CallerId | string | False | The phone number that appears on recipients' devices when they receive the message. NoteYou can't specify a |
ConfigurationSetName | string | False | The name of the configuration set that you want to use to send the message. |
Content | 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 |
SendVoiceMessageResponse
An object that contains the Message ID of a voice message that was sent successfully.
Property | Type | Required | Description |
---|---|---|---|
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.
Property | Type | Required | Description |
---|---|---|---|
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.
Property | Type | Required | Description |
---|---|---|---|
CallInstructionsMessage | False | An object that defines a message formatted using Amazon Pinpoint Call Instructions markup. | |
PlainTextMessage | False | An object that defines a message that contains unformatted text. | |
SSMLMessage | 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: