Flow

Creates a template with one FLOW button. flow_action navigate opens a static flow on navigate_screen; data_exchange opens a dynamic flow whose first screen comes from the flow endpoint. Dynamic flows need a published flow with an endpoint and an uploaded business public key; these are checked by WhatsApp after submission (the template moves to FAILED), not by this API.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
📘

Static and dynamic flows

A flow template has exactly one FLOW button. The button's flow_action decides the flow type:

  • navigate (static flow): the flow opens on navigate_screen, which is required. This is the default when flow_action is omitted or empty.
  • data_exchange (dynamic flow): the first screen comes from your flow endpoint, so navigate_screen is not needed (it is ignored if sent). See Dynamic flow prerequisites.

flow_action is case-insensitive (data_exchange and DATA_EXCHANGE both work). You don't need the isFlow parameter: a template is a flow template because it has a FLOW button.

Request Parameters

KeyDescriptionValueData typeRequired/OptionalConstraints
AuthorizationAccess Token for the application{{PARTNER_APP_TOKEN}}StringRequiredShould be a valid Partner App Access Token
appIdApp ID to fetch the access token{{APP_ID}}StringRequired
  • The Id should be a valid app Id of Gupshup.
  • The App must be associated with the account that owns the PARTNER_APP_TOKEN being used
elementNameThe name of a template. Element name is unique for a WABAs namespace.{{ELEMENT_NAME}}StringRequiredelementName (not more than 180char.) Mandatory fields
languageCodeLanguage code for the template. Refer to all the language codes here.{{LANGUAGE_CODE}}StringOptionallanguageCode default value : en\_US
contentThe body of the template.{{CONTENT}}StringRequiredcontent (not more than 1024 char.)
categoryThe category of your template.{{CATEGORY}}StringRequiredCategory Type: MARKETING UTILITY
verticalTEXT{{VERTICAL}}StringRequiredvertical (not more than 180 char.)
templateTypeDOCUMENT{{TEMPLATE_TYPE}}StringRequiredThe type of template: PRODUCT
exampleTemplate Example{{EXAMPLE}}StringRequired
enableSampleRequired for creating all types of templates{{ENABLE_SAMPLE}}true/falseOptionalif enableSample is true then exampleMedia
headerHeader of the template.{{HEADER}}StringOptional
footerFooter of the template. Character limit: 60.{{FOOTER}}StringOptional
exampleHeaderThis is the header{{EXAMPLE_HEADER}}StringOptional
allowTemplateCategoryChangeBoolean value. If True, Meta will automatically update the category of the template as per the template content. Default
value is False.
{{ALLOW_TEMPLATE_CATEGORY_CHANGE}}StringOptional
buttonsJSON array with exactly one button of type FLOW. Button keys: type (FLOW), text, flow_id or flow_json, flow_action (navigate or data_exchange), navigate_screen (static flows only), icon (optional).Static: [{"type":"FLOW","text":"Open flow","flow_id":"{{FLOW_ID}}","flow_action":"navigate","navigate_screen":"{{SCREEN_ID}}"}]

Dynamic: [{"type":"FLOW","text":"Open flow","flow_id":"{{FLOW_ID}}","flow_action":"data_exchange"}]
String (JSON array)Required
  • Only one button, and it must be of type FLOW
    text: 1–25 characters
    flow_id or flow_json is required
    flow_action: navigate (default) or data_exchange, case-insensitive
    navigate_screen: required for navigate

Sample Request

curl --location 'https://partner.gupshup.io/partner/app/:appId/templates' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--data-urlencode 'elementName=test_flows_1' \
--data-urlencode 'languageCode=en' \
--data-urlencode 'content=Hi {{1}},
Today is the last day of the BIg Billion Day'\''s sale. Make the most out of it!' \
--data-urlencode 'category=MARKETING' \
--data-urlencode 'templateType=IMAGE' \
--data-urlencode 'example=Hi Sam,
Today is the last day of the BIg Billion Day'\''s sale. Make the most out of it!' \
--data-urlencode 'enableSample=true' \
--data-urlencode 'allowTemplateCategoryChange=true' \
--data-urlencode 'vertical=Sample template using Flow button with others' \
--data-urlencode 'buttons=
[
	{
		"type": "FLOW",
		"text": "Share Interests",
    "flow_id": "3961313760791090",
    "flow_action": "NAVIGATE",
    "navigate_screen": "SEGMENTS_SCREEN",
		"icon": "PROMOTION"
   }
]' \
--data-urlencode
'exampleMedia=4::aW1hZ3UvanBlZw==:ARYNMS2RLy7ZxeZdLH6MlbuCHz2bm5naXIbAHYwsJjvrQLKCGZ9LPnNmBC4KYhH2j6WxJEHJ7L6u
vxYsIYonRecvTCm_jyObpUJS-BRgFNcxOQ:e:1749806891:2281283925530161:61551923013914:ARbcT9jwPAS_B423dLM'

Sample Request - Dynamic flow (data_exchange)

curl --location 'https://partner.gupshup.io/partner/app/{{APP_ID}}/templates' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--data-urlencode 'elementName=dynamic_flow_signup' \
--data-urlencode 'languageCode=en' \
--data-urlencode 'category=MARKETING' \
--data-urlencode 'templateType=TEXT' \
--data-urlencode 'vertical=Sign up' \
--data-urlencode 'content=Tap below to sign up in a few steps.' \
--data-urlencode 'example=Tap below to sign up in a few steps.' \
--data-urlencode 'buttons=[{"type":"FLOW","text":"Open flow","flow_id":"{{FLOW_ID}}","flow_action":"data_exchange"}]'

The response has the same shape as the static-flow response below. In containerMeta (returned as a JSON string), the button is stored with "flow_action":"DATA_EXCHANGE" and has no navigate_screen:

"buttons": [{ "type": "FLOW", "text": "Open flow", "flow_id": "{{FLOW_ID}}", "flow_action": "DATA_EXCHANGE" }]

Dynamic flow prerequisites

Before you create a data_exchange template, check that:

  1. The flow is published and has an endpoint. Get Flow api must return "status": "PUBLISHED" and an endpoint_uri.
  2. The app's business public key is uploaded and its signature status is VALID. WhatsApp uses this key to encrypt the requests it sends to your endpoint.
  3. Your endpoint implements the WhatsApp Flows data exchange.
  4. The flow JSON uses a currently supported version (for example 7.0). Version 3.1 is rejected with INVALID_FLOW_JSON_VERSION.

This API does not check these prerequisites. It returns 200 with "status": "PENDING", then WhatsApp reviews the template and moves it to FAILED if a prerequisite is missing. Check the template's status and reason with Get Templates or the template status event:

ProblemReason on the FAILED template
Flow is not published (DRAFT)The flow associated with the button should be published
data_exchange used on a flow without an endpointIf you don't need a data exchange for your flow, please set the field to navigate; otherwise, please set to data_exchange.
📘

Category and frequency limits

WhatsApp may approve a flow template submitted as UTILITY as MARKETING. Marketing templates are billed as marketing and are subject to WhatsApp's per-user marketing frequency cap. When the cap is hit, the send fails with error 131049 in the failed status event.

To send a dynamic flow template, see Send Flow Message. Pass a flow_token so your endpoint can identify the session.

Validation rules

  • Category must be MARKETING or UTILITY.
  • Exactly one button, of type FLOW.
  • Button text: 1–25 characters.
  • flow_id or flow_json is required.
  • flow_action: navigate (default when omitted or empty) or data_exchange, case-insensitive. Any other value is rejected.
  • navigate_screen is required for navigate and ignored for data_exchange.
  • templateType=LOCATION can't be used with a flow button.
  • example is required, even when content has no variables.

Sample Response

{
  "status": "success",
  "template": {
    "appId": "d79ad72e-01f0-98e0-aea4-9f3d60ea2c1e",
    "buttonSupported": "FLOW",
    "category": "MARKETING",
    "containerMeta": {
      "appId": "d79ad72e-01f0-98e0-aea4-9f3d60ea2c1e",
      "data": "Hi {{1}}, \nToday is the last day of the Big Billion Day's sale. Make the most out of it!",
      "buttons": [
        {
          "type": "FLOW",
          "text": "Share Interests",
          "flow_id": "2961313360793010",
          "flow_action": "NAVIGATE",
          "navigate_screen": "SEGMENTS_SCREEN"
        }
      ],
      "sampleText": "Hi Sam, \nToday is the last day of the Big Billion Day's sale. Make the most out of it!",
      "sampleMedia": "4::aW1hZ2UvanBlZw==: ARYNMS2RLy9ZxeZdLH3MlbuCHz2bm5naXIbAHYwsJjvrQLKCGZ9LPnNmBC4KYhH2j6WxJEHJ7L6uvxYsIYonRecvTCm_jyObpUJSBRgFNcxOQ:e:2949806891:2181283925530161:61551923013914:ARbcT9jwPAS_B423dLM",
      "enableSample": true,
      "editTemplate": false,
      "allowTemplateCategoryChange": true,
      "addSecurityRecommendation": false,
      "isCPR": false,
      "cpr": false
    },
    "createdOn": 1749550623322,
    "data": "Hi {{1}}, \nToday is the last day of the Big Billion Day's sale. Make the most out of it! | [Share Interests]",
    "elementName": "test_flows_1",
    "id": "b5ec0148-a2e3-1d96-b280-c1d161a5a0e7",
    "languageCode": "en",
    "languagePolicy": "deterministic",
    "meta": {
      "example": "Hi Sam, \nToday is the last day of the Big Billion Day's sale. Make the most out of it!"
    },
    "modifiedOn": 1749550623322,
    "namespace": "8a499b40_4a56_518c_26fa_1f20f1d6aa18",
    "priority": 1,
    "quality": "UNKNOWN",
    "retry": 0,
    "stage": "NONE",
    "status": "PENDING",
    "templateType": "IMAGE",
    "vertical": "Sample template using Flow button with others",
    "wabaId": "145881286517812"
  }
}

Status Codes

Status CodeResponseComments
Success
200{

"status": "success",
"template": {
"appId": "d79ad72e-01f0-98e0-aea4-9f3d60ea2c1e",
"buttonSupported": "FLOW",
"category": "MARKETING",
"containerMeta": {
"appId": "d79ad72e-01f0-98e0-aea4-9f3d60ea2c1e",
"data": "Hi {{1}}, \nToday is the last day of the Big Billion Day's sale. Make the most out of it!",
"buttons": [
{
"type": "FLOW",
"text": "Share Interests",
"flow_id": "2961313360793010",
"flow_action": "NAVIGATE",
"navigate_screen": "SEGMENTS_SCREEN"
}
],
"sampleText": "Hi Sam, \nToday is the last day of the Big Billion Day's sale. Make the most out of it!",
"sampleMedia": "4::aW1hZ2UvanBlZw==: ARYNMS2RLy9ZxeZdLH3MlbuCHz2bm5naXIbAHYwsJjvrQLKCGZ9LPnNmBC4KYhH2j6WxJEHJ7L6uvxYsIYonRecvTCm_jyObpUJSBRgFNcxOQ:e:2949806891:2181283925530161:61551923013914:ARbcT9jwPAS_B423dLM",
"enableSample": true,
"editTemplate": false,
"allowTemplateCategoryChange": true,
"addSecurityRecommendation": false,
"isCPR": false,
"cpr": false
},
"createdOn": 1749550623322,
"data": "Hi {{1}}, \nToday is the last day of the Big Billion Day's sale. Make the most out of it! | [Share Interests]",
"elementName": "test_flows_1",
"id": "b5ec0148-a2e3-1d96-b280-c1d161a5a0e7",
"languageCode": "en",
"languagePolicy": "deterministic",
"meta": {
"example": "Hi Sam, \nToday is the last day of the Big Billion Day's sale. Make the most out of it!"
},
"modifiedOn": 1749550623322,
"namespace": "8a499b40_4a56_518c_26fa_1f20f1d6aa18",
"priority": 1,
"quality": "UNKNOWN",
"retry": 0,
"stage": "NONE",
"status": "PENDING",
"templateType": "IMAGE",
"vertical": "Sample template using Flow button with others",
"wabaId": "145881286517812"
}
}
Error
400{"status": "error", "message": "Provide valid example"}example is missing or doesn't match content
400{"status": "error", "message": "Flow Action not supported"}flow_action is not navigate or data_exchange (any case)
400{"status": "error", "message": "Invalid navigate screen for flow action navigate"}navigate (or flow_action omitted) without navigate_screen
400{"status": "error", "message": "Flow template should have only one buttons with type FLOW"}More than one button, or a button that isn't of type FLOW
400{"status": "error", "message": "Invalid flow button text"}Button text is empty or longer than 25 characters
400{"status": "error", "message": "Invalid flow id or flow json"}Neither flow_id nor flow_json is given
400{"status": "error", "message": "Location not supported with flow template"}templateType=LOCATION used with a flow button
429{
"status": "error",
"message": "Too Many Requests"
}
10 Requests per Minute
500{
"status": "error",
"message": "Internal server error. Please try again later and if the Issue still persists then contact Gupshup Dev Support"
}
For any Internal Error
Path Params
string
required

Unique identifier of the app.

Form Data
string
required

The name of a template. Element name is unique for a WABAs namespace.

string

Language code for the template. Refer to all the language codes here.

string
required

The body of the template.

string
enum
required

Template category. Flow templates allow MARKETING or UTILITY.

Allowed:
string
required

Vertical (not more than 180 char.)

string
required

Template type, e.g. TEXT, IMAGE, VIDEO, DOCUMENT. LOCATION is not allowed with a flow button.

string
required

Template example. Required even when the content has no variables.

string

Header of the template.

string

Example for the header (required only when the header has variables).

string
required

JSON array with exactly one FLOW button. Keys: type (FLOW), text (1-25 chars), flow_id or flow_json, flow_action (navigate default, or data_exchange; case-insensitive), navigate_screen (required for navigate, ignored for data_exchange), icon (optional).

boolean

Set true when sending exampleMedia.

string

Media handle for IMAGE / VIDEO / DOCUMENT templates.

boolean

Let Meta change the category to match the content. Default false.

Headers
string
required

Your app token, please refer Get access token api to get the token from partner documentation.

Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json