Send Template Message
Send Template Message to a new or existing chat. Only one destination parameter is needed - chatId, phone, or bsuid. In BSUID-centric routing, chatId can be [email protected], bsuid@lid, [email protected], or username@username. The phone field accepts a phone number or BSUID; bsuid can be passed separately.
Use this method for template messages (including Carousel/Catalog templates). If a 24-hour session method (e.g. /sendCarousel) fails because the 24-hour window is closed, send a template via /sendTemplate.
Cyrillic characters in file URLs are not supported. Use URL encoding for non-Latin characters.
Request examples are provided in the payload (requestBody/examples). Available variants:
- basic template
- Media Carousel (Cloud API)
- Catalog Carousel (product cards, Cloud API)
- Catalog template (catalog button)
- Coupon Code template (Cloud API)
- Limited-Time Offer template (Cloud API)
- WhatsApp Flow template (Cloud API)
Optional MM Lite / TTL fields: useMMlite, messageActivitySharing, messageSendTtlSeconds. Check channel readiness via GET /mmLiteStatus.
Order details (India only): include a params button with sub_type: order_details to send an invoice/payment template outside the 24h window. See also POST /sendOrderDetails.
JWT tokentoken<token>- body
namespace*stringTemplate namespace from GET /templates. Required when sending a template.
template*stringName of template
language*Object, containing fields "policy" and "code".
policy - now "deterministic" is only available option;
code - one of supported language codes
params?array<>Array of localizable parameters to be substituted into the template. Each parameter is object contains the following field:
type - section of parameters - header, body, footer, button
parameters - variables for section.
Each variable is an object that can contain the following fields:
type - can be text, currency, date_time, image, document, video or product
video- id (mediaId)
document
-
id (mediaId)
-
filename(optional)
image - object with field link (image url)
product - object with catalog_id and product_retailer_id (for catalog carousel product cards)
currency - object containing parameters currency_code and amount_1000.
-
currency_code - Currency code as defined in ISO 4217.
-
amount_1000 - Amount multiplied by 1000.
-
fallback_value - Default text if localization fails.
date_time - If the date_time object is used, further definition of the date and time is required.
-
component - The time is assembled from components (i.e., day of the week, month, hour, etc.) The time specified will be the same, regardless of the time zone the client is in.
-
unix_epoch - The time to be displayed is dependent on the time zone the client is in.
-
fallback_value - Default text if localization fails.
button - if button has parameter
-
sub_type (url/quick_reply/copy_code)
-
parameters (array to fill button variable)
-
index - button position.
coupon_code - for COPY_CODE buttons use parameters with type coupon_code and coupon_code value.
limited_time_offer - for limited-time offer templates:
-
parameters: [{type: limited_time_offer, limited_time_offer: {expiration_time_ms: }}]
-
If limited_time_offer.has_expiration is true, include limited_time_offer parameters and a copy code button first; URL button required.
cards - filled in if you need to send the Carousel template
-
card_index - card number
-
components - array of card data
type - header, body, footer, button parameters - variables for the section. sub_type - subtype for buttons index - button number
The number of parameters passed must match the number of parameters in the template
useMMlite?booleanForce Marketing Messages API (POST marketing_messages). If omitted: auto for MARKETING category when the channel has mm_lite_enabled and mm_lite_available service settings.
messageActivitySharing?booleanSets message_activity_sharing on the WABA payload (click tracking webhooks). Requires the MM Lite path. Ignored on Cloud API fallback.
messageSendTtlSeconds?integerTemplate message TTL in seconds (message_send_ttl_seconds). MARKETING via MM Lite: 43200–2592000. AUTHENTICATION: 30–900. UTILITY: 30–43200. AUTH/UTILITY also accept -1 (30-day custom TTL).
chatId?stringRequired if phone and bsuid are not set
Chat ID from the message list. Examples: [email protected], RU.1504711984690866@lid, username@username, or [email protected] (group). Used instead of the phone parameter.
phone?stringRequired if chatId and bsuid are not set
Recipient identifier. Accepts a phone number starting with the country code, or a BSUID such as RU.1504711984690866.
Use chatId for full chat IDs: [email protected], bsuid@lid, username@username, or [email protected].
bsuid?stringOptional alternative to phone/chatId
Recipient BSUID without the @lid suffix. Example: RU.1504711984690866.
Server response example
application/json- response
sent?booleanid?stringunique message id
message?stringPosting status message
description?stringResult description
curl -X POST 'https://api.1msg.io/123/sendTemplate' \ -H 'Content-Type: application/json' \ -d '{ "template": "template_name", "language": { "policy": "deterministic", "code": "en" }, "namespace": "namespace_id", "params": [ { "type": "header", "parameters": [ { "type": "image", "image": { "link": "https://..." } } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "test" } ] } ], "phone": "556123122026"}'{ "sent": true, "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8", "message": "Sent to [email protected]", "description": "Message has been sent to the provider"}