POST /messaging/v1/sms/definitions


Creates a send definition.

JSON Parameters

definitionKeystringRequiredUnique, user-generated key to access the definition object.
namestringRequiredName of the definition. Must be unique.
content.messagestringRequiredThe message content that you want sent with each message. Use substitution strings and AMPscript to personalize the message.
statusstringOperational state of the definition: active, inactive, or deleted. A message sent to an active definition is processed and delivered. A message sent to an inactive definition isn’t processed or delivered. Instead, the message is queued for later processing for up to three days.
descriptionstringUser-provided description of the send definition.
subscriptions.shortCodestringRequiredThe short or long code for the mobile transmissions for each message on this definition.
subscriptions.countryCodestringThe country code associated with the shortCode for the mobile transmissions for each message on this definition. Don't use for long codes, unless your account configuration requires it.
subscriptions.keywordstringRequiredThe keyword used to track messages
subscriptions.autoAddSubscriberbooleanAllows you to add a recipient as subscriber against the shortCode using contactKey. When false, the message is rejected if contactKey doesn’t exist as a subscriber. Default is true.


Example Request with Short Code

To associate a short code to a send definition, use the alphabetic countryCode and numeric shortCode attributes.

Example Response with Short Code

Example Request with Long Code

To associate a long code or international phone number to a send definition, add the numeric country code at the beginning of the phone number. Then, use this number as the shortCode attribute. Don't use the alphabetic countryCode attribute unless your account configuration requires it.

Example Response with Long Code

HTTP Responses

201 CreatedSend definition is created. Review example response.
409 ConflictSend definition already exists on the server
400 Bad RequestInvalid request
403 ForbiddenFailed to pass authorization.
500 Server ErrorInternal error