POST Create in-app message content
POST /services/data/{apiVersion}/connect/cms/contents/inApp
Operation ID: createInAppMessage. Tags: In-App Message Content.
Creates an in-app message content item. The content body includes the message title, type, and in-app block configuration with sub-blocks for title, message, media, action buttons, container styling, and tertiary messages.
Request body (required)
Media type: application/json. Schema: InAppContentRequest.
Example: bannerMinimal Minimal banner in-app message.
{
"contentSpaceOrFolderId": "0Zuxx00000003M5CAI",
"contentType": "sfdc_cms__inApp",
"contentBody": {
"sfdc_cms:title": "Welcome Banner",
"inAppType": "Banner",
"inAppBlock": {
"type": "block",
"definition": "sfdc_cms__inAppTypeBanner",
"attributes": {
"type": "Banner",
"title": {
"type": "block",
"definition": "sfdc_cms__inAppTitle",
"attributes": {
"content": {
"title": "Welcome!"
}
}
},
"message": {
"type": "block",
"definition": "sfdc_cms__inAppMessage",
"attributes": {
"content": {
"message": "Thanks for opening the app today."
}
}
}
}
}
}
}
Example: fullScreenWithMediaAndActions Full-screen message with media and action buttons.
{
"contentSpaceOrFolderId": "0Zuxx00000003M5CAI",
"contentType": "sfdc_cms__inApp",
"contentBody": {
"sfdc_cms:title": "Summer Sale Full Screen",
"description": "Full-screen promotional message for summer sale.",
"inAppType": "FullScreen",
"inAppImageLayoutType": "16x9",
"inAppBlock": {
"type": "block",
"definition": "sfdc_cms__inAppTypeFullScreen",
"attributes": {
"type": "FullScreen",
"title": {
"type": "block",
"definition": "sfdc_cms__inAppTitle",
"attributes": {
"content": {
"title": "Summer Sale is Here!"
},
"style": {
"androidFont": "Roboto",
"iosFont": "SF Pro Display",
"fontSize": "24",
"fontStyle": "Bold",
"textColor": "#1A1A1A",
"textAlignment": "Center",
"padding": "16"
}
}
},
"message": {
"type": "block",
"definition": "sfdc_cms__inAppMessage",
"attributes": {
"content": {
"message": "Get up to 50% off on all summer collections. Limited time only!"
},
"style": {
"androidFont": "Roboto",
"iosFont": "SF Pro Text",
"fontSize": "16",
"fontStyle": "Regular",
"textColor": "#4A4A4A",
"textAlignment": "Center",
"padding": "12"
}
}
},
"media": {
"type": "block",
"definition": "sfdc_cms__inAppMedia",
"attributes": {
"content": {
"link": {
"source": {
"type": "imageReference",
"ref": {
"contentKey": "MC5IEGQZHII5GEJLZW5DVSAZHSRI"
}
},
"url": "/services/data/{apiVersion}/connect/cms/media/MC5IEGQZHII5GEJLZW5DVSAZHSRI?version=1.1&fileName=summer-sale.png"
},
"type": "mediaUrl",
"mediaType": "Image"
},
"style": {
"mediaSize": "Large",
"insetSize": "0",
"border": "none",
"cornerRadius": "8",
"padding": "0",
"shadow": "none"
}
}
},
"actionButtons": {
"type": "block",
"definition": "sfdc_cms__inAppActionButtons",
"attributes": {
"actions": [
{
"type": "block",
"definition": "sfdc_cms__inAppActionButton",
"attributes": {
"content": {
"id": "btn-shop-now",
"label": "Shop Now",
"action": "1",
"actionUrl": "https://example.com/summer-sale",
"passbackValue": "shop_summer_sale"
},
"style": {
"androidFont": "Roboto",
"iosFont": "SF Pro Text",
"fontSize": "16",
"fontStyle": "Bold",
"textColor": "#FFFFFF",
"buttonColor": "#FF6B35",
"cornerRadius": "24",
"textAlignment": "Center",
"border": "none",
"shadow": "none",
"padding": "12"
}
}
},
{
"type": "block",
"definition": "sfdc_cms__inAppActionButton",
"attributes": {
"content": {
"id": "btn-dismiss",
"label": "Maybe Later",
"action": "0",
"passbackValue": "dismiss_summer_sale"
},
"style": {
"androidFont": "Roboto",
"iosFont": "SF Pro Text",
"fontSize": "14",
"fontStyle": "Regular",
"textColor": "#666666",
"buttonColor": "#EEEEEE",
"cornerRadius": "24",
"textAlignment": "Center",
"border": "none",
"shadow": "none",
"padding": "10"
}
}
}
],
"style": {
"buttonsLayout": "Vertical"
}
}
},
"containerStyle": {
"type": "block",
"definition": "sfdc_cms__inAppContainerStyle",
"attributes": {
"messageOrientation": "Portrait",
"modalOrientation": "Portrait",
"overlay": {
"color": "#000000",
"opacity": "0.5"
},
"background": {
"color": "#FFFFFF",
"opacity": "1"
},
"cornerRadius": "16",
"dismissIcon": {
"iconColor": "#333333",
"backgroundColor": "#F5F5F5"
},
"border": {
"color": "#E0E0E0",
"size": "1"
},
"shadow": {
"color": "#000000",
"length": "4"
},
"animation": {
"slide": "Bottom"
}
}
}
}
}
}
}
Example: modalWithTertiaryMessage Modal message with tertiary message and hyperlinks.
{
"contentSpaceOrFolderId": "0Zuxx00000003M5CAI",
"contentType": "sfdc_cms__inApp",
"contentBody": {
"sfdc_cms:title": "Privacy Policy Update Modal",
"description": "Inform users of updated privacy policy.",
"inAppType": "Modal",
"inAppBlock": {
"type": "block",
"definition": "sfdc_cms__inAppTypeModal",
"attributes": {
"type": "Modal",
"title": {
"type": "block",
"definition": "sfdc_cms__inAppTitle",
"attributes": {
"content": {
"title": "Privacy Policy Updated"
},
"style": {
"androidFont": "Roboto",
"iosFont": "SF Pro Display",
"fontSize": "20",
"fontStyle": "Bold",
"textColor": "#1A1A1A",
"textAlignment": "Center",
"padding": "16"
}
}
},
"message": {
"type": "block",
"definition": "sfdc_cms__inAppMessage",
"attributes": {
"content": {
"message": "We have updated our privacy policy to better protect your data. Please review the changes."
},
"style": {
"androidFont": "Roboto",
"iosFont": "SF Pro Text",
"fontSize": "14",
"fontStyle": "Regular",
"textColor": "#4A4A4A",
"textAlignment": "Center",
"padding": "12"
}
}
},
"actionButtons": {
"type": "block",
"definition": "sfdc_cms__inAppActionButtons",
"attributes": {
"actions": [
{
"type": "block",
"definition": "sfdc_cms__inAppActionButton",
"attributes": {
"content": {
"id": "btn-accept",
"label": "I Understand",
"action": "0",
"passbackValue": "accept_privacy"
},
"style": {
"androidFont": "Roboto",
"iosFont": "SF Pro Text",
"fontSize": "16",
"fontStyle": "Bold",
"textColor": "#FFFFFF",
"buttonColor": "#0070D2",
"cornerRadius": "8",
"textAlignment": "Center",
"border": "none",
"shadow": "none",
"padding": "14"
}
}
}
],
"style": {
"buttonsLayout": "Horizontal"
}
}
},
"tertiaryMessage": {
"type": "block",
"definition": "sfdc_cms__inAppTertiaryMessage",
"attributes": {
"content": {
"text": "By continuing, you agree to our Terms of Service and Privacy Policy.",
"links": [
{
"type": "block",
"definition": "sfdc_cms__inAppTertiaryLink",
"attributes": {
"hyperText": "Terms of Service",
"hyperLink": "https://example.com/terms"
}
},
{
"type": "block",
"definition": "sfdc_cms__inAppTertiaryLink",
"attributes": {
"hyperText": "Privacy Policy",
"hyperLink": "https://example.com/privacy"
}
}
]
},
"style": {
"androidFont": "Roboto",
"iosFont": "SF Pro Text",
"fontSize": "12",
"fontStyle": "Regular",
"textColor": "#666666",
"linkColor": "#0070D2",
"padding": "8",
"textAlignment": "Center"
}
}
},
"containerStyle": {
"type": "block",
"definition": "sfdc_cms__inAppContainerStyle",
"attributes": {
"messageOrientation": "Portrait",
"modalOrientation": "Portrait",
"overlay": {
"color": "#000000",
"opacity": "0.6"
},
"background": {
"color": "#FFFFFF",
"opacity": "1"
},
"cornerRadius": "12",
"dismissIcon": {
"iconColor": "#333333",
"backgroundColor": "#EEEEEE"
},
"border": {
"color": "#DDDDDD",
"size": "1"
},
"shadow": {
"color": "#000000",
"length": "8"
},
"animation": {
"slide": "Bottom"
}
}
}
}
}
}
}
Example: pushPrimer Push primer asking for notification permission.
{
"contentSpaceOrFolderId": "0Zuxx00000003M5CAI",
"contentType": "sfdc_cms__inApp",
"contentBody": {
"sfdc_cms:title": "Enable Notifications Primer",
"description": "Push primer to encourage notification opt-in.",
"inAppType": "PushPrimer",
"inAppBlock": {
"type": "block",
"definition": "sfdc_cms__inAppTypePushPrimer",
"attributes": {
"type": "PushPrimer",
"title": {
"type": "block",
"definition": "sfdc_cms__inAppTitle",
"attributes": {
"content": {
"title": "Stay in the Loop!"
},
"style": {
"androidFont": "Roboto",
"iosFont": "SF Pro Display",
"fontSize": "22",
"fontStyle": "Bold",
"textColor": "#1A1A1A",
"textAlignment": "Center",
"padding": "16"
}
}
},
"message": {
"type": "block",
"definition": "sfdc_cms__inAppMessage",
"attributes": {
"content": {
"message": "Enable push notifications to get real-time updates on orders, exclusive deals, and more."
},
"style": {
"androidFont": "Roboto",
"iosFont": "SF Pro Text",
"fontSize": "16",
"fontStyle": "Regular",
"textColor": "#4A4A4A",
"textAlignment": "Center",
"padding": "12"
}
}
},
"media": {
"type": "block",
"definition": "sfdc_cms__inAppMedia",
"attributes": {
"content": {
"link": {
"source": {
"type": "imageReference",
"ref": {
"contentKey": "MC7BELLICON3NOTIFZW5DVSAZHSRI"
}
},
"url": "/services/data/{apiVersion}/connect/cms/media/MC7BELLICON3NOTIFZW5DVSAZHSRI?version=1.0&fileName=bell-icon.png"
},
"type": "mediaUrl",
"mediaType": "Image"
},
"style": {
"mediaSize": "Medium",
"insetSize": "16",
"border": "none",
"cornerRadius": "0",
"padding": "8",
"shadow": "none"
}
}
},
"actionButtons": {
"type": "block",
"definition": "sfdc_cms__inAppActionButtons",
"attributes": {
"actions": [
{
"type": "block",
"definition": "sfdc_cms__inAppActionButton",
"attributes": {
"content": {
"id": "btn-enable",
"label": "Enable Notifications",
"action": "0",
"passbackValue": "enable_push"
},
"style": {
"androidFont": "Roboto",
"iosFont": "SF Pro Text",
"fontSize": "16",
"fontStyle": "Bold",
"textColor": "#FFFFFF",
"buttonColor": "#4CAF50",
"cornerRadius": "24",
"textAlignment": "Center",
"border": "none",
"shadow": "none",
"padding": "14"
}
}
},
{
"type": "block",
"definition": "sfdc_cms__inAppActionButton",
"attributes": {
"content": {
"id": "btn-not-now",
"label": "Not Now",
"action": "0",
"passbackValue": "dismiss_push_primer"
},
"style": {
"androidFont": "Roboto",
"iosFont": "SF Pro Text",
"fontSize": "14",
"fontStyle": "Regular",
"textColor": "#666666",
"buttonColor": "transparent",
"cornerRadius": "24",
"textAlignment": "Center",
"border": "none",
"shadow": "none",
"padding": "10"
}
}
}
],
"style": {
"buttonsLayout": "Vertical"
}
}
},
"tertiaryMessage": {
"type": "block",
"definition": "sfdc_cms__inAppTertiaryMessage",
"attributes": {
"content": {
"text": "You can change this anytime in Settings.",
"links": []
},
"style": {
"androidFont": "Roboto",
"iosFont": "SF Pro Text",
"fontSize": "11",
"fontStyle": "Regular",
"textColor": "#999999",
"linkColor": "#0070D2",
"padding": "4",
"textAlignment": "Center"
}
}
},
"containerStyle": {
"type": "block",
"definition": "sfdc_cms__inAppContainerStyle",
"attributes": {
"messageOrientation": "Portrait",
"modalOrientation": "Portrait",
"overlay": {
"color": "#000000",
"opacity": "0.5"
},
"background": {
"color": "#FFFFFF",
"opacity": "1"
},
"cornerRadius": "16",
"dismissIcon": {
"iconColor": "#333333",
"backgroundColor": "#F5F5F5"
},
"border": {
"color": "#E0E0E0",
"size": "0"
},
"shadow": {
"color": "#000000",
"length": "6"
},
"animation": {
"slide": "Bottom"
}
}
}
}
}
}
}
Responses
- 201
In-app message content created successfully.
Media type:
application/json. Schema:InAppContentResponse.Example: complete Complete response.
{ "apiName": "MCJUR5WKNRHZFP7NAUQOMMNJ7CI4", "contentBody": { "sfdc_cms:title": "Welcome Banner", "inAppType": "Banner", "inAppBlock": { "type": "block", "definition": "sfdc_cms__inAppTypeBanner", "attributes": { "type": "Banner", "title": { "type": "block", "definition": "sfdc_cms__inAppTitle", "attributes": { "content": { "title": "Welcome!" } } }, "message": { "type": "block", "definition": "sfdc_cms__inAppMessage", "attributes": { "content": { "message": "Thanks for opening the app today." } } } } } }, "contentFqn": "marketing--Default_Content_Workspace.sfdc_cms__inApp--MCJUR5WKNRHZFP7NAUQOMMNJ7CI4", "contentKey": "MCJUR5WKNRHZFP7NAUQOMMNJ7CI4", "contentSpace": { "id": "0ZuSB000002FYzW0AW", "resourceUrl": "/services/data/v65.0/connect/cms/spaces/0ZuSB000002FYzW" }, "contentType": { "fullyQualifiedName": "sfdc_cms__inApp" }, "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": "Welcome Banner", "urlName": "welcome-banner", "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: missingInAppType Missing required inAppType.
{ "error": "VALIDATION_ERROR", "message": "Required field 'inAppType' is missing", "details": [ { "field": "contentBody.inAppType", "message": "In-App Type: Complete this field." } ] }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: invalidInAppType Invalid inAppType value.
{ "error": "VALIDATION_ERROR", "message": "Invalid value for 'inAppType'", "details": [ { "field": "contentBody.inAppType", "message": "Value must be one of: Banner, FullScreen, Modal, PushPrimer" } ] } - 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 in-app message 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" }