Record a flow version
Reads the flow's file at a commit on the project's default branch, checks it is Flow JSON Samva sends, and records it as the flow's current version.
POST
Reads the flow's file at a commit on the project's default branch, checks it is Flow JSON Samva sends, and records it as the flow's current version. The same content returns the version that already recorded it.
apiKeyheader
x-api-key<token>id*stringMatch
^waflow_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
commitSha*stringMatch
^[a-f0-9]{40}$expectedWorkspaceRevision*stringLength
1 <= lengthWhatsAppFlowVersion
application/json- response
id*WhatsAppFlowVersionIdMatch
^wafver_[0-9a-hjkmnp-tv-z]{16,24}$flowId*WhatsAppFlowIdMatch
^waflow_[0-9a-hjkmnp-tv-z]{16,24}$number*integerRange
-9007199254740991 <= value <= 9007199254740991commitSha*stringMatch
^[a-f0-9]{40}$digest*stringMatch
^[a-f0-9]{64}$jsonVersion*stringscreens*array<string>dataExchange*booleancreatedAt*stringimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.whatsappFlows.recordVersion({
"id": "example",
"commitSha": "example",
"expectedWorkspaceRevision": "example"
});Example Response
{
"id": "string",
"flowId": "string",
"number": -9007199254740991,
"commitSha": "string",
"digest": "string",
"jsonVersion": "string",
"screens": [
"string"
],
"dataExchange": true,
"createdAt": "string"
}