API Cloud (FLOWS)
You can send your WhatsApp flow once you have created it. This page explores the existing APIs to send messages, and the modifications needed to send a message with a Flow.
You can send a message with a flow in a user-initiated conversation through a call-to-action (CTA) message. Send it through the local client or Cloud API with specific flow information. The flow activates when the user taps the CTA button.
For more information about the endpoints below, check:
- https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi
- https://developers.facebook.com/docs/whatsapp/flows/reference/flowjson
The endpoints can be queried with several Meta versions; it is important to set the version (VERSION) in each URL. The VERSION variable must be expressed with the letter ‘v’: v16.0, v17.0, v18.0, v19.0.
Create a new flow
Request
POST /flows/{VERSION}/{did}
curl --request POST \
--url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/flows/{VERSION}/{did}' \
--header 'Authorization: <JWT>' \
--header 'Content-Type: application/json' \
--data '{
"name": "My first flow",
"categories": [ "APPOINTMENT_BOOKING" ],
"clone_flow_id": "clone ID",
"endpoint_uri": "Endpoint URI"
}'Properties:
| Field | Type | Description |
|---|---|---|
name | String | Flow name. |
categories | Array | Flow categories. At least one is required. Values: SIGN_UP, SIGN_IN, APPOINTMENT_BOOKING, LEAD_GENERATION, CONTACT_US, CUSTOMER_SUPPORT, SURVEY, OTHER. |
clone_flow_id | String | ID of the source flow to clone. |
endpoint_uri | String | URL of the WA Flow Endpoint. |
Response
Success (200)
{
"id": "id_created_flow"
}Update a flow
Once created, the flow can be updated calling the endpoint and sending the fields to update with the new values. The following parameters can be updated: name, categories, endpoint_uri.
Request
PUT /flows/{VERSION}/{did}/{flowId}
curl --request PUT \
--url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/flows/{VERSION}/{did}/{flowId}' \
--header 'Authorization: <JWT>' \
--header 'Content-Type: application/json' \
--data '{
"name": "New flow name"
}'Response
Success (200)
{
"success": true
}Update a flow via flow JSON
To update the flow via a flow JSON, send the following parameters as form-data:
Request
POST /flows/{VERSION}/{did}/{flowId}/assets
curl --request POST \
--url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/flows/{VERSION}/{did}/{flowId}/assets' \
--header 'Authorization: <JWT>' \
-F 'file=@/path/to/file;type=application/json' \
-F 'name=flow.json' \
-F 'asset_type=FLOW_JSON'Properties:
| Field | Type | Description |
|---|---|---|
name | String | JSON name. |
file | String | Path to the file. |
asset_type | String | Constant value FLOW_JSON. |
For documented examples of the flow.json structure, see https://developers.facebook.com/docs/whatsapp/flows/reference/flowjson
Response
Success (200)
If there is any flow validation error, the response — even if successful — will contain the error details:
{
"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
}
]
}For more information, see the official Meta docs: https://developers.facebook.com/docs/whatsapp/flows/reference/flowsapi
Delete a flow
Request
DELETE /flows/{VERSION}/{did}/{flowId}
curl --request DELETE \
--url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/flows/{VERSION}/{did}/{flowId}' \
--header 'Authorization: <JWT>' \Response
Success (200)
{
"success": true
}Get flow preview
Request
GET /flows/{VERSION}/{did}/{flowId}/preview
curl --request GET \
--url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/flows/{VERSION}/{did}/{flowId}/preview' \
--header 'Authorization: <JWT>' \Response
Success (200)
{
"preview": {
"preview_url": "https://business.facebook.com/wa/manage/flows/550.../preview/?token=b9d6....",
"expires_at": "2023-05-21T11:18:09+0000"
},
"id": "flow-1"
}Publish a flow
Request
POST /flows/{VERSION}/{did}/{flowId}/publish
curl --request POST \
--url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/flows/{VERSION}/{did}/{flowId}/publish' \
--header 'Authorization: <JWT>' \Response
Success (200)
{
"success": true
}List flow assets
Request
GET /flows/{VERSION}/{did}/{flowId}/assets
curl --request GET \
--url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/flows/{VERSION}/{did}/{flowId}/assets' \
--header 'Authorization: <JWT>' \Response
Success (200)
{
"data": [
{
"name": "flow.json",
"asset_type": "FLOW_JSON",
"download_url": "https://scontent.xx.fbcdn.net/m1/v/t0.57323-24/An_Hq0jnfJ..."
}
],
"paging": {
"cursors": {
"before": "QVFIU...",
"after": "QVFIU..."
}
}
}Deprecate a flow
Request
POST /flows/{VERSION}/{did}/{flowId}/deprecate
curl --request POST \
--url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/flows/{VERSION}/{did}/{flowId}/deprecate' \
--header 'Authorization: <JWT>' \Response
Success (200)
{
"success": true
}List flows
Request
GET /flows/{VERSION}/{did}
curl --request GET \
--url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/flows/{VERSION}/{did}' \
--header 'Authorization: <JWT>' \Response
Success (200)
{
"data": [
{
"id": "flow-1",
"name": "flow 1",
"status": "DRAFT",
"categories": [ "CONTACT_US" ],
"validation_errors": []
},
{
"id": "flow-2",
"name": "flow 2",
"status": "PUBLISHED",
"categories": [ "SURVEY" ],
"validation_errors": []
}
],
"paging": {
"cursors": {
"before": "QVFI...",
"after": "QVFI..."
}
}
}Get flow details
Request
GET /flows/{VERSION}/{did}/{flowId}/details
curl --request GET \
--url 'https://channels.chattigo.com/bsp-cloud-chattigo-isv/flows/{VERSION}/{did}/{flowId}/details' \
--header 'Authorization: <JWT>' \Response
Success (200)
{
"id": "<Flow-ID>",
"name": "<Flow-Name>",
"status": "DRAFT",
"categories": [ "LEAD_GENERATION" ],
"validation_errors": [],
"json_version": "3.0",
"data_api_version": "3.0",
"endpoint_uri": "https://example.com",
"preview": {
"preview_url": "https://business.facebook.com/wa/manage/flows/55000..../preview/?token=b9d6.....",
"expires_at": "2023-05-21T11:18:09+0000"
},
"whatsapp_business_account": {},
"application": {}
}Properties:
| Field | Type | Description |
|---|---|---|
id | String | Unique flow ID. |
name | String | Flow name. |
status | String | DRAFT, PUBLISHED, DEPRECATED, BLOCKED, THROTTLED. |
categories | List | Category list. |
validation_errors | List | Error list. |
json_version | String | JSON version. |
data_api_version | String | API version. |
endpoint_uri | String | Endpoint URI. |
preview | String | Flow preview URL. |
whatsapp_business_account | String | Object with the business account information. |
application | String | Object with the application information. |