All Products
Search
Document Center

Chat App Message Service:SendChatappMessage

Last Updated:Aug 27, 2026

Sends a Chat App Message Service message.

Operation description

QPS limit

The single-user QPS limit for this operation is 250 calls per second. If this limit is exceeded, API calls are throttled, which may affect your business. Call this operation appropriately.

Status changes

You can monitor message delivery status through MNS or HTTP. For more information, see Receipt messages.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cams:SendChatappMessage

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ChannelType

string

Yes

The channel type. Valid values:

  • whatsapp

  • messenger

  • instagram

  • telegram

  • line

  • telegram

  • viber

whatsapp

Type

string

Yes

The message type. Valid values:

  • template: a message template that has been approved in the console. This type of message can be sent at any time.

  • message: a message in any format. This type of message can only be sent within 24 hours after receiving the last message from the user.

Important When Type is set to template, you must specify TemplateCode. When Type is set to message, you must specify MessageType.

message

MessageType

string

No

The detailed message type when Type is set to message. Valid values:

WHATSAPP

  • text: text message.

  • image: image message.

  • video: video message.

  • audio: audio message.

  • document: document message.

  • interactive: interactive message.

  • location: location message.

  • contacts: contacts message.

  • reaction: reaction message.

  • sticker: sticker message.

  • typing_indicator: typing indicator message.

  • pin: pin or unpin message (group messages only).

  • carousel: carousel message.

VIBER

  • text: text message.

  • image: image message.

  • text_image_button: text + image + button message.

  • text_button: text + button message.

  • document: document message.

  • video: video message.

  • text_video: text + video message.

  • text_video_button: text + video + button message.

  • text_image: text + image message.

MESSENGER / INSTAGRAM

  • text: text message.

  • image: image message.

  • video: video message.

  • document: document message.

  • audio: audio message.

  • interactive: interactive message.

  • couponTemplate: coupon template message.

  • regularTemplate: regular template message.

  • quickReply: quick reply message.

  • buttonTemplate: button template message.

TELEGRAM

  • text: text message.

  • image: image message.

  • video: video message.

  • audio: audio message.

  • document: document message.

  • location: location message.

  • gif: animated GIF message.

  • sticker: sticker message.

  • interactive: custom pass-through Telegram message.

LINE

  • text: text message.

  • image: image message.

  • video: video message.

  • audio: audio message.

  • buttons: button message.

  • confirm: confirm message.

  • carousel: carousel message.

  • imageCarousel: image carousel message.

  • quickReply: quick reply message.

  • sticker: sticker message.

  • location: location message.

  • textV2: text message (V2).

  • coupon: coupon message.

  • imagemap: imagemap message.

  • flex: flex message.

  • interactive: custom pass-through LINE message.

text

TemplateCode

string

No

The template code. You can view the template code on the Channel Management > Management > Template Design page.

1119***************

Language

string

No

The language. For a list of language codes, see Language codes.

en

From

string

Yes

The sender number.

  • When ChannelType is whatsapp, this is the phone number registered and bindng with WhatsApp. You can view it on the Channel Management > Management > WABA Management > Number Management page.

  • When ChannelType is messenger, this is the Page ID. You can view it on the Channel Management > Management > Public Page page.

  • When ChannelType is instagram, this is the Instagram professional account ID (Account ID). You can view it on the Channel Management > Management > Professional Account page.

  • When ChannelType is viber, this is the Viber Service ID. You can view it on the Channel Management > Management > Service ID Management page.

  • When ChannelType is telegram, this is the Telegram bot ID. You can view it on the Channel Management > Management > Bot Management page.

  • When ChannelType is line, this is the LINE Channel ID. You can view it on the Channel Management > Management > LINE Official Account page.

861387777****

To

string

Yes

The recipient number.

  • When ChannelType is whatsapp, this is the phone number or BSUID of the message recipient.

  • When ChannelType is messenger, this is the Page-Scoped User ID generated when the user interacts with the Facebook page.

  • When ChannelType is instagram, this is the Instagram User ID generated when the user interacts with the Instagram business or creator account.

  • When ChannelType is viber, this is the phone number of the message recipient.

  • When ChannelType is telegram, this is the Telegram chatId.

  • When ChannelType is line, this is the LINE User ID.

861388988****

TemplateParams

object

No

The collection of template parameters.

string

No

The template parameter. This is in key-value format, where Key is the parameter name and Value is the parameter value.

{ "param1": "value1", "param2": "value2" }

Content

string

No

The message content.

WhatsApp message notes:

  • When messageType is text, the text field is required and the Caption field must not be specified.

  • When messageType is image, the Link field is required.

  • When messageType is video, the Link field is required.

  • When messageType is audio, the Link field is required and the Caption field is invalid.

  • When messageType is document, the Link and FileName fields are required and the Caption field is invalid.

  • When messageType is interactive, the type and action fields are required.

  • When messageType is contacts, the name field is required.

  • When messageType is location, the longitude and latitude fields are required.

  • When messageType is sticker, the Link field is required and the Caption and FileName fields are invalid.

  • When messageType is reaction, the messageId and emoji fields are required.

Messenger message notes:

  • When messageType is text, the text field is required.

  • When messageType is image, video, audio, or document, the link field is required.

Instagram message notes:

  • When messageType is text, the text field is required.

  • When messageType is image, video, or audio, the link field is required.

Viber message notes:

  • When messageType is text, the text field is required.

  • When messageType is image, the link field is required.

  • When messageType is video, the link, thumbnail, fileSize, and duration fields are required.

  • When messageType is document, the link, fileName, and fileType fields are required.

  • When messageType is text_button, the text, caption, and action fields are required.

  • When messageType is text_image_button, the text, link, caption, and action fields are required.

  • When messageType is text_video, the text, link, thumbnail, fileSize, and duration fields are required.

  • When messageType is text_video_button, the text, link, thumbnail, fileSize, duration, and caption fields are required, and the action field must not be empty.

Telegram message notes:

  • When messageType is text, the text field is required.

  • When messageType is image, video, audio, gif, or sticker, the link field is required.

  • When messageType is location, the latitude and longitude fields are required.

  • When messageType is interactive, the type field is required. You can send various Telegram message types. Example: {"type": "sendPhoto", "sendPhoto": {"photo":"http://img.png","caption":"21"}}. This can be used to send a Photo type message. For more information about message types, see Telegram message body.

LINE message notes:

  • When messageType is text or textV2, the text field is required.

  • When messageType is image or video, the link and previewImageUrl fields are required.

  • When messageType is audio, the link and duration fields are required.

  • When messageType is buttons or confirm, the text and actions fields are required.

  • When messageType is carousel or imageCarousel, the columns field is required.

  • When messageType is quickReply, the text and items fields are required.

  • When messageType is sticker, the packageId and stickerId fields are required.

  • When messageType is location, the title, address, latitude, and longitude fields are required.

  • When messageType is coupon, the couponId field is required.

  • When messageType is imagemap, the baseUrl and altText fields are required.

  • When messageType is flex, the contents and altText fields are required.

  • When messageType is interactive, you can pass in message formats supported by LINE:

    • To send a single message, the type field is required, and other fields follow the LINE message body format. Example: {"type": "text", "text": "test"}

    • To send multiple messages (LINE supports up to 5 messages at a time), the messages field is required. Example: {"messages": [{"type": "text", "text": "test"}, {"type": "image", "originalContentUrl": "http://img.png", "previewImageUrl": "http://img2.png"}]}

    • For more information, see LINE message body.

{ "text": "hello,whatsapp", "link": "https://*******", "caption": "****", "fileName": "****" }

Payload

array

No

The collection of button trigger messages.

Note

This parameter is valid only for WHATSAPP.

payloadtext1,payloadtext2,payloadtext3

string

No

The trigger message of a button in the template.

payloadtext

CustWabaId deprecated

string

No

The ISV customer WABA ID.

Note

This parameter is deprecated. Use CustSpaceId instead.

cams-8c8*********

FallBackId

string

No

The fallback policy ID. This parameter is for the China International site. China site users can ignore this parameter. You can view the policy ID on the Fallback Strategy page.

S0****

FallBackContent

string

No

The custom fallback content. This parameter is for the China International site. China site users can ignore this parameter.

Fallback SMS

IsvCode deprecated

string

No

The ISV verification code.

Note

This parameter is deprecated. You can ignore it.

123123******

CustSpaceId

string

No

The SpaceId of the ISV sub-customer or the instance ID of a direct customer. You can view it on the Channel Management page.

cams-8c8*********

ContextMessageId

string

No

The ID of the message to reply to. This is the ID of a previously sent or received message.

61851ccb2f1365b16aee****

TrackingData

string

No

The custom tracking data passed in for Viber message types. This parameter is for the China International site. China site users can ignore this parameter.

Note

Valid only for VIBER.

Tracking Data

Label

string

No

The Viber message type. This parameter is for the China International site. China site users can ignore this parameter. Valid values:

  • pormotion: marketing or promotional messages.

  • transaction: notification messages.

Note

Valid only for VIBER.

promotion

Ttl

integer

No

The Viber message sending timeout period. This parameter is for the China International site. China site users can ignore this parameter. Unit: seconds. Valid values: 30 to 1209600.

Note

Valid only for VIBER.

50

Tag

string

No

The tag information. Custom tag information when sending Viber messages.

Note

Valid only for VIBER.

tag

TaskId

string

No

The custom task ID.

10000****

FallBackDuration

integer

No

The fallback trigger time. This parameter is for the China International site. China site users can ignore this parameter. If the message does not return a delivered receipt within the specified time, fallback is triggered. If this parameter is not specified, fallback is triggered only when the message fails to send or a failure status report is received. Unit: seconds. Minimum value: 60. Maximum value: 43200.

120

ProductAction

object

No

The product information. This parameter is valid only for WhatsApp channel types. It refers to the product information you uploaded on Meta.

Note

Valid only for WHATSAPP.

ThumbnailProductRetailerId

string

No

The product catalog ID. You can obtain it by calling the ListProductCatalog operation.

skkks99****

Sections

array<object>

No

The list of product categories (up to 10 categories and 30 products).

array<object>

No

The product category.

Title

string

No

The category name. You can view it on the Channel Management > Management > Catalog Management > Product Management page, or obtain it by calling the ListProduct operation.

abcd

ProductItems

array<object>

No

The list of product items.

object

No

The product item information.

ProductRetailerId

string

No

The product ID. You can view it on the Channel Management > Management > Catalog Management > Product Management page, or obtain it by calling the ListProduct operation.

ksi3****

FallBackRule

string

No

The fallback rule. This parameter is for the China International site. China site users can ignore this parameter. Valid values:

  • undelivered: fallback is triggered when the message cannot be delivered to the endpoint (template and parameter validation must pass during the sending state; blocked templates or numbers are not validated). This rule is used by default when the parameter value is empty.

  • sentFailed: fallback is also triggered when template or template variable validation fails. Only the channelType, type, messageType, to, and from (existence check) parameters are strictly validated.

undelivered

FlowAction

object

No

The Flow message object.

Note

Valid only for WHATSAPP.

FlowActionData

object

No

The collection of Flow default parameters.

any

No

The Flow default parameter. This is in key-value format, where Key is the parameter name and Value is the parameter value.

{ "name": "name" }

FlowToken

string

No

The custom Flow token information.

kde****

TemplateName

string

No

The template name. You can view the template name on the Channel Management > Management > Template Design page.

test_name

RecipientType

string

No

The recipient type. Valid values:

  • individual: an individual.

  • group: a group.

  • userId: WhatsApp BSUID. Valid only for WHATSAPP.

individual

MessageCampaignId

string

No

The campaign message ID.

Note

This parameter is a test parameter that is not fully available. Ignore this parameter.

123123********

AdAccountId

string

No

The Meta ad account ID.

Note

This parameter is a test parameter that is not fully available. Ignore this parameter.

123123********

TokenType

string

No

The token type.

Note

This parameter is a test parameter that is not fully available. Ignore this parameter.

bearer

Category

string

No

The message type (for WhatsApp direct send).

Warning Do not specify this parameter if you are not a Meta-invited customer. Otherwise, message sending fails.

UTILITY

Response elements

Element

Type

Description

Example

object

The response parameters.

AccessDeniedDetail

string

The access denied details.

None

RequestId

string

The request ID.

90E63D28-E31D-1EB2-8939-A94866******

Message

string

The error message.

User not authorized to operate on the specified resource.

Code

string

The response code.

  • OK indicates that the request was successful.

  • For other error codes, see Error codes.

OK

MessageId

string

The message ID.

61851ccb2f1365b16aee****

Examples

Success response

JSON format

{
  "AccessDeniedDetail": "None",
  "RequestId": "90E63D28-E31D-1EB2-8939-A94866******",
  "Message": "User not authorized to operate on the specified resource.",
  "Code": "OK",
  "MessageId": "61851ccb2f1365b16aee****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 Product.Unsubscript You have not subscribed to the specified product. You have not subscribed to the specified product.
400 Ram.PermissionDeny You are not authorized to perform the operation.
400 System.LimitControl The system is under flow control. The system is under flow control.
400 Unknown.ResourceOwnerId The resource does not belong to the current user. The resource does not belong to the current user.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.