Update Flow Metadata
POST Method
After you have created your Flow, the Update Flow Metadata API allows you to update the name, categories, and endpoint_uri of a flow.
Prerequisites
- Before you get started, Create an API Key. To view the API Key and the SID, see View API Key and SID.
A prerequisite for using Kaleyra WhatsApp APIs is to have an active WhatsApp plan on kaleyra platform. - To set up a WhatsApp account on kaleyra platform, see Manual Signup
and Embedded Signup. - An active WhatsApp for Business API plan that includes:
- A WhatsApp business number.
- An associated profile with the business number.
- A WhatsApp verified and approved profile.
- WABA ID must be onboarded on Kaleyra WhatsApp API V2 compatible.
Base URL
https://<api_domain>/v2/<SID>
API Domain and Value
api_domain | Value |
---|---|
IN pod | api.in.kaleyra.io |
SG Pod | api.ap.kaleyra.io |
EU Pod | api.eu.kaleyra.io |
API request to update Flow Metadata
To update Flow Metadata, use the https://<api_domain>/v2/<sid>/whatsapp/<flow_id>
endpoint with the following request method:
Request Format
The following is the request format to update Flow Metadata:
curl --location --request POST \ 'https://<api_domain>/v2/<sid>/whatsapp/<flow_id>' \
--header 'api-key: <api-key>' \
--data '{
"name": "<name>",
"endpoint_uri" : "<endpoint_uri>",
"categories": [ "<categories>" ]
}'
Sample Request Format
The following is the sample request format to update Flow Metadata:
curl --location --request POST \ 'https://<api_domain>/v2/HXAP16XXXXXX97IN/whatsapp/12XXXXXXXXXXXXX' \
--header 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3' \
--data '{
"name": "This is the first flow",
"endpoint_uri" : "https://www.tatacommunications.com/",
"categories": [ "SIGN_IN" ]
}'
URL Parameters and Headers
Following is the list of parameters and headers to send the outgoing message request:
Parameter / Headers | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
sid | String | Account SID (Security Identifier). | HXAP16XXXXXX97IN | Yes |
flow_id | Integer | Flow ID is the ID received in the response of the create flow API. | 12XXXXXXXXXXXXX | Yes |
api-key | String | API key generated from Kaleyra platform account. | Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3 | Yes |
Following is the list of attribute to be used in the payload to update Flow Metadata:
Parameter | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
name | String | The name you want to provide for your WhatsApp Flow. | This is the first flow | No |
endpoint_uri | String | The "endpoint_uri" is the specific URL on the client's server that WhatsApp sends requests to whenever certain events happen within the flow. In other words, it’s the URL that directs WhatsApp where to send interaction data for that particular flow. Note: Some flows need real-time data exchange or dynamic navigation based on user input. This is where the "endpoint_uri" is important. | https://www.tatacommunications.com/ | No |
categories | Array of string | The category templates using which you want to define the WhatsApp Flow. The following are the supported categories: - SIGN_UP - SIGN_IN - APPOINTMENT_BOOKING - LEAD_GENERATION - SHOPPING - CONTACT_US - CUSTOMER_SUPPORT - SURVEY - OTHER Note: You can use multiple categories separated by a comma based on your WhatsApp Flow. | SIGN_IN | No |
Sample Success Response
The following success message appears with the status 200 Accepted:
{
"code": "WA200",
"message": "Request Processed Successfully",
"data": {
"success": true
},
"error": {}
}
Sample Failure Response
Sample Failure Response
The following are the failure responses:
401 Unauthorized
{
"code": "RBC001",
"message": "Incorrect SID or API key.",
"data": [],
"error": {
"error": "Incorrect SID or API key."
}
}
401 Wrong account
{
"code": "WA-401",
"message": "API is not available for given customer.Please contact support for more info",
"data": {},
"error": "API is not available for given customer.Please contact support for more info"
}
400 Incorrect payload
{
"code": "WA-400",
"message": "Refer to correct payload format",
"data": {},
"error": {
"payload": "Incorrect payload format"
}
}
500 Internal Server Error
{
"code": "WA-500",
"message": "Please try again later",
"data": {},
"error": {
"error": "Internal server error"
}
}
{
"code": "WA-401",
"message": "The flow_id either does not exist or does not belong to the account.",
"data": {},
"error": {
"flow_id": "The flow_id either does not exist or does not belong to the account."
}
}
Updated about 15 hours ago