Flows
Create flow (phone number scoped)
Create a new WhatsApp Flow for a phone number.
Proxy endpoint: Proxies directly to Meta Graph API.
Note: Requires WhatsappConfig with matching phone_number_id.
POST
/
{phone_number_id}
/
flows
Create flow (phone number scoped)
curl --request POST \
--url https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "appointment_booking",
"categories": [
"APPOINTMENT_BOOKING"
]
}
'import requests
url = "https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows"
payload = {
"name": "appointment_booking",
"categories": ["APPOINTMENT_BOOKING"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'appointment_booking', categories: ['APPOINTMENT_BOOKING']})
};
fetch('https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'appointment_booking',
'categories' => [
'APPOINTMENT_BOOKING'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows"
payload := strings.NewReader("{\n \"name\": \"appointment_booking\",\n \"categories\": [\n \"APPOINTMENT_BOOKING\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"appointment_booking\",\n \"categories\": [\n \"APPOINTMENT_BOOKING\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"appointment_booking\",\n \"categories\": [\n \"APPOINTMENT_BOOKING\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"success": true,
"validation_errors": [
{
"error": "<string>",
"error_type": "<string>",
"message": "<string>",
"line_start": 123,
"line_end": 123,
"column_start": 123,
"column_end": 123
}
]
}{
"error": {
"message": "Invalid phone number format",
"type": "OAuthException",
"code": 400,
"error_subcode": 1001,
"fbtrace_id": "AXk7s_8dR4eVHp9Kq2MmNlO"
}
}Authorizations
ApiKeyAuthBearerAuth
Project API key for authentication. This is the recommended authentication method.
Get your API key from the Kapso dashboard under Integrations > API keys.
Path Parameters
WhatsApp Business Phone Number ID
Body
application/json
Flow name
Flow categories
Available options:
SIGN_UP, SIGN_IN, APPOINTMENT_BOOKING, LEAD_GENERATION, CONTACT_US, CUSTOMER_SUPPORT, SURVEY, OTHER ID of flow to clone
Endpoint URI for the flow
Flow's JSON encoded as string. If provided with publish=true, creates and publishes flow in one request.
Indicates whether Flow should also get published. Only works if flow_json is provided with valid Flow JSON.
Was this page helpful?
⌘I
Create flow (phone number scoped)
curl --request POST \
--url https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "appointment_booking",
"categories": [
"APPOINTMENT_BOOKING"
]
}
'import requests
url = "https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows"
payload = {
"name": "appointment_booking",
"categories": ["APPOINTMENT_BOOKING"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'appointment_booking', categories: ['APPOINTMENT_BOOKING']})
};
fetch('https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'appointment_booking',
'categories' => [
'APPOINTMENT_BOOKING'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows"
payload := strings.NewReader("{\n \"name\": \"appointment_booking\",\n \"categories\": [\n \"APPOINTMENT_BOOKING\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"appointment_booking\",\n \"categories\": [\n \"APPOINTMENT_BOOKING\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kapso.ai/meta/whatsapp/v24.0/{phone_number_id}/flows")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"appointment_booking\",\n \"categories\": [\n \"APPOINTMENT_BOOKING\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"success": true,
"validation_errors": [
{
"error": "<string>",
"error_type": "<string>",
"message": "<string>",
"line_start": 123,
"line_end": 123,
"column_start": 123,
"column_end": 123
}
]
}{
"error": {
"message": "Invalid phone number format",
"type": "OAuthException",
"code": 400,
"error_subcode": 1001,
"fbtrace_id": "AXk7s_8dR4eVHp9Kq2MmNlO"
}
}
