Skip to Content

Register and publish a flow

Creates the flow's current version as a Meta flow on the business account of the named number, or of the default number, and publishes it.

POST
/v1/whatsapp/flows/{id}/registrations

Creates the flow's current version as a Meta flow on the business account of the named number, or of the default number, and publishes it. A version already published there returns its registration. Meta's validator findings answer a validation error and stay on the draft registration.

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
businessAccountId?WhatsAppBusinessAccountId
Match^waba_[0-9a-hjkmnp-tv-z]{16,24}$

Response Body

WhatsAppFlowRegistration

application/json
  1. response
id*WhatsAppFlowRegistrationId
Match^wafreg_[0-9a-hjkmnp-tv-z]{16,24}$
flowId*WhatsAppFlowId
Match^waflow_[0-9a-hjkmnp-tv-z]{16,24}$
versionId*WhatsAppFlowVersionId
Match^wafver_[0-9a-hjkmnp-tv-z]{16,24}$
versionNumber*integer
Range-9007199254740991 <= value <= 9007199254740991
wabaId*string
providerFlowId*string|null
name*string
status*string
Value in"draft""published""throttled""blocked""deprecated"
validationErrors*array<>
endpointAlerts*array<>
publishedAt*string|null
statusChangedAt*string
createdAt*string
updatedAt*string
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.whatsappFlows.register({
  "id": "example"
});
Example Response
{
  "id": "string",
  "flowId": "string",
  "versionId": "string",
  "versionNumber": -9007199254740991,
  "wabaId": "string",
  "providerFlowId": "string",
  "name": "string",
  "status": "draft",
  "validationErrors": [
    {
      "error": "string",
      "message": "string",
      "path": "string",
      "line": -9007199254740991,
      "column": -9007199254740991
    }
  ],
  "endpointAlerts": [
    {
      "kind": "string",
      "message": "string",
      "value": 0,
      "threshold": 0,
      "activatedAt": "string"
    }
  ],
  "publishedAt": "string",
  "statusChangedAt": "string",
  "createdAt": "string",
  "updatedAt": "string"
}

Related documentation