Skip to Content

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
/v1/whatsapp/flows/{id}/versions

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.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^waflow_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json
  1. body
commitSha*string
Match^[a-f0-9]{40}$
expectedWorkspaceRevision*string
Length1 <= length

Response Body

WhatsAppFlowVersion

application/json
  1. response
id*WhatsAppFlowVersionId
Match^wafver_[0-9a-hjkmnp-tv-z]{16,24}$
flowId*WhatsAppFlowId
Match^waflow_[0-9a-hjkmnp-tv-z]{16,24}$
number*integer
Range-9007199254740991 <= value <= 9007199254740991
commitSha*string
Match^[a-f0-9]{40}$
digest*string
Match^[a-f0-9]{64}$
jsonVersion*string
screens*array<string>
dataExchange*boolean
createdAt*string
Example Request
import { 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"
}

Related documentation