문서가 업데이트되었습니다.
한국어로 번역이 아직 완료되지 않았습니다.
영어 업데이트됨: 11월 14일
한국어 업데이트됨: 10월 10일

We are making changes to the WhatsApp Business Platform pricing model. See Pricing Updates on the WhatsApp Business Platform.

Messages

Use the /PHONE_NUMBER_ID/messages endpoint to send text, media, contacts, location, and interactive messages, as well as message templates to your customers. Learn more about the messages you can send.

EndpointAuthentication

/PHONE_NUMBER_ID/messages

Developers can authenticate their API calls with the access token generated in the App Dashboard > WhatsApp > API Setup.


Solution Partners must authenticate themselves with an access token with the whatsapp_business_messaging permission.

Messages are identified by a unique ID (WAMID). You can track message status in the Webhooks through its WAMID. You could also mark an incoming message as read through messages endpoint. This WAMID can have a maximum length of up to 128 characters.

클라우드 API를 사용하는 경우 전화번호에 WhatsApp ID가 있는지 명시적으로 확인할 방법을 더 이상 제공하지 않습니다. 클라우드 API를 사용하여 누군가에게 메시지를 보내려면 고객이 옵트인한 후 고객의 전화번호로 직접 메시지를 전송하면 됩니다. 관련 예시는 참고 자료, 메시지를 참조하세요.

Message Object

To send a message, you must first assemble a message object with the content you want to send. These are the parameters used in a message object:

이름설명 (왼쪽 열의 화살표를 클릭하여 지원되는 옵션을 확인하세요.)

audio

개체

type=audio일 때 필수 항목.

오디오를 포함하는 media 개체.

biz_opaque_callback_data

문자열

선택 사항.

임의의 문자열이며, 추적에 사용합니다.


예를 들어 이 필드에 메시지 템플릿 ID를 전달하여 비즈니스가 전송한 첫 메시지부터 고객의 여정을 추적할 수 있습니다. 그런 다음, 다양한 메시지 템플릿 유형의 ROI를 추적하여 가장 효과적인 템플릿을 확인할 수 있습니다.


이 문자열은 Webhooks 페이로드 내의 statuses 개체에 포함되어 있으므로 WhatsApp Business 계정에서 messages Webhooks 필드를 구독하는 모든 앱은 이 문자열을 받을 수 있습니다.


클라우드 API는 이 필드를 처리하지 않고 메시지 전송됨/전달됨/읽음 Webhooks에서 반환합니다.


최대 512자입니다.


클라우드 API 전용.

contacts

개체

type=contacts일 때 필수 항목.

contacts 개체.

context

개체

대화 중 메시지에 답장하는 경우 필수 항목.

답장하려는 이전 메시지의 ID를 포함하는 개체. 예를 들면 다음과 같습니다.


{"message_id":"MESSAGE_ID"}


클라우드 API 전용.

document

개체

type=document일 때 필수 항목.

문서를 포함하는 media 개체.

hsm

개체

hsm 개체를 포함합니다. 이 옵션은 온프레미스 API의 v2.39부터 사용 중단되었습니다. 대신 template 개체를 사용하세요.


온프레미스 API 전용.

image

개체

type=image일 때 필수 항목.

이미지를 포함하는 media 개체.

interactive

개체

type=interactive일 때 필수 항목.

interactive 개체. 각 interactive 개체의 구성 요소는 일반적으로 일관된 패턴(header, body, footeraction)을 따릅니다.

location

개체

type=location일 때 필수 항목.

location 개체.

messaging_product

문자열

필수 항목.

요청에 사용된 메시지 서비스. "whatsapp"을 사용합니다.


클라우드 API 전용.

preview_url

부울

type=text일 때 필수 항목.

문자 메시지에서 URL 미리 보기 허용 — 문자 메시지에서 URL 전송을 참조하세요. 메시지에 URL을 포함하지 않는 경우 이 필드는 선택 사항입니다. 값:false(기본값), true.


온프레미스 API 전용. 클라우드 API 사용자는 텍스트 개체 내의 preview_url 필드와 동일한 기능을 사용할 수 있습니다.

recipient_type

문자열

선택 사항.

현재는 개인에게만 메시지를 보낼 수 있습니다. 이 필드를 individual로 설정하세요.


기본값: individual

status

문자열

메시지 상태. 이 필드를 사용하여 메시지를 read로 표시할 수 있습니다. 자세한 내용은 다음 가이드를 참조하세요.


sticker

개체

type=sticker일 때 필수 항목.

스티커를 포함하는 media 개체.


클라우드 API: 모든 유형의 인바운드 스티커 외에 고정 및 애니메이션 타사 아웃바운드 스티커도 지원됩니다. 고정 스티커는 512x512픽셀이어야 하고 100KB를 초과할 수 없습니다. 애니메이션 스티커는 512x512픽셀이어야 하고 500KB를 초과할 수 없습니다.


온프레미스 API: 모든 유형의 인바운드 스티커 외에 고정 타사 아웃바운드 스티커만 지원됩니다. 고정 스티커는 512x512픽셀이어야 하고 100KB를 초과할 수 없습니다. 애니메이션 스티커는 지원되지 않습니다.

template

개체

type=template일 때 필수 항목.

template 개체.

text

개체

문자 메시지에 필수 항목.

text 개체.

to

문자열

필수 항목.

메시지를 보낼 대상인 고객의 WhatsApp ID 또는 전화번호. 전화번호 형식을 참조하세요.


필요한 경우 온프레미스 API 사용자는 contacts 엔드포인트를 호출하여 이 번호를 받을 수 있습니다.

type

문자열

선택 사항.

전송하고자 하는 메시지 유형. 생략하는 경우 기본값은 text로 지정됩니다.

The following objects are nested inside the message object:

Contacts Object

NameDescription

addresses

object

Optional.

Full contact address(es) formatted as an addresses object. The object can contain the following fields:

streetstringOptional. Street number and name.

citystringOptional. City name.

statestringOptional. State abbreviation.

zipstringOptional. ZIP code.

countrystringOptional. Full country name.

country_codestringOptional. Two-letter country abbreviation.

typestringOptional. Standard values are HOME and WORK.

birthday

Optional.

YYYY-MM-DD formatted string.

emails

object

Optional.

Contact email address(es) formatted as an emails object. The object can contain the following fields:

emailstringOptional. Email address.

typestringOptional. Standard values are HOME and WORK.

name

object

Required.

Full contact name formatted as a name object. The object can contain the following fields:

formatted_namestringRequired. Full name, as it normally appears.

first_namestringOptional*. First name.

last_namestringOptional*. Last name.

middle_namestringOptional*. Middle name.

suffixstringOptional*. Name suffix.

prefixstringOptional*. Name prefix.


*At least one of the optional parameters needs to be included along with the formatted_name parameter.

org

object

Optional.

Contact organization information formatted as an org object. The object can contain the following fields:

companystringOptional. Name of the contact's company.

departmentstringOptional. Name of the contact's department.

titlestringOptional. Contact's business title.

phones

object

Optional.

Contact phone number(s) formatted as a phone object. The object can contain the following fields:

phonestringOptional. Automatically populated with the `wa_id` value as a formatted phone number.

typestringOptional. Standard Values are CELL, MAIN, IPHONE, HOME, and WORK.

wa_idstringOptional. WhatsApp ID.

urls

object

Optional.

Contact URL(s) formatted as a urls object. The object can contain the following fields:

urlstringOptional. URL.

typestringOptional. Standard values are HOME and WORK.

Interactive Object

NameDescription

action

object

Required.

Action you want the user to perform after reading the message.

body

object

Optional for type product. Required for other message types.

An object with the body of the message.


The body object contains the following field:

textstringRequired if body is present. The content of the message. Emojis and markdown are supported. Maximum length: 1024 characters.

footer

object

Optional. An object with the footer of the message.


The footer object contains the following field:

textstringRequired if footer is present. The footer content. Emojis, markdown, and links are supported. Maximum length: 60 characters.

header

object

Required for type product_list. Optional for other types.

Header content displayed on top of a message. You cannot set a header if your interactive object is of product type. See header object for more information.

type

object

Required.

The type of interactive message you want to send. Supported values:


  • button: Use for Reply Buttons.
  • catalog_message: Use for Catalog Messages.
  • list: Use for List Messages.
  • product: Use for Single-Product Messages.
  • product_list: Use for Multi-Product Messages.
  • flow: Use for Flows Messages.

The following objects are nested inside the interactive object:

Action Object

NameDescription

button

string

Required for List Messages.

Button content. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not.


Maximum length: 20 characters.

buttons

array of objects

Required for Reply Buttons.

A button object can contain the following parameters:


  • type: only supported type is reply (for Reply Button)
  • title: Button title. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters.
  • id: Unique identifier for your button. This ID is returned in the webhook when the button is clicked by the user. Maximum length: 256 characters.

You can have up to 3 buttons. You cannot have leading or trailing spaces when setting the ID.

catalog_id

string

Required for Single Product Messages and Multi-Product Messages.

Unique identifier of the Facebook catalog linked to your WhatsApp Business Account. This ID can be retrieved via the Meta Commerce Manager.

product_retailer_id

string

Required for Single Product Messages and Multi-Product Messages.

Unique identifier of the product in a catalog.


To get this ID go to Meta Commerce Manager and select your Meta Business account. You will see a list of shops connected to your account. Click the shop you want to use. On the left-side panel, click Catalog > Items, and find the item you want to mention. The ID for that item is displayed under the item's name.

sections

array of objects

Required for List Messages and Multi-Product Messages.

Array of section objects. Minimum of 1, maximum of 10. See section object.

mode

string

Optional for Flows Messages.

The current mode of the Flow, either draft or published.


Default: published

flow_message_version

string

Required for Flows Messages.

Must be 3.

flow_token

string

Required for Flows Messages.

A token that is generated by the business to serve as an identifier.

flow_id

string

Required for Flows Messages.

Unique identifier of the Flow provided by WhatsApp.

flow_cta

string

Required for Flows Messages.

Text on the CTA button, eg. "Signup".


Maximum length: 20 characters (no emoji).

flow_action

string

Optional for Flows Messages.

navigate or data_exchange. Use navigate to predefine the first screen as part of the message. Use data_exchange for advanced use-cases where the first screen is provided by your endpoint.


Default: navigate

flow_action_payload

object

Optional for Flows Messages.

Required only if flow_action is navigate. The object can contain the following parameters:

screenstringRequired. The id of the first screen of the Flow.

dataobjectOptional. The input data for the first screen of the Flow. Must be a non-empty object.

Header Object

NameDescription

document

object

Required if type is set to document.

Contains the media object for this document.

image

object

Required if type is set to image.

Contains the media object for this image.

text

string

Required if type is set to text.

Text for the header. Formatting allows emojis, but not markdown.


Maximum length: 60 characters.

sub_text

string

Optional.

Text for the header. Formatting allows emojis, but not markdown.


Maximum length: 60 characters.

type

string

Required.

The header type you would like to use. Supported values:


  • text: Used for List Messages, Reply Buttons, and Multi-Product Messages.
  • video: Used for Reply Buttons.
  • image: Used for Reply Buttons.
  • document: Used for Reply Buttons.

video

object

Required if type is set to video.

Contains the media object for this video.

Section Object

NameDescription

product_items

array of objects

Required for Multi-Product Messages.

Array of product objects. There is a minimum of 1 product per section and a maximum of 30 products across all sections.


Each product object contains the following field:


  • product_retailer_idstringRequired for Multi-Product Messages. Unique identifier of the product in a catalog. To get this ID, go to the Meta Commerce Manager, select your account and the shop you want to use. Then, click Catalog > Items, and find the item you want to mention. The ID for that item is displayed under the item's name.

rows

array of objects

Required for List Messages.

Contains a list of rows. You can have a total of 10 rows across your sections.


Each row must have a title (Maximum length: 24 characters) and an ID (Maximum length: 200 characters). You can add a description (Maximum length: 72 characters), but it is optional.


Example:

"rows": [
  {
   "id":"unique-row-identifier-here",
   "title": "row-title-content-here",
   "description": "row-description-content-here",           
   }
]

title

string

Required if the message has more than one section.

Title of the section.


Maximum length: 24 characters.

Location Object

NameDescription

latitude

Required.

Location latitude in decimal degrees.

longitude

Required.

Location longitude in decimal degrees.

name

Required.

Name of the location.

address

Required.

Address of the location.

Media Object

See Get Media ID for information on how to get the ID of your media object. For information about supported media types for Cloud API, see Supported Media Types.

NameDescription

id

string

Required when type is audio, document, image, sticker, or video and you are not using a link.


The media object ID. Do not use this field when message type is set to text.

link

string

Required when type is audio, document, image, sticker, or video and you are not using an uploaded media ID (i.e. you are hosting the media asset on your public server).

The protocol and URL of the media to be sent. Use only with HTTP/HTTPS URLs.


Do not use this field when message type is set to text.


Cloud API users only:


  • See Media HTTP Caching if you would like us to cache the media asset for future messages.
  • When we request the media asset from your server you must indicate the media's MIME type by including the Content-Type HTTP header. For example: Content-Type: video/mp4. See Supported Media Types for a list of supported media and their MIME types.

caption

string

Optional.


Media asset caption. Do not use with audio or sticker media.


On-Premises API users:

  • For v2.41.2 or newer, this field is is limited to 1024 characters.
  • Captions are currently not supported for document media.

filename

string

Optional.


Describes the filename for the specific document. Use only with document media.


The extension of the filename will specify what format the document is displayed as in WhatsApp.

provider

string

Optional. On-Premises API only.

This path is optionally used with a link when the HTTP/HTTPS link is not directly accessible and requires additional configurations like a bearer token. For information on configuring providers, see the Media Providers documentation.

Template Object

NameDescription

name

Required.

Name of the template.

language

object

Required.

Contains a language object. Specifies the language the template may be rendered in.


The language object can contain the following fields:

policystringRequired. The language policy the message should follow. The only supported option is deterministic. See Language Policy Options.

codestringRequired. The code of the language or locale to use. Accepts both language and language_locale formats (e.g., en and en_US). For all codes, see Supported Languages.

components

array of objects

Optional.

Array of components objects containing the parameters of the message.

namespace

Optional. Only used for On-Premises API.

Namespace of the template.

The following objects are nested inside the template object:

Button Parameter Object

NameDescription (Click the arrow in the left column for supported options.)

type

string

Required.

Indicates the type of parameter for the button.

Supported Options

  • "payload"
  • "text"

payload

Required for quick_reply buttons.

Developer-defined payload that is returned when the button is clicked in addition to the display text on the button.


See Callback from a Quick Reply Button Click for an example.

text

Required for URL buttons.

Developer-provided suffix that is appended to the predefined prefix URL in the template.

Components Object

NameDescription (Click the arrow in the left column for supported options.)

type

string

Required.

Describes the component type.


Example of a components object with an array of parameters object nested inside:

 "components": [{
   "type": "body",
   "parameters": [{
                "type": "text",
                "text": "name"
            },
            {
            "type": "text",
            "text": "Hi there"
            }]
      }] 

Supported Options

  • header
  • body
  • button

For text-based templates, we only support the type=body.

sub_type

string

Required when type=button. Not used for the other types.

Type of button to create.

Supported Options

  • quick_reply: Refers to a previously created quick reply button that allows for the customer to return a predefined message.
  • url: Refers to a previously created button that allows the customer to visit the URL generated by appending the text parameter to the predefined prefix URL in the template.
  • catalog: Refers to a previously created catalog button that allows for the customer to return a full product catalog.

parameters

array of objects

Required when type=button.

Array of parameter objects with the content of the message.

For components of type=button, see the button parameter object.

index

Required when type=button. Not used for the other types.

Position index of the button. You can have up to 10 buttons using index values of 0 to 9.

Currency Object

NameDescription

fallback_value

Required.

Default text if localization fails.

code

Required.

Currency code as defined in ISO 4217.

amount_1000

Required.

Amount multiplied by 1000.

Date_Time Object

NameDescription

fallback_value

Required.

Default text. For Cloud API, we always use the fallback value, and we do not attempt to localize using other optional fields.

Parameter Object

NameDescription

type

string

Required.

Describes the parameter type. Supported values:


  • currency
  • date_time
  • document
  • image
  • text
  • video

For text-based templates, the only supported parameter types are currency, date_time, and text.

text

string

Required when type=text.

The message’s text. Character limit varies based on the following included component type.


For the header component type:

  • 60 characters

For the body component type:

  • 1024 characters if other component types are included
  • 32768 characters if body is the only component type included

currency

object

Required when type=currency.

A currency object.

date_time

object

Required when type=date_time.

A date_time object.

image

object

Required when type=image.

A media object of type image. Captions not supported when used in a media template.

document

object

Required when type=document.

A media object of type document. Only PDF documents are supported for media-based message templates. Captions not supported when used in a media template.

video

object

Required when type=video.

A media object of type video. Captions not supported when used in a media template.

Text Object

NameDescription

body

string

Required for text messages.

The text of the text message which can contain URLs which begin with http:// or https:// and formatting. See available formatting options here.


If you include URLs in your text and want to include a preview box in text messages (preview_url: true), make sure the URL starts with http:// or https://https:// URLs are preferred. You must include a hostname, since IP addresses will not be matched.


Maximum length: 4096 characters

preview_url

boolean

Optional. Cloud API only.

Set to true to have the WhatsApp Messenger and WhatsApp Business apps attempt to render a link preview of any URL in the body text string. URLs must begin with http:// or https://. If multiple URLs are in the body text string, only the first URL will be rendered.


If preview_url is omitted, or if unable to retrieve a preview, a clickable link will be rendered instead.


On-Premises API users, use preview_url in the top-level message payload instead. See Parameters.

Reaction Object

NameDescription

message_id

string

Required.

The WhatsApp Message ID (wamid) of the message on which the reaction should appear. The reaction will not be sent if:


  • The message is older than 30 days
  • The message is a reaction message
  • The message has been deleted

If the ID is of a message that has been deleted, the message will not be delivered.

emoji

string

Required.

Emoji to appear on the message.


  • All emojis supported by Android and iOS devices are supported.
  • Rendered-emojis are supported.
  • If using emoji unicode values, values must be Java- or JavaScript-escape encoded.
  • Only one emoji can be sent in a reaction message
  • Use an empty string to remove a previously sent emoji.

Overview

Guides

See the following guides for full information on how to use the /messages endpoint to send messages:

Examples

Text Messages

curl -X  POST \
'https://graph.facebook.com/v21.0/FROM_PHONE_NUMBER_ID/messages' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '
    {
      "messaging_product": "whatsapp",
      "recipient_type": "individual",
      "to": "PHONE_NUMBER",
      "type": "text",
      "text": { // the text object
        "preview_url": false,
        "body": "MESSAGE_CONTENT"
        }
    }'

Reaction Messages

curl -X  POST \
 'https://graph.facebook.com/v21.0/FROM_PHONE_NUMBER_ID/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "reaction",
  "reaction": {
    "message_id": "wamid.HBgLM...",
    "emoji": "\uD83D\uDE00"
  }
}'

Media Messages

curl -X  POST \
 'https://graph.facebook.com/v21.0/FROM-PHONE-NUMBER-ID/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE-NUMBER",
  "type": "image",
  "image": {
    "id" : "MEDIA-OBJECT-ID"
  }
}'

Location Messages

curl -X  POST \
 'https://graph.facebook.com/v21.0/FROM_PHONE_NUMBER_ID/messages' \
 -H 'Authorization: ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "to": "PHONE_NUMBER",
  "type": "location",
  "location": {
    "longitude": LONG_NUMBER,
    "latitude": LAT_NUMBER,
    "name": LOCATION_NAME,
    "address": LOCATION_ADDRESS
  }
}'

Contact Messages

curl -X  POST \
 'https://graph.facebook.com/v21.0/FROM_PHONE_NUMBER_ID/messages' \
 -H 'Authorization: ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "to": "PHONE_NUMBER",
  "type": "contacts",
  "contacts": [{
      "addresses": [{
          "street": "STREET",
          "city": "CITY",
          "state": "STATE",
          "zip": "ZIP",
          "country": "COUNTRY",
          "country_code": "COUNTRY_CODE",
          "type": "HOME"
        },
        {
          "street": "STREET",
          "city": "CITY",
          "state": "STATE",
          "zip": "ZIP",
          "country": "COUNTRY",
          "country_code": "COUNTRY_CODE",
          "type": "WORK"
        }],
      "birthday": "YEAR_MONTH_DAY",
      "emails": [{
          "email": "EMAIL",
          "type": "WORK"
        },
        {
          "email": "EMAIL",
          "type": "HOME"
        }],
      "name": {
        "formatted_name": "NAME",
        "first_name": "FIRST_NAME",
        "last_name": "LAST_NAME",
        "middle_name": "MIDDLE_NAME",
        "suffix": "SUFFIX",
        "prefix": "PREFIX"
      },
      "org": {
        "company": "COMPANY",
        "department": "DEPARTMENT",
        "title": "TITLE"
      },
      "phones": [{
          "phone": "PHONE_NUMBER",
          "type": "HOME"
        },
        {
          "phone": "PHONE_NUMBER",
          "type": "WORK",
          "wa_id": "PHONE_OR_WA_ID"
        }],
      "urls": [{
          "url": "URL",
          "type": "WORK"
        },
        {
          "url": "URL",
          "type": "HOME"
        }]
    }]
}'

Interactive Messages

Single-Product Messages

curl -X  POST \
 'https://graph.facebook.com/v21.0/FROM_PHONE_NUMBER/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
   "messaging_product": "whatsapp",
   "recipient_type": "individual",
   "to": "PHONE_NUMBER",
   "type": "interactive",
   "interactive": {
     "type": "product",
     "body": {
       "text": "optional body text"
     },
     "footer": {
       "text": "optional footer text"
     },
     "action": {
       "catalog_id": "CATALOG_ID",
       "product_retailer_id": "ID_TEST_ITEM_1"
     }
   }
 }'

Multi-Product Messages

curl -X  POST \
 'https://graph.facebook.com/v21.0/FROM_PHONE_NUMBER/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
 "messaging_product": "whatsapp",
   "recipient_type": "individual",
   "to": "PHONE_NUMBER",
   "type": "interactive",
   "interactive": {
     "type": "product_list",
     "header":{
       "type": "text",
       "text": "header-content"
     },
     "body": {
       "text": "body-content"
     },
     "footer": {
       "text": "footer-content"
     },
     "action": {
       "catalog_id": "CATALOG_ID",
       "sections": [
         {
           "title": "section-title",
           "product_items": [
             { "product_retailer_id": "product-SKU-in-catalog" },
             { "product_retailer_id": "product-SKU-in-catalog" },
             ...
           ]
         },
         {
           "title": "section-title",
           "product_items": [
             { "product_retailer_id": "product-SKU-in-catalog" },
             { "product_retailer_id": "product-SKU-in-catalog" },
             ...
           ]
         }
       ]
     }
   }
 }

Catalog Messages

curl -X  POST \
 'https://graph.facebook.com/v21.0/FROM_PHONE_NUMBER/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "interactive",
  "interactive" : {
    "type" : "catalog_message",
    "body" : {
      "text": "Thanks for your order! Tell us what address you’d like this order delivered to."
    },
    "action": {
      "name": "catalog_message",
      "parameters": { 
        "thumbnail_product_retailer_id": "<Product-retailer-id>"
      }
    }
  }
}'

Flows Messages

curl -X  POST \
 'https://graph.facebook.com/v21.0/FROM_PHONE_NUMBER/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "interactive",
  "interactive" : {
    "type": "flow",
    "header": {
      "type": "text",
      "text": "Flow message header"
    },
    "body": {
      "text": "Flow message body"
    },
    "footer": {
      "text": "Flow message footer"
    },
    "action": {
      "name": "flow",
      "parameters": {
        "flow_message_version": "3",
        "flow_token": "AQAAAAACS5FpgQ_cAAAAAD0QI3s",
        "flow_id": "<FLOW_ID>",
        "flow_cta": "Book!",
        "flow_action": "navigate",
        "flow_action_payload": {
          "screen": "<SCREEN_ID>",
          "data": {
            "user_name": "name",
            "user_age": 25
          }
        }
      }
    }
  }
}'
  

List Messages

curl -X  POST \
 'https://graph.facebook.com/v21.0/FROM_PHONE_NUMBER_ID/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "interactive",
  "interactive": {
    "type": "list",
    "header": {
      "type": "text",
      "text": "HEADER_TEXT"
    },
    "body": {
      "text": "BODY_TEXT"
    },
    "footer": {
      "text": "FOOTER_TEXT"
    },
    "action": {
      "button": "BUTTON_TEXT",
      "sections": [
        {
          "title": "SECTION_1_TITLE",
          "rows": [
            {
              "id": "SECTION_1_ROW_1_ID",
              "title": "SECTION_1_ROW_1_TITLE",
              "description": "SECTION_1_ROW_1_DESCRIPTION"
            },
            {
              "id": "SECTION_1_ROW_2_ID",
              "title": "SECTION_1_ROW_2_TITLE",
              "description": "SECTION_1_ROW_2_DESCRIPTION"
            }
          ]
        },
        {
          "title": "SECTION_2_TITLE",
          "rows": [
            {
              "id": "SECTION_2_ROW_1_ID",
              "title": "SECTION_2_ROW_1_TITLE",
              "description": "SECTION_2_ROW_1_DESCRIPTION"
            },
            {
              "id": "SECTION_2_ROW_2_ID",
              "title": "SECTION_2_ROW_2_TITLE",
              "description": "SECTION_2_ROW_2_DESCRIPTION"
            }
          ]
        }
      ]
    }
  }
}'

Reply Button

curl -X  POST \
 'https://graph.facebook.com/v21.0/FROM_PHONE_NUMBER_ID/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "interactive",
  "interactive": {
    "type": "button",
    "body": {
      "text": "BUTTON_TEXT"
    },
    "action": {
      "buttons": [
        {
          "type": "reply",
          "reply": {
            "id": "UNIQUE_BUTTON_ID_1",
            "title": "BUTTON_TITLE_1"
          }
        },
        {
          "type": "reply",
          "reply": {
            "id": "UNIQUE_BUTTON_ID_2",
            "title": "BUTTON_TITLE_2"
          }
        }
      ]
    }
  }
}'

Rating Messages

curl -X  POST \
 'https://graph.facebook.com/v21.0/FROM_PHONE_NUMBER_ID/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "interactive",
  "interactive": {	
    "type": "form_message",
    "header": {
      "type": "text",
      "text": "Rate your experience?",
      "sub_text": "Select star to rate your experience"
    },
    "parameters": {
      "version": "1",
      "layout": [
        {
          "type": "Rating",
          "rating_type": "STAR_RATING",
          "id": "rating-id-1"
        }
      ]
    },
    "action": {
      "name": "form_message"
    }
  }
}'

Template Messages

curl -X  POST \
 'https://graph.facebook.com/v21.0/FROM_PHONE_NUMBER_ID/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "PHONE_NUMBER",
  "type": "template",
  "template": {
    "name": "TEMPLATE_NAME",
    "language": {
      "code": "LANGUAGE_AND_LOCALE_CODE"
    },
    "components": [
      {
        "type": "header",
        "parameters": [
          {
            "type": "image",
            "image": {
              "link": "http(s)://URL"
            }
          }
        ]
      },
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "TEXT_STRING"
          },
          {
            "type": "currency",
            "currency": {
              "fallback_value": "VALUE",
              "code": "USD",
              "amount_1000": NUMBER
            }
          },
          {
            "type": "date_time",
            "date_time": {
              "fallback_value": "MONTH DAY, YEAR"
            }
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "quick_reply",
        "index": "0",
        "parameters": [
          {
            "type": "payload",
            "payload": "PAYLOAD"
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "quick_reply",
        "index": "1",
        "parameters": [
          {
            "type": "payload",
            "payload": "PAYLOAD"
          }
        ]
      }
    ]
  }
}'

Reply To Message

curl -X POST \
 'https://graph.facebook.com/v21.0/FROM_PHONE_NUMBER/messages' \
 -H 'Authorization: Bearer ACCESS_TOKEN' \
 -H 'Content-Type: application/json' \
 -d '{
  "messaging_product": "whatsapp",
  "context": {
     "message_id": "MESSAGE_ID"
  },
  "to": "PHONE_NUMBER",
  "type": "text",
  "text": {
    "preview_url": false,
    "body": "your-text-message-content"
  }
}’

Successful Response

    {
      "messaging_product": "whatsapp",
      "contacts": [
        {
          "input": "16505555555",
          "wa_id": "16505555555"
        }
      ],
      "messages": [
        {
          "id": "wamid.HBgLMTY1MDUwNzY1MjAVAgARGBI5QTNDQTVCM0Q0Q0Q2RTY3RTcA"
        }
      ]
    }
    

Applies to businesses in Brazil, Colombia, and Singapore, starting September 12, 2023. Applies to all businesses starting October 12, 2023.

Messages will have one of the following statuses which will be returned in each of the messages objects

  • "message_status":"accepted" : means the message was sent to the intended recipient
  • "message_status":"held_for_quality_assessment": means the message send was delayed until quality can be validated and it will either be sent or dropped at this point

      {
      "messaging_product": "whatsapp",
      "contacts": [
        {
          "input": "16505555555",
          "wa_id": "16505555555"
        }
      ],
      "messages": [
        {
          "id": "wamid.HBgLMTY1MDUwNzY1MjAVAgARGBI5QTNDQTVCM0Q0Q0Q2RTY3RTcA",
          "message_status": "accepted",
        }
      ]
    }