SMS API (1.5.2)
Download OpenAPI specification:
With the SMS API you can send SMS from your account and lookup messages both messages that you've sent as well as messages sent to your virtual numbers. Numbers are specified in E.164 format. More SMS API documentation is at https://developer.vonage.com/messaging/sms/overview
Legacy Mode
The Vonage SMS API is in legacy mode and any new SMS features will be built on the Vonage Messages API, which already supports SMS. The Messages API also unlocks additional channels — such as RCS, WhatsApp, MMS, Messenger, Viber, and Email — through a single integration, so please consider the Messages API for your messaging needs.
Send an SMS
Send an outbound SMS from your Vonage account
Authorizations:
path Parameters
| format required | string Default: "json" Enum: "json" "xml" Example: json The format of the response |
Request Body schema: application/x-www-form-urlencodedrequired
| from required | string The name or number the message should be sent from. Alphanumeric senderID's are not supported in all countries, see Global Messaging for more details. If alphanumeric, spaces will be ignored. Numbers are specified in E.164 format. |
| text required | string The body of the message being sent. If your message contains characters that can be encoded according to the GSM Standard and Extended tables then you can set the |
| to required | string [ 7 .. 15 ] characters \d{7,15} The number that the message should be sent to. Numbers are specified in E.164 format. |
| account-ref | string Advanced: An optional string used to identify separate accounts using the SMS endpoint for billing purposes. To use this feature, please email support |
| api_key | string = 8 characters Your API key. Only required if setting |
| body | string Advanced: Hex encoded binary data. Depends on |
| callback | string Advanced: The webhook endpoint the delivery receipt for this sms is sent to. This parameter overrides the webhook endpoint you set in Dashboard. Max 100 characters. |
| client-ref | string Advanced: You can optionally include your own reference of up to 100 characters. |
| content-id | string Advanced: A string parameter that satisfies regulatory requirements when sending an SMS to specific countries. For more information please refer to the Country-Specific Outbound SMS Features |
| entity-id | string Advanced: A string parameter that satisfies regulatory requirements when sending an SMS to specific countries. For more information please refer to the Country-Specific Outbound SMS Features |
| message-class | integer Enum: 0 1 2 3 Advanced: The Data Coding Scheme value of the message |
| pool-id | string The ID of the Number Pool to use as the sender of this message. If specified, a number from the pool will be used as the |
| protocol-id | integer Advanced: The value of the protocol identifier to use. Ensure that the value is aligned with |
| sig | string [ 16 .. 60 ] characters The hash of the request parameters in alphabetical order, a timestamp and the signature secret. See Signing Requests for more details.
Note: DO NOT set an |
| status-report-req | |
| timestamp | integer An integer containing the number of seconds since the epoch (this is sometimes also known as UNIX time). Only required if setting |
| trusted-number | boolean Default: false Setting this parameter to This parameter only has any effect for accounts subscribed to Fraud Defender Premium. |
| ttl | integer [ 20000 .. 604800000 ] Default: 259200000 Advanced: The duration in milliseconds the delivery of an SMS will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours. We recommend this value should be kept at its default or at least 30 minutes. |
| type | string Default: "text" Enum: "text" "binary" "unicode" Advanced: The format of the message body |
| udh | string Advanced: Your custom Hex encoded User Data Header. Depends on |
Responses
Callbacks
Response samples
- 200
{- "message-count": "1",
- "messages": [
- {
- "account-ref": "customer1234",
- "client-ref": "my-personal-reference",
- "message-id": "aaaaaaaa-bbbb-cccc-dddd-0123456789ab",
- "message-price": "0.03330000",
- "network": "12345",
- "remaining-balance": "3.14159265",
- "status": "0",
- "to": "447700900000"
}
]
}Callback payload samples
{- "api-key": "abcd1234",
- "client-ref": "my-personal-reference",
- "err-code": "0",
- "message-timestamp": "2020-01-01 12:00:00",
- "messageId": "0A0000001234567B",
- "msisdn": "447700900000",
- "network-code": "12345",
- "price": "0.03330000",
- "scts": "2001011400",
- "status": "delivered",
- "to": "AcmeInc"
}