The Salesforce Developers website will undergo maintenance on May 29, 2024 from 3:00 a.m. UTC to 10:00 a.m. UTC. The maintenance process may affect the availability of our documentation. Please plan accordingly.

POST /messaging/v1/sms/messages/{messageKey}

Sends a message to a single recipient using a send definition.

messageKeystringA unique identifier that you can use to track the status of the message. The key can contain up to 100 characters. There are no character restrictions. The message key that you provide must be unique among all of the keys used in your business unit over the last 2 days.
definitionKeystringRequired. The ID of the send definition.
recipientobjectRequired. An object that contains parameters and metadata for the recipient, such as send tracking and personalization attributes. If this object is present in the request, the recipients array (which is used to send messages to multiple recipients) can’t be included in the request.
recipient.contactKeystringRequired. A unique identifier for the subscriber. You can create a contact key at send time if the contact isn’t already in Marketing Cloud Engagement.
recipient.tostringRequired. The phone number of the recipient.
recipient.attributesobjectPersonalization information for the recipient, written as key-value pairs. The attributes must match existing profile attributes, content attributes, or triggered send data extension attributes.
content.messagestringAn override for the message content in the send definition. Use substitution strings to personalize the content.

The response includes a request ID. The responses array contains a messageKey value for the message. If a message was sent successfully, the array object doesn’t contain any additional information. If a message failed to send, the response includes an errorcode that describes the reason that the message failed.