logo
enes

Create and update Flows

Last update: 6 hours ago by Irais Aguirre

Create a WhatsApp Flow and upload or update its JSON definition and metadata.

Integration summary

  • Base URL: https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services
  • Token: admin token, in the Authorization: Bearer {{admin-token}} header (how to generate it)
  • Endpoints on this page:
    • POST /v1/flows/{{waba_id}}: Create Flow
    • POST /v1/flows/{{waba_id}}/{{flow_id}}/assets: Upload Flow JSON
    • PUT /v1/flows/{{waba_id}}/{{flow_id}}: Update metadata

Create Flow

Request

Create Flow request:

URLhttps://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/flows/{{waba_id}}
MethodPOST
Typeapplication/json

Headers

Create Flow headers:

NameDescriptionTypeRequirements
Content-Typeapplication/jsonStringRequired
AuthorizationAdmin token. See Generate authentication token.StringRequired

Parameters

Create Flow parameters:

NameDescriptionTypeRequirements
waba_idWhatsApp Business Account ID.StringRequired

Body

Create Flow body fields:

NameDescriptionTypeRequirements
nameFlow name.StringRequired
categoriesList of categories for the Flow. You can assign multiple values, but at least one is required:
  • SIGN_UP
  • SIGN_IN
  • APPOINTMENT_BOOKING
  • LEAD_GENERATION
  • CONTACT_US
  • CUSTOMER_SUPPORT
  • SURVEY
  • OTHER
ArrayRequired
clone_flow_idID of the source Flow to clone. You must have permission to access the specified Flow.StringOptional
endpoint_uriURL of the WA Flow Endpoint.StringOptional

Example

Complete Create Flow example:

curl --location 'https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/flows/{{waba_id}}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{admin-token}}' \
--data '{
"name": "New flow name",
"categories": [ "CUSTOMER_SUPPORT" ],
"clone_flow_id": "flow-1",
"endpoint_uri": "https://example.com"
}'

Response

Create Flow response:

NameDescriptionType
idFlow ID.String
{
"id": "flow-1"
}


Upload Flow JSON

Request

Upload Flow JSON request:

URLhttps://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/flows/{{waba_id}}/{{flow_id}}/assets
MethodPOST
Typemultipart/form-data

Headers

Upload Flow JSON headers:

NameDescriptionTypeRequirements
AuthorizationAdmin token. See Generate authentication token.StringRequired

Parameters

Upload Flow JSON parameters:

NameDescriptionTypeRequirements
waba_idWhatsApp Business Account ID.StringRequired
flow_idFlow ID returned by Create Flow.StringRequired

Body

Upload Flow JSON body fields:

NameDescriptionTypeRequirements
fileFile with the Flow JSON content. The file must have a .json extension.
For the components Meta allows when building the JSON, see Flow JSON.
We recommend using version 7.0 or later.
File
  • Required.
  • Only .json files are accepted; other extensions are rejected.
  • Maximum file size: 10 MiB (10,485,760 bytes).

Example

Complete Upload Flow JSON example:

curl --location 'https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/flows/{{waba_id}}/{{flow_id}}/assets' \
--header 'Authorization: Bearer {{admin-token}}' \
--form 'file=@"/file/path/flows_body.json"'

Response

Upload Flow JSON response:

NameDescriptionType
successReturns true if the Flow JSON was uploaded successfully; otherwise, returns false.Boolean
validation_errorsObject describing any errors found in the Flow JSON. If no errors are found, an empty array is returned.List of objects
{
"success": true,
"validation_errors": [
{
"error": "INVALID_PROPERTY",
"error_type": "JSON_SCHEMA_ERROR",
"message": "The property \"initial-text\" cannot be specified at \"$root/screens/0/layout/children/2/children/0\".",
"line_start": 46,
"line_end": 46,
"column_start": 17,
"column_end": 30
}
]
}

Validation errors object

NameDescriptionType
errorError name.String
error_typeError type.String
messageError description.String
line_startLine where the error starts.Integer
line_endLine where the error ends.Integer
column_startColumn where the error starts.Integer
column_endColumn where the error ends.Integer

For more information about the errors you may get when uploading a Flow JSON file and how to fix them, see Meta's documentation: Static validation errors.



Update metadata

Request

Update metadata request:

URLhttps://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/flows/{{waba_id}}/{{flow_id}}
MethodPUT
Typeapplication/json

Headers

Update metadata headers:

NameDescriptionTypeRequirements
Content-Typeapplication/jsonStringRequired
AuthorizationAdmin token. See Generate authentication token.StringRequired

Parameters

Update metadata parameters:

NameDescriptionTypeRequirements
waba_idWhatsApp Business Account ID.StringRequired
flow_idFlow ID returned by Create Flow.StringRequired

Body

Update metadata body fields:

NameDescriptionTypeRequirements
nameFlow name.StringRequired
categoriesList of categories for the Flow. You can assign multiple values, but at least one is required:
  • SIGN_UP
  • SIGN_IN
  • APPOINTMENT_BOOKING
  • LEAD_GENERATION
  • CONTACT_US
  • CUSTOMER_SUPPORT
  • SURVEY
  • OTHER
ArrayRequired
endpoint_uriURL of the WA Flow Endpoint.StringOptional

Note: clone_flow_id is a Create-only field. If sent on this Update endpoint, the request is rejected.

Example

Complete Update metadata example:

curl --location --request PUT 'https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/flows/{{waba_id}}/{{flow_id}}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{admin-token}}' \
--data '{
"name": "New flow name",
"categories": [ "CUSTOMER_SUPPORT" ],
"endpoint_uri": "https://example.com"
}'

Response

Update metadata response:

NameDescriptionType
successReturns true if a property was updated successfully; otherwise, returns false.Boolean
{
"success": true
}

WhatsApp โ€” Previous
WhatsApp Flows
Next
Query Flows