Create a flow
Creates a WhatsApp flow whose versions read `flows/<handle>.json` in the template project.
POST
Creates a WhatsApp flow whose versions read flows/<handle>.json in the template project. The handle is unique in the organization; the categories are Meta's and go with every version to Meta.
apiKeyheader
x-api-key<token>application/json- body
projectId*TemplateProjectIdMatch
^tproj_[0-9a-hjkmnp-tv-z]{16,24}$handle*stringMatch
^[a-z0-9]+(?:-[a-z0-9]+)*$Length
length <= 64categories*array<>Items
1 <= itemsWhatsAppFlow
application/json- response
id*WhatsAppFlowIdMatch
^waflow_[0-9a-hjkmnp-tv-z]{16,24}$projectId*TemplateProjectIdMatch
^tproj_[0-9a-hjkmnp-tv-z]{16,24}$handle*stringMatch
^[a-z0-9]+(?:-[a-z0-9]+)*$Length
length <= 64path*stringcategories*array<>endpoint*|nullcurrentVersion*|nullcreatedAt*stringupdatedAt*stringimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.whatsappFlows.create({
"projectId": "example",
"handle": "example",
"categories": [
"SIGN_UP"
]
});Example Response
{
"id": "string",
"projectId": "string",
"handle": "string",
"path": "string",
"categories": [
"SIGN_UP"
],
"endpoint": {
"url": "string",
"updatedAt": "string"
},
"currentVersion": {
"id": "string",
"flowId": "string",
"number": -9007199254740991,
"commitSha": "string",
"digest": "string",
"jsonVersion": "string",
"screens": [
"string"
],
"dataExchange": true,
"createdAt": "string"
},
"createdAt": "string",
"updatedAt": "string"
}