When creating ads that Click to Instagram Direct, you can connect a message flow from a messaging partner app. A message flow can include text, images, emoji, buttons, and other message types supported by the Send API.
This guide shows how to create and manage welcome message flows via the Instagram Platform.
This guide assumes you have read the Instagram Platform Overview and implemented the needed components for using this API, such as Instagram Login for Business to receive Instagram User access tokens and a webhooks server to receive notifications.
You will need the following:
All endpoints can be accessed via the graph.instagram.com
host.
/welcome_message_flows
/<APP_USERS_INSTAGRAM_PRO_ID>
or /me
instagram_business_basic
instagram_business_manage_messages
Linking a Facebook Page to the Instagram professional account allows for the welcome message flows to be visible in Ads Manager and accessible for other ad types.
To create a welcome message flow, send a POST
request to the /me/welcome_message_flows
endpoint with the following properties:
eligible_platforms
set to "instagram"
(Only Instagram is supported.)name
set to the name of the flowwelcome_message_flow
set to an array of message
objects with:
message.text
set to your app user's welcome messagemessage.quick_replies
set to an array defining each quick reply with:
content_type
set to text
title
set to the quick reply button text payload
set to the content to be sent in a webhook notification when a person clicks that button
curl -X POST -H "Content-Type: application/json"
-d '{
"eligible_platforms":["instagram"],
"name"="<WELCOME_MESSAGE_FLOW_NAME>",
"welcome_message_flow": [
{
"message": {
"text":"<WELCOME_MESSAGE_TEXT>",
"quick_replies":[
{
"content_type":"text",
"title":"<QUICK_REPLY_TEXT_1>",
"payload":"<QUICK_REPLY_TEXT_1_WEBHOOK_CONTENT>"
},
{
"content_type":"text",
"title":"<QUICK_REPLY_TEXT_2>",
"payload":"<QUICK_REPLY_TEXT_2_WEBHOOK_CONTENT>"
},
{
"content_type":"text",
"title":"<QUICK_REPLY_TEXT_3>",
"payload":"<QUICK_REPLY_TEXT_3_WEBHOOK_CONTENT>"
}
]
}
}
]
}' "https://graph.instagram.com/v21.0
/me/welcome_message_flows?access_token=<INSTAGRAM_USER_ACCESS-TOKEN>"
On success your app receives an ID for the welcome message flow.
{ "flow_id":"<WELCOME_MESSAGE_FLOW_ID>" }
Properties | Description |
---|---|
Array of strings | Required. The platforms that the welcome message can be shown on, |
String | Required. Name of the flow |
Array of message objects | Required. An array of message objects that contain the welcome message text and an array of quick replies sent upon clicking the ad |
welcome_message_flow Properties | Description |
---|---|
Object | Required. An objects that contain the welcome message text and an array of quick replies sent upon clicking the ad |
String | Required. The welcome message text sent upon clicking the ad |
Array | Required. An array of objects that defines each quick reply including the content type of each quick reply, the text shown in each quick reply button, and the content sent via webhook notification when the quick reply that is selected. |
String | Required. Must be |
String | Required. The content sent in a webhook notification when a person clicks on the associated quick reply button |
String | Required. The text shown in the quick reply button. |
To get a list of your app user's welcome message flows, send a GET
request to /me/welcome_message_flows
endpoint.
Formatted for readability.
curl -X GET "https://graph.instagram.com/v21.0
/me/welcome_message_flows
?access_token=<INSTAGRAM_USER_ACCESS-TOKEN>"
On success, your app will receive a list of flows.
[ { "id":"<WELCOME_FLOW_1_ID>", "name":"<WELCOME_FLOW_1_NAME>", "welcome_message":"<MESSAGE_1_OBJECT_CONTENT>", "eligible_platforms": ["instagram"], "last_update_time":"2023-09-01T05:20:38+0000", "is_used_in_ad": false // indicates whether or not a flow is used in an ad }, { "id":"<WELCOME_FLOW_2_ID>", "name":"<WELCOME_FLOW_2_NAME>", "welcome_message":"<MESSAGE_2_OBJECT_CONTENT>", "eligible_platforms": ["instagram"], "last_update_time":"2023-08-25T08:21:48+0000", "is_used_in_ad": true }, { "id":"<WELCOME_FLOW_3_ID>", "name":"<WELCOME_FLOW_3_NAME>", "welcome_message":"<MESSAGE_3_OBJECT_CONTENT>", "eligible_platforms": ["instagram"], "last_update_time":"2023-08-20T07:43:00+0000", "is_used_in_ad": true } ... ... ... ]
Note: You can limit the number of flows returned by including the limit
parameter set to the number you want returned.
To get a specific flow, send a GET
request to /me/welcome_message_flows
endpoint with the flow_id
parameter set to the the flow ID being queried.
Formatted for readability.
curl -X GET "https://graph.instagram.com/v21.0
/me/welcome_message_flows
?access_token=<INSTAGRAM_USER_ACCESS-TOKEN>"
On success, your app receives a JSON object with the data about the specific flow queried.
To update an existing flow, send a POST
request to the /me/welcome_message_flows
endpoint with:
flow_id
parameter set to the ID of the flow being updatedname
welcome_message
platforms
A flow that is currently connected to an advertisement cannot be updated. Check the is_used_in_ad
field to determine whether a flow is connected to an advertisement.
Formatted for readability.
curl -X POST "https://graph.instagram.com/v21.0
/me/welcome_message_flows \
?access_token=<INSTAGRAM_USER_ACCESS-TOKEN> \
&flow_id=<WELCOME_FLOW_3_ID> \
&name=<WELCOME_FLOW_3_NEW_NAME>"
On success, your app receives a JSON object with success
set to true
.
{"success":true}
To delete a flow, send a DELETE
request to /me/welcome_message_flows
endpoint with the flow_id
parameter set to the ID of the flow to be deleted.
A flow that is currently connected to an advertisement cannot be deleted. Check the is_used_in_ad
field to determine whether a flow is connected to an advertisement.
Formatted for readability.
curl -X DELETE "https://graph.instagram.com/v21.0
/me/welcome_message_flows
?access_token=<INSTAGRAM_USER_ACCESS-TOKEN> \
&flow_id=<WELCOME_FLOW_3_ID>"
On success, your app receives a JSON object with success
set to true
.
Now that you have welcome message flows, they can be used to create ads using the Marketing API or the Ads Manager.
Ads managerWhen creating a new engagement ad, scroll down to the Message template section and select Partner App. |
Select the appropriate messaging Partner App. | Select the Welcome Message Flow. |
Preview your message flow.