Download OpenAPI specification:Download
1MSG.IO is the perfect WhatsApp management tool for your business. With us you get full access to the official Whatsapp API/webhooks.
Every API request must contain an Authorize HTTP header with a token. This is your channel token, which can be found in your channel project on your profile page. Please do not give the token to anyone or post it publicly.
The authorization token must be added to each request in the GET parameter 'token' and always passed to query string (?token={jwtToken}). Parameters in GET queries pass query string. Parameters in POST requests — through the JSON-encoded request body.
All 'send' methods (except /sendTemplate) will only work when the dialog session with the user is open. Some of our solutions simplify and avoid such limitations, but we urge you to pay more attention to this detail
Updates from 20 May (all changes are relevant for Cloud API version:
Use this edge to retrieve your profile's About info
{- "about": "Some about info",
- "address": "Neverland, Unexpected st.",
- "description": "Some company description",
- "phone": "12020721369",
- "vertical": "Other",
}Change user info
| about | string Profile`s About section. |
| address | string Address of the business |
| description | string Description of the business. Max 256 characters |
string Business email | |
| phone | string Linked phone number |
| vertical | string Enum: "Automotive" "Beauty, Spa and Salon" "Clothing and Apparel" "Education" "Entertainment" "Event Planning and Service" "Finance and Banking" "Food and Grocery" "Public Service" "Hotel and Lodging" "Medical and Health" "Non-profit" "Professional Services" "Shopping and Retail" "Travel and Transportation" "Restaurant" "Other" Industry of the business |
| photo | string HTTP link https://... Or base64-encoded file with mime data, for example data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ... File in form-data input field |
{- "result": "success"
}Get channel usage extended statistics
[- {
- "business_initiated_paid_quantity": 1,
- "business_initiated_price": 0.0691,
- "business_initiated_quantity": 2,
- "free_entry_point": 0,
- "free_quantity": 1,
- "free_tier": 1,
- "paid_quantity": 1,
- "period_date": "2022-11-01T00:00:00Z",
- "quantity": 2,
- "total_price": 0.0691,
- "user_initiated_paid_quantity": 1,
- "user_initiated_price": 0.0691,
- "user_initiated_quantity": 2
}
]Returns the status of your WhatsApp Business API client. Channel statuses:
connected/connecting - everything is ok.
disconnected - The Coreapp is not connected to the WhatsApp servers.
uninitialized - The application could be in the process of upgrading or initializing the database schema. Try again in a few minutes and contact Support if you continue to see this status.
unregistered - You need to register your WhatsApp Business API client. Either you have been blocked and need to take some action (contact Support)
{- "status": "connected"
}is_catalog_visible - Set to true to show catalog storefront icon or false to hide it. is_cart_enabled - Set to true to enable cart or false to disable it.
[- {
- "id": "789887292550821",
- "is_cart_enabled": true,
- "is_catalog_visible": true
}
]Sets the URL for receiving webhook notifications of new messages, message delivery events (ack), and group events.
API responses in "Callbacks" tab
| webhookUrl required | string Http or https URL for receiving notifications. For testing, we recommend using our RequestBin. |
{- "set": true,
}{- "messages": [
- {
- "id": "ABGHYoIXMAmY13IKOick9az6QYmt4R",
- "body": "Ok!",
- "fromMe": true,
- "self": 0,
- "isForwarded": false,
- "time": 1665396610,
- "type": "chat",
- "senderName": "John",
- "caption": "photo.jpg",
- "quotedMsgId": "ABGHYoIXMAmYTwIKOick9az6QYmt4R",
- "action": { },
- "list_reply": { },
- "button_reply": { },
- "flow_reply": { },
- "meta": {
- "referral": {
- "ctwa_clid": "CTWA_CLID",
- "source_url": "AD_OR_POST_FB_URL",
- "source_id": "ADID",
- "source_type": "ad",
- "headline": "AD_TITLE",
- "body": "AD_DESCRIPTION",
- "media_type": "image",
- "image_url": "RAW_IMAGE_URL",
- "video_url": "RAW_VIDEO_URL",
- "thumbnail_url": "RAW_THUMBNAIL_URL"
}
}, - "interactive": {
- "type": "nfm_reply",
- "list_reply": { },
- "button_reply": { },
- "nfm_reply": {
- "name": "flow",
- "response_json": { }
}
}
}
]
}| messageId required | string Example: messageId=0XzkmGNn4prUAQlzsHApGNRXQ0U Message ID. Example: 0XzkmGNn4prUAQlzsHApGNRXQ0U |
{- "hooks": [
- {
- "id": "gBGGeSaGViBfAgnlzOSHEwK9O6F",
- "type": "message",
- "status": "sent",
- "pricing": {
- "billable": true,
- "category": "business_initiated",
- "pricing_model": "CBP"
}, - "timestamp": "1654864094",
- "conversation": {
- "id": "c1f5a3a1b9ff6f2e1c43fd31543137e0",
- "origin": {
- "type": "business_initiated"
}, - "expiration_timestamp": 1654943940
}, - "recipient_id": "556123122026"
}
]
}This part of the documentation describes how to send and receive messages using the WhatsApp Business API
Send Interactive List Message to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.
| body required | string Main message text |
| header | string Header will be located above message text |
| footer | string Footer will be placed under message text |
| action required | string Action for open list |
required | Array of objects Up to 10 sections from which the client can choose. Each section is object with fields: title - Title of section, up to 24 symbols. Required if there are more then 1 section rows - available options. Required Each option is object with fields: id - Unique id for option, up to 200 symbols. Required title - Title of option, up to 24 symbols. Required description - Description of option, up to 72 symbols Example: [{"title":"Section 1","rows":[{"id":"1","title":"Option 1","description":"Description 1"}]},{"title":"Section 2","rows":[{"id":"2","title":"Option 2","description":"Description 2"}]}] |
| chatId | string Required if phone is not set Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us (group). Used instead of the phone parameter. |
| phone | integer Required if chatId is not set A phone number starting with the country code. You do not need to add your number. USA example: 12020721369. |
{- "sent": true,
- "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",
- "description": "Message has been sent to the provider"
}Send Interactive Reply Buttons Message to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.
| body required | string Main message text |
object or object or object or object | |
| footer | string Footer will be placed under message text |
required | Array of objects Up to 3 sections inclusive. Each section is an object with a fields: type - always "reply" Required reply – reply button objects Required Each button response is an object with fields: id - a unique identifier of the button, up to 200 characters. Required title — Button title, up to 20 characters. Required Example: "sections": [{"type": "reply","reply": {"id ": "1","title": "1 Button's Title"}},{"type": "reply", "reply": {"id": "2", "title": "2 Button's Title"}}] |
| quotedMsgId | string Quoted message ID (Cloud API) |
| chatId | string Required if phone is not set Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us (group). Used instead of the phone parameter. |
| phone | integer Required if chatId is not set A phone number starting with the country code. You do not need to add your number. USA example: 12020721369. |
{- "sent": true,
- "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",
- "description": "Message has been sent to the provider"
}Send Interactive Location Request Message to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.
| body required | string Message text, UTF-8 or UTF-16 string with emoji 🍏. Can be used with mentionedPhones, example: this text for @556123122026 |
| quotedMsgId | string Quoted message ID (Cloud API) |
| chatId | string Required if phone is not set Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us (group). Used instead of the phone parameter. |
| phone | integer Required if chatId is not set A phone number starting with the country code. You do not need to add your number. USA example: 12020721369. |
{- "sent": true,
- "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",
- "description": "Message has been sent to the provider"
}Send Interactive WhatsApp Flow message to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.
Use this method to send a published WhatsApp Flow as a service (interactive) message. If the 24-hour window is closed, send a template with a FLOW button via /sendTemplate.
| body required | string Flow message body text |
string or object Flow header (string or text header object) | |
| footer | string Footer text |
| flowId required | string Published Flow ID |
| flowToken required | string Flow token generated by the business |
| flowCta required | string CTA button text |
| flowAction | string Enum: "navigate" "data_exchange" Flow action type |
object Required for flowAction=navigate (screen is required). Ignored for data_exchange. If data is provided, it must be a non-empty object. | |
| flowMessageVersion | string Flow message version (default "3") |
| mode | string Enum: "draft" "published" Flow mode (draft or published). If omitted, provider default applies |
object Shortcut for flowActionPayload.data (optional) | |
| flowActionScreen | string Shortcut for flowActionPayload.screen (optional) |
| quotedMsgId | string Quoted message ID (Cloud API) |
| chatId | string Required if phone is not set Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us (group). Used instead of the phone parameter. |
| phone | integer Required if chatId is not set A phone number starting with the country code. You do not need to add your number. USA example: 12020721369. |
{- "sent": true,
- "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",
- "description": "Message has been sent to the provider"
}Send a reaction (emoji) to a specific message in an existing chat. Use a single emoji character to add/update reaction, or an empty string to remove reaction. Provide either chatId or phone. Reference the target message via quotedMsgId.
| body required | string One emoji to add/update or empty string to remove |
| quotedMsgId required | string Quoted message ID (Cloud API) |
| chatId | string Required if phone is not set Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us (group). Used instead of the phone parameter. |
| phone | integer Required if chatId is not set A phone number starting with the country code. You do not need to add your number. USA example: 12020721369. |
body=%F0%9F%91%8D"edMsgId=wamid.HBgLdemo-text-001&chatId=12020721369%40c.us
{- "sent": true,
- "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",
- "description": "Message has been sent to the provider"
}Send a file to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.
| body required | string HTTP link https://... Or base64-encoded file with mime data, for example data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ... File in form-data input field |
| filename required | string File name, for example 1.jpg or hello.xlsx |
| caption | string Text under the file. When sending an image сan be used with mentionedPhones, example: this image for @556123122026 |
| quotedMsgId | string Quoted message ID (Cloud API) |
| chatId | string Required if phone is not set Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us (group). Used instead of the phone parameter. |
| phone | integer Required if chatId is not set A phone number starting with the country code. You do not need to add your number. USA example: 12020721369. |
{- "sent": true,
- "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",
- "description": "Message has been sent to the provider"
}Send a message to an existing chat. (Only if the dialogue has an Open Session). The message will be added to the queue for sending and delivered even if the phone is disconnected from the Internet or authorization is not passed.
Only one of two parameters is needed to determine the destination - chatId or phone.
| body required | string Message text, UTF-8 or UTF-16 string with emoji 🍏. Can be used with mentionedPhones, example: this text for @556123122026 |
| quotedMsgId | string Quoted message ID (Cloud API) |
| chatId | string Required if phone is not set Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us (group). Used instead of the phone parameter. |
| phone | integer Required if chatId is not set A phone number starting with the country code. You do not need to add your number. USA example: 12020721369. |
{- "sent": true,
- "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",
- "description": "Message has been sent to the provider"
}Send a location to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.
| lat required | string Latitude of the location. Example: 45.018337 |
| lng required | string Longitude of the location. Example: -73.968285 |
| address | string Address of the location. Only displayed if name is present. Example: 9766 Valley View St., New York, NY 10024 |
| name | string Name of the location. Example: Facebook HQ |
| quotedMsgId | string Quoted message ID (Cloud API) |
| chatId | string Required if phone is not set Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us (group). Used instead of the phone parameter. |
| phone | integer Required if chatId is not set A phone number starting with the country code. You do not need to add your number. USA example: 12020721369. |
{- "sent": true,
- "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",
- "description": "Message has been sent to the provider"
}Send a contact to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.
| contacts | Array of objects Array containing contact objects. Contact object parameters: name - full contact name. Required. Object with properties:
birthday - YYYY-MM-DD formatted string. Example: 2012-08-18 addresses - array containing address objects with parameters:
emails - array containing email objects with parameters:
org - object containing parameters:
phones - array containing phone objects with parameters:
urls - array containing url objects with parameters:
Example: [{"addresses":[{"city":"Menlo Park","country":"United States","country_code":"us","state":"CA","street":"1 Hacker Way","type":"HOME","zip":"94025"},{"city":"Menlo Park","country":"United States","country_code":"us","state":"CA","street":"200 Jefferson Dr","type":"WORK","zip":"94025"}],"birthday":"2012-08-18","emails":[{"email":"test@fb.com","type":"WORK"},{"email":"test@whatsapp.com","type":"WORK"}],"name":{"first_name":"John","formatted_name":"John Smith","last_name":"Smith"},"org":{"company":"WhatsApp","department":"Design","title":"Manager"},"phones":[{"phone":"+1 (940) 555-1234","type":"HOME"},{"phone":"+1 (650) 555-1234","type":"WORK","wa_id":"16505551234"}],"urls":[{"url":"https://www.facebook.com","type":"WORK"}]}] |
| quotedMsgId | string Quoted message ID (Cloud API) |
| chatId | string Required if phone is not set Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us (group). Used instead of the phone parameter. |
| phone | integer Required if chatId is not set A phone number starting with the country code. You do not need to add your number. USA example: 12020721369. |
{- "sent": true,
- "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",
- "description": "Message has been sent to the provider"
}You can send product cards via Carousel in two ways:
Template messages: do not require a 24-hour customer service window between you and the recipient. Use sendTemplate.
Free-form messages: can be sent only when a customer service window is open between you and the recipient. Use sendCarousel.
The message structure in /sendCarousel is largely similar to sending a template. However, in this case you must explicitly specify all elements that are created in advance when working with templates. This is because the message is sent without using a template.
In /sendCarousel, for sending a Catalog Carousel there can be either 1 URL button or one or more quick reply buttons.
| body | string Text shown above the carousel. Optional. If omitted and params include a body component, the body will be taken from params. |
| params required | Array of objects Required. Template-like structure (same as sendTemplate params). Must include a CAROUSEL component and its cards. Structure:
|
| quotedMsgId | string Quoted message ID (Cloud API) |
| chatId | string Required if phone is not set Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us (group). Used instead of the phone parameter. |
| phone | integer Required if chatId is not set A phone number starting with the country code. You do not need to add your number. USA example: 12020721369. |
{- "sent": true,
- "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",
- "description": "Message has been sent to the provider"
}By default, the message history is not saved for output in the method. To enable the method, write to technical support
| last | boolean Example: last=true Displays the last messages. If this parameter is passed, then lastMessageNumber is ignored. |
| lastMessageNumber | integer Example: lastMessageNumber=100 The lastMessageNumber parameter from the last response. Example: 100 |
| firstMessageNumber | integer Example: firstMessageNumber=1 The firstMessageNumber parameter from the last response. Example: 1 |
| limit | integer Example: limit=200 Sets length of the message list. Default 100. With value 0 returns all messages. |
| chatId | string Example: [email protected] Filter messages by chatId Chat ID from the message list. Example: 556123122026@c.us |
| min_time | integer Example: min_time=1665396610 Filter messages received after specified time. Example: 1665396610 |
| max_time | integer Example: max_time=1665396610 Filter messages received before specified time. Example: 1665396610 |
| msgId | string Example: msgId=0XzkmGNn4prUAQlzsHApGNRXQ0U Message ID. Example: 0XzkmGNn4prUAQlzsHApGNRXQ0U |
{- "messages": [
- {
- "messageNumber": 1,
- "id": "0XzkmGNn4prUAQlzsHApGNRXQ0U",
- "body": "Test message",
- "fromMe": true,
- "self": 1,
- "isForwarded": 0,
- "time": 1665396610,
- "type": "chat",
- "caption": null,
- "quotedMsgId": null,
- "meta": { },
- "metadata": { },
- "chatName": "556123122026"
}
]
}Create a WhatsApp group and return its invite link.
Beta test eligibility for group chats:
| groupName required | string Group name |
| description | string Group description |
{- "created": true,
- "groupID": "Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD",
- "name": "Group name",
- "timestamp": 1675964377
}Get active groups for the account.
| limit | integer Example: limit=100 Limit number of groups returned |
| before | string Example: before=MA== Pagination cursor for groups list (before) |
| after | string Example: after=MQ== Pagination cursor for groups list (after) |
{- "groups": [
- {
- "id": "Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD",
- "subject": "Group name",
- "description": "Group description",
- "participants": [
- {
- "wa_id": "79001234567",
- "type": "admin"
}
], - "chatId": "[email protected]"
}
], - "paging": {
- "before": "MA==",
- "after": "MQ=="
}
}Get group metadata and participants.
| group_id required | string Example: Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD Group ID without @g.us suffix. Example: Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD |
| fields | string Example: fields=subject,description,participants Comma-separated list of fields to return for group info |
{- "id": "Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD",
- "subject": "Group name",
- "description": "Group description",
- "participants": [
- {
- "wa_id": "79001234567",
- "type": "admin"
}
], - "chatId": "[email protected]"
}Update group name, description, or profile picture.
| group_id required | string Example: Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD Group ID without @g.us suffix. Example: Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD |
| subject | string New group name |
| description | string New group description |
| profile_picture_file | string Profile picture file handle or media ID |
{- "success": true
}Leave or delete the group (bot leaves).
| group_id required | string Example: Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD Group ID without @g.us suffix. Example: Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD |
{- "success": true
}Get group invite link.
| group_id required | string Example: Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD Group ID without @g.us suffix. Example: Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD |
{
}Reset and return a new group invite link.
| group_id required | string Example: Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD Group ID without @g.us suffix. Example: Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD |
{
}Remove participants from a group (admin only).
| group_id required | string Example: Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD Group ID without @g.us suffix. Example: Y2FwaV9ncm91cDoxNzA1NTU1MDEzOToxMjAzNjM0MDQ2OTQyMzM4MjAZD |
| participants required | Array of strings Array of participant phone numbers or objects like {"user":"..."} |
{- "success": true
}Send Template Message to a new or existing chat. Only one of two parameters is needed to determine the destination - chatId or phone.
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:
| namespace required | string Can be found by method /templates |
| template required | string Name of template |
required | object Object, containing fields "policy" and "code". policy - now "deterministic" is only available option; code - one of supported language codes |
Array of objects 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
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.
date_time - If the date_time object is used, further definition of the date and time is required.
button - if button has parameter
coupon_code - for COPY_CODE buttons use parameters with type coupon_code and coupon_code value. limited_time_offer - for limited-time offer templates:
cards - filled in if you need to send the Carousel template
The number of parameters passed must match the number of parameters in the template | |
| chatId | string Required if phone is not set Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us (group). Used instead of the phone parameter. |
| phone | integer Required if chatId is not set A phone number starting with the country code. You do not need to add your number. USA example: 12020721369. |
{- "sent": true,
- "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",
- "description": "Message has been sent to the provider"
}Create new template for sending.
Carousel templates (Cloud API only):
Coupon Code Templates (Cloud API only):
Limited-Time Offer Templates (Cloud API only):
Authentication Templates:
WhatsApp Flow templates (Cloud API):
Request examples are provided in the payload (requestBody/examples). Available variants:
| name | string Name of template |
| category | string (TemplateCategoryProp) Enum: "MARKETING" "UTILITY" "AUTHENTICATION" Template category |
Array of objects (TemplateComponentsProp) Array of template components | |
| language | string (TemplateLanguageProp) Enum: "af" "sq" "ar" "az" "bn" "bg" "ca" "zh_CN" "zh_HK" "zh_TW" "hr" "cs" "da" "nl" "en" "en_GB" "en_US" "et" "fil" "fi" "fr" "de" "el" "gu" "he" "hi" "hu" "id" "ga" "it" "ja" "kn" "kk" "ko" "lo" "lv" "lt" "mk" "ms" "mr" "nb" "fa" "pl" "pt_BR" "pt_PT" "pa" "ro" "ru" "sr" "sk" "sl" "es" "es_AR" "es_ES" "es_MX" "sw" "sv" "ta" "te" "th" "tr" "uk" "ur" "uz" "vi" Template language |
{ }{- "total": 3,
- "templates": [
- {
- "category": "MARKETING",
- "components": [
- {
- "type": "BODY",
- "format": "TEXT",
- "text": "header text {{1}}",
- "add_security_recommendation": true,
- "code_expiration_minutes": 5,
- "example": { },
- "buttons": [
- {
- "type": "QUICK_REPLY",
- "text": "phone-button-text",
- "otp_type": "COPY_CODE",
- "autofill_text": "Autofill",
- "package_name": "com.example.myapplication",
- "signature_hash": "K8a%2FAINcGX7",
- "phone_number": "+1(234) 235-5678",
- "example": [
- null
]
}
]
}
], - "language": "en",
- "name": "start",
- "namespace": "ca300906_cfbc_410b_99fb_dcee8e13d578",
- "rejected_reason": "NONE",
- "status": "approved"
}
]
}How to build and send messages with single and multiple products.
You can send product cards via Carousel in two ways:
Template messages: do not require a 24-hour customer service window between you and the recipient. Use sendTemplate.
Free-form messages: can be sent only when a customer service window is open between you and the recipient. Use sendCarousel.
The message structure in /sendCarousel is largely similar to sending a template. However, in this case you must explicitly specify all elements that are created in advance when working with templates. This is because the message is sent without using a template.
In /sendCarousel, for sending a Catalog Carousel there can be either 1 URL button or one or more quick reply buttons.
is_catalog_visible - Set to true to show catalog storefront icon or false to hide it. is_cart_enabled - Set to true to enable cart or false to disable it.
object |
{ }{- "success": true
}You can send product cards via Carousel in two ways:
Template messages: do not require a 24-hour customer service window between you and the recipient. Use sendTemplate.
Free-form messages: can be sent only when a customer service window is open between you and the recipient. Use sendCarousel.
The message structure in /sendCarousel is largely similar to sending a template. However, in this case you must explicitly specify all elements that are created in advance when working with templates. This is because the message is sent without using a template.
In /sendCarousel, for sending a Catalog Carousel there can be either 1 URL button or one or more quick reply buttons.
| body | string Text shown above the carousel. Optional. If omitted and params include a body component, the body will be taken from params. |
| params required | Array of objects Required. Template-like structure (same as sendTemplate params). Must include a CAROUSEL component and its cards. Structure:
|
| quotedMsgId | string Quoted message ID (Cloud API) |
| chatId | string Required if phone is not set Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us (group). Used instead of the phone parameter. |
| phone | integer Required if chatId is not set A phone number starting with the country code. You do not need to add your number. USA example: 12020721369. |
{- "sent": true,
- "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",
- "description": "Message has been sent to the provider"
}Send a single product or product list to a new or existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.
First, you need to upload your inventory to Facebook. You can use the API or Facebook’s Commerce Manager to do that. If you already have a Facebook catalog set up, we suggest that you leverage that catalog for WhatsApp commerce use cases.
You can not send products to Business WhatsApp clients.
required | object Object containing info about product or catalog. Can contain the following fields: catalog_id - id of catalog product_retailer_id - id of product. Only for sending single product. sections - used for sending multiply products. It`s array containing objects with catalog info. See example below. Example: {"catalog_id":"{{catalog_id}}","sections":[{"title":"the-section-title","product_items":[{"product_retailer_id":"{{SKU-1}}"},{"product_retailer_id":"{{SKU-2}}"}]},{"title":"the-section-title2","product_items":[{"product_retailer_id":"{{SKU-1}}"}]}]} |
| body | string Text of message. Example: Some text. |
| footer | string Located under the message text. Example: Footer. |
| header | string Header of catalog. Example: Header. Required when sending the catalog. |
| chatId | string Required if phone is not set Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us (group). Used instead of the phone parameter. |
| phone | integer Required if chatId is not set A phone number starting with the country code. You do not need to add your number. USA example: 12020721369. |
{- "sent": true,
- "id": "gBGGeRhGZTEfAgkJCh2wAz4ZH-8",
- "description": "Message has been sent to the provider"
}Upload media and get mediaId. Uploaded media can be sent in template
| body required | string HTTP link https://... Or base64-encoded file with mime data, for example data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ... File in form-data input field |
{- "mediaId": "ed2c7be7-b779-4ba8-a17c-6722f37be2a7"
}Limitations
Returns WABA-level template analytics settings.
curl -X GET 'https://api.1msg.io/{instanceId}/settings/templateAnalytics?token={token}'
{- "enable": true,
- "cta_url_link_tracking_opted_out": false,
- "external_id": "external_id"
}Enable/disable template analytics on the WABA.
| enable | boolean Enable template analytics on the WABA |
| cta_url_link_tracking_opted_out | boolean Disable URL button click tracking for a specific template |
| external_id | string Template external_id (required when setting cta_url_link_tracking_opted_out) |
{ }{- "enable": true,
- "cta_url_link_tracking_opted_out": false,
- "external_id": "external_id"
}Returns per-template URL button click tracking opt-out settings.
| template_external_id required | string Example: external_id Template external_id for per-template analytics setting (cta_url_link_tracking_opted_out). |
curl -X GET 'https://api.1msg.io/{instanceId}/settings/templateAnalyticsOptOut/<template_id>?token={token}'
{- "enable": true,
- "cta_url_link_tracking_opted_out": false,
- "external_id": "external_id"
}Enable/disable URL button click tracking for a specific template.
| template_external_id required | string Example: external_id Template external_id for per-template analytics setting (cta_url_link_tracking_opted_out). |
| enable | boolean Enable template analytics on the WABA |
| cta_url_link_tracking_opted_out | boolean Disable URL button click tracking for a specific template |
| external_id | string Template external_id (required when setting cta_url_link_tracking_opted_out) |
{ }{- "enable": true,
- "cta_url_link_tracking_opted_out": false,
- "external_id": "external_id"
}Template analytics are reported with daily granularity. Data is returned in UTC by default, or in the WABA timezone when use_waba_timezone=true.
Limitations:
If template analytics is disabled for the channel, the API returns an error: Template analytics is disabled for this channel.
| start required | string Example: start=2024-01-01 Start time for the date range. Unix timestamp or YYYY-MM-DD. If using use_waba_timezone=true, use YYYY-MM-DD. |
| end required | string Example: end=2024-01-07 End time for the date range. Unix timestamp or YYYY-MM-DD. If using use_waba_timezone=true, use YYYY-MM-DD. |
| granularity required | string Value: "DAILY" Example: granularity=DAILY Analytics granularity. Only DAILY is supported. |
| template_ids required | Array of strings Example: template_ids=1156697826259690&template_ids=1309207764213383 Array of template IDs to retrieve analytics for. Maximum 10. |
| metric_types | Array of strings Items Enum: "COST" "CLICKED" "DELIVERED" "READ" "SENT" "APP_ACTIVATIONS" "APP_ADD_TO_CART" "APP_CHECKOUTS_INITIATED" "APP_PURCHASES" "APP_PURCHASES_CONVERSION_VALUE" "WEBSITE_ADD_TO_CART" "WEBSITE_CHECKOUTS_INITIATED" "WEBSITE_PURCHASES" "WEBSITE_PURCHASES_CONVERSION_VALUE" Example: metric_types=SENT&metric_types=DELIVERED&metric_types=READ Types of metrics to retrieve. If omitted, all metric types are returned. |
| product_type | string Enum: "CLOUD_API" "MARKETING_MESSAGES_LITE_API" Example: product_type=CLOUD_API Filter metrics by product type. If omitted, only Cloud API metrics are returned. |
| use_waba_timezone | boolean Example: use_waba_timezone=true Show metrics in the WABA timezone. If true, start and end must be YYYY-MM-DD. |
curl -X GET 'https://api.1msg.io/{instanceId}/templateAnalytics?start=2024-01-01&end=2024-01-07&granularity=DAILY&template_ids=<template_id>&metric_types=SENT&product_type=CLOUD_API&token={token}'
{- "data": [
- {
- "granularity": "DAILY",
- "product_type": "CLOUD_API",
- "waba_timezone": "America/Los_Angeles",
- "data_points": [
- {
- "template_id": "1156697826259690",
- "start": 1759708800,
- "end": 1759795200,
- "sent": 3,
- "delivered": 3,
- "read": 3,
- "replied": 0,
- "clicked": [
- {
- "type": "url_button",
- "button_content": "Buy Now",
- "count": 3
}
], - "cost": [
- {
- "type": "amount_spent",
- "value": 0.26
}
]
}
]
}
], - "paging": {
- "cursors": {
- "before": "MAZDZD",
- "after": "MjQZD"
}
}
}Create a new WhatsApp Flow in draft state. Supports optional flow.json upload and immediate publish.
| name required | string Flow name |
| categories required | Array of strings (FlowCategory) Items Enum: "SIGN_UP" "SIGN_IN" "APPOINTMENT_BOOKING" "LEAD_GENERATION" "CONTACT_US" "CUSTOMER_SUPPORT" "SURVEY" "OTHER" Categories (comma or array) |
| endpointUri | string <uri> Data endpoint URL |
| cloneFlowId | string Clone existing flow id |
| publish | boolean Publish immediately |
string or object Flow JSON definition (string or object) | |
| file | string <binary> Optional flow.json upload |
{- "id": "string",
- "success": true,
- "flowJson": {
- "success": true,
- "validationErrors": [
- {
- "error": "string",
- "errorType": "string",
- "message": "string",
- "lineStart": 0,
- "lineEnd": 0,
- "columnStart": 0,
- "columnEnd": 0,
- "pointers": [
- {
- "lineStart": 0,
- "lineEnd": 0,
- "columnStart": 0,
- "columnEnd": 0,
- "path": "string"
}
]
}
]
}, - "publish": { }
}Returns all flows for the instance.
| fields | string Comma list of fields to return (id,name,status,categories,preview,validation_errors,json_version,data_api_version,endpoint_uri,data_channel_uri,whatsapp_business_account) |
{- "items": [
- {
- "id": "string",
- "name": "string",
- "status": "DRAFT",
- "categories": [
- "SIGN_UP"
], - "validationErrors": [
- {
- "error": "string",
- "errorType": "string",
- "message": "string",
- "lineStart": 0,
- "lineEnd": 0,
- "columnStart": 0,
- "columnEnd": 0,
- "pointers": [
- {
- "lineStart": 0,
- "lineEnd": 0,
- "columnStart": 0,
- "columnEnd": 0,
- "path": "string"
}
]
}
], - "jsonVersion": "string",
- "dataApiVersion": "string",
- "whatsappBusinessAccount": { }
}
], - "paging": { },
- "count": 0,
- "total": 0
}| flowId required | string Flow identifier |
| fields | string Comma list of fields to return (id,name,status,categories,preview,validation_errors,json_version,data_api_version,endpoint_uri,data_channel_uri,whatsapp_business_account) |
{- "id": "string",
- "name": "string",
- "status": "DRAFT",
- "categories": [
- "SIGN_UP"
], - "validationErrors": [
- {
- "error": "string",
- "errorType": "string",
- "message": "string",
- "lineStart": 0,
- "lineEnd": 0,
- "columnStart": 0,
- "columnEnd": 0,
- "pointers": [
- {
- "lineStart": 0,
- "lineEnd": 0,
- "columnStart": 0,
- "columnEnd": 0,
- "path": "string"
}
]
}
], - "jsonVersion": "string",
- "dataApiVersion": "string",
- "whatsappBusinessAccount": { }
}| flowId required | string Flow identifier |
| name | string |
| categories | Array of strings (FlowCategory) Items Enum: "SIGN_UP" "SIGN_IN" "APPOINTMENT_BOOKING" "LEAD_GENERATION" "CONTACT_US" "CUSTOMER_SUPPORT" "SURVEY" "OTHER" |
| endpointUri | string <uri> |
{ }{- "success": true
}| flowId required | string Flow identifier |
required | string or object Flow JSON definition |
| file | string <binary> flow.json upload |
{- "success": true,
- "validationErrors": [
- {
- "error": "string",
- "errorType": "string",
- "message": "string",
- "lineStart": 0,
- "lineEnd": 0,
- "columnStart": 0,
- "columnEnd": 0,
- "pointers": [
- {
- "lineStart": 0,
- "lineEnd": 0,
- "columnStart": 0,
- "columnEnd": 0,
- "path": "string"
}
]
}
]
}