POST Create SMS content
POST /services/data/{apiVersion}/connect/cms/contents/sms
Operation ID: createSmsContent. Tags: SMS Content.
Creates an SMS content item. The content body includes the message content, purpose classification, URL shortening settings, and optional MMS media configuration.
Request body (required)
Media type: application/json. Schema: SmsContentRequest.
Example: textOnly Basic text-only SMS message.
{
"contentSpaceOrFolderId": "0Zuxx00000003M5CAI",
"contentType": "sfdc_cms__sms",
"contentBody": {
"sfdc_cms:title": "NTO New Customer Outreach",
"sfdc_cms:description": "SMS campaign for Northern Trail Outfitters.",
"messageContent": "Serious savings on our biggest selection yet",
"messagePurpose": "promotional",
"enableUrlShortening": true,
"enableMmsMedia": false,
"customDomain": "example.com"
}
}
Example: mmsWithImage MMS with image media attachment.
{
"contentSpaceOrFolderId": "0Zuxx00000003M5CAI",
"contentType": "sfdc_cms__sms",
"contentBody": {
"sfdc_cms:title": "Product Launch MMS",
"sfdc_cms:description": "MMS with product hero image",
"messageContent": "Check out our new product!",
"messagePurpose": "promotional",
"enableUrlShortening": true,
"enableMmsMedia": true,
"mmsMediaContentBlock": {
"type": "block",
"definition": "sfdc_cms__mmsImageContent",
"attributes": {
"mediaContent": {
"type": "mediaUrl",
"mediaType": "Image",
"link": {
"source": {
"type": "imageReference",
"ref": {
"contentKey": "MCO7GY66HZ4FHOJGHCVYJFD275WY"
}
},
"url": "/services/data/{apiVersion}/connect/cms/media/MCO7GY66HZ4FHOJGHCVYJFD275WY"
}
},
"type": "Image"
}
}
}
}
Example: dltTemplateWithVariables SMS with DLT template and message variables.
{
"contentSpaceOrFolderId": "0Zuxx00000003M5CAI",
"contentType": "sfdc_cms__sms",
"contentBody": {
"sfdc_cms:title": "SMS with Variables",
"sfdc_cms:description": "SMS message with dynamic variables.",
"externalId": {
"contentKey": "MCILAKWDCFZNCY5AJY3KILP7P4QA"
},
"messagePurpose": "transactional",
"enableUrlShortening": true,
"messageVariables": [
{
"value": "test1"
},
{
"value": "{!$Expression.Account_Id}"
}
]
}
}
Example: withPersonalization SMS with Handlebars personalization and data providers.
{
"contentSpaceOrFolderId": "0Zuxx00000003M5CAI",
"contentType": "sfdc_cms__sms",
"contentBody": {
"sfdc_cms:title": "Personalized Offer",
"sfdc_cms:description": "Personalized promotional SMS.",
"messageContent": "Hi {{$unifiedIndividual.FirstName}}, enjoy 20% off your next purchase! Use code: {{$couponList.CouponCode}}. Shop now: {{$link.PreferenceCenterUrl}}",
"messagePurpose": "promotional",
"enableUrlShortening": true,
"enableMmsMedia": false,
"lightning:dataProviders": [
{
"sfdcExpressionKey": "$unifiedIndividual",
"definition": "sfdc_cms__unifiedIndividualDataProvider",
"attributes": {
"objectApiName": "UnifiedIndividual__dlm"
}
},
{
"sfdcExpressionKey": "$couponList",
"definition": "sfdc_cms__couponListDataProvider",
"attributes": {}
},
{
"sfdcExpressionKey": "$link",
"definition": "sfdc_cms__linkDataProvider",
"attributes": {}
}
]
}
}
Responses
- 201
SMS content created successfully.
Media type:
application/json. Schema:SmsContentResponse.Example: complete Complete response.
{ "apiName": "MCJUR5WKNRHZFP7NAUQOMMNJ7CI4", "contentBody": { "sfdc_cms:title": "NTO New Customer Outreach", "sfdc_cms:description": "SMS campaign for Northern Trail Outfitters.", "messageContent": "Serious savings on our biggest selection yet", "messagePurpose": "promotional", "enableUrlShortening": true, "enableMmsMedia": false, "customDomain": "example.com" }, "contentFqn": "marketing--Default_Content_Workspace.sfdc_cms__sms--MCJUR5WKNRHZFP7NAUQOMMNJ7CI4", "contentKey": "MCJUR5WKNRHZFP7NAUQOMMNJ7CI4", "contentSpace": { "id": "0ZuSB000002FYzW0AW", "resourceUrl": "/services/data/v65.0/connect/cms/spaces/0ZuSB000002FYzW" }, "contentType": { "fullyQualifiedName": "sfdc_cms__sms" }, "createdBy": { "id": "005SB00000eaki1YAA", "name": "Admin User", "resourceUrl": "/services/data/v65.0/chatter/users/005SB00000eaki1YAA" }, "createdDate": "2026-06-16T20:34:56.000Z", "externalId": null, "folder": { "id": "9PuSB000002KUDo0AO", "resourceUrl": "/services/data/v65.0/connect/cms/folders/9PuSB000002KUDo0AO" }, "isPublished": false, "language": "en_US", "lastModifiedBy": { "id": "005SB00000eaki1YAA", "name": "Admin User", "resourceUrl": "/services/data/v65.0/chatter/users/005SB00000eaki1YAA" }, "lastModifiedDate": "2026-06-16T20:34:56.000Z", "managedContentId": "20YSB000004SkOz2AK", "managedContentVariantId": "9PsSB0000045XAj0AM", "managedContentVersionId": "5OUSB000004K7np4AC", "status": { "label": "Draft", "status": "Draft" }, "title": "Northern Trail Outfitters", "urlName": "northern-trail-outfitters", "versionNumber": "1.1" } - 400
Invalid request body.
Media type:
application/json. Schema:Error.Example: missingTitle Missing required sfdc_cms:title.
{ "error": "VALIDATION_ERROR", "message": "Required field 'sfdc_cms:title' is missing", "details": [ { "field": "contentBody.sfdc_cms:title", "message": "Title: Complete this field." } ] }Example: missingMessagePurpose Missing required messagePurpose.
{ "error": "VALIDATION_ERROR", "message": "Required field 'messagePurpose' is missing", "details": [ { "field": "contentBody.messagePurpose", "message": "Message Purpose: Complete this field." } ] }Example: invalidEnumValue Invalid enum value for messagePurpose.
{ "error": "VALIDATION_ERROR", "message": "Invalid value for messagePurpose", "details": [ { "field": "contentBody.messagePurpose", "message": "Value must be one of: promotional, transactional" } ] }Example: additionalProperties Additional properties not allowed.
{ "error": "VALIDATION_ERROR", "message": "Additional properties are not allowed", "details": [ { "field": "contentBody.invalidProperty", "message": "You can't add the invalidProperty property because additionalProperties is set to false." } ] }Example: descriptionTooLong The description exceeds the maximum length.
{ "error": "VALIDATION_ERROR", "message": "Field exceeds maximum length", "details": [ { "field": "contentBody.sfdc_cms:description", "message": "Description must be 255 characters or fewer" } ] } - 401
Unauthorized.
Media type:
application/json. Schema:Error.Example: response Example response.
{ "error": "UNAUTHORIZED", "message": "Authentication credentials are missing or invalid" } - 403
Forbidden.
Media type:
application/json. Schema:Error.Example: response Example response.
{ "error": "FORBIDDEN", "message": "Insufficient permissions to create SMS content" } - 500
Internal server error.
Media type:
application/json. Schema:Error.Example: response Example response.
{ "error": "INTERNAL_SERVER_ERROR", "message": "An unexpected error occurred while processing the request" } - 503
Service unavailable.
Media type:
application/json. Schema:Error.Example: response Example response.
{ "error": "SERVICE_UNAVAILABLE", "message": "The service is temporarily unavailable. Please try again later" }