Skip to main content

Flows API

In addition to managing Flows through Positus Studio, you can administer them directly through the API. Flow endpoints are workspace-scoped and allow you to list, create, update, publish, preview, and remove Flows.

Authentication and Scope

All routes require authentication via Bearer Token of a user and are accessed under the desired workspace:
Except for listing, all operations require that the authenticated user be an owner of the workspace. Otherwise, the API responds with 403.
Creating and editing Flows depends on a WhatsApp Business Account (WABA) associated with the workspace. If the workspace does not have a WABA, the API responds with 400.

List Flows

Returns the Flows of the workspace.
Response — collection of Flow objects (see Flow object structure).

Create Flow

Creates a Flow in the workspace. The Flow is created first in Meta and, if successful, persisted in Positus.
Response — created Flow object. In case of error in Meta, the API responds with 400 and { "message": "..." }.

Update Flow

Updates the Flow’s metadata (name, categories, and endpoint). Accepts the same request body as the create endpoint.
Response — updated Flow object.

Update Flow JSON

Updates the content (Flow JSON) that defines the screens and components of the Flow.
The content is sent to Meta and, if successful, persisted in the Flow. Consult the structure reference on the Structure and Components page.

Publish Flow

Publishes the Flow, making it available for sending. After publication, the status changes to PUBLISHED.
Response — Flow object with updated status.

Remove Flow

The behavior depends on the current status of the Flow:
  • Draft (DRAFT): the Flow is deleted from Meta and removed from the workspace. Response 204 No Content.
  • Published: the Flow cannot be deleted; it is deprecated (status DEPRECATED). Response with the updated Flow object.

Preview Flow

Generates a preview URL of the Flow for a number in the workspace.
Response:

Public Routes

These routes do not require user authentication:

Flow Object Structure

The endpoints’ responses return the Flow in the following format:

Flow Statuses

Categories

Categories accepted in the categories field (send the ids):