> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keebai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /v1/flows/{id}/publish

> Publish a WhatsApp Flow. Meta validates the Flow JSON here, and a published Flow can no longer be edited.

Publishes the Flow at Meta. Until a Flow is published, sending it only reaches phone numbers registered as testers on the WhatsApp Business Account — and only with `mode: "draft"` on the send.

<Warning>
  Publishing is one-way. Meta does not allow editing a published Flow: iterate while it is still a draft, and create a new Flow for the next version.
</Warning>

## Endpoint

```
POST https://api.keebai.com/v1/flows/{id}/publish
```

## Required scope

`flows:write`

## Example request

```bash curl theme={null}
curl -X POST https://api.keebai.com/v1/flows/66a1f2b3c4d5e6f708192a3b/publish \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

## Response

### 200 OK

The Flow with `status` now `published`, same shape as [`GET /v1/flows/{id}`](/dev/endpoints/flows-get#200-ok).

### 400 Bad Request

Meta rejected the Flow JSON. The validation errors are passed through in `message`.

### 404 Not Found

`FLOW_NOT_FOUND`.


## OpenAPI

````yaml POST /v1/flows/{id}/publish
openapi: 3.0.0
info:
  title: Keebai Public API
  description: Superficie pública REST autenticada con Personal Access Tokens (PAT).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.keebai.com
    description: Production
security: []
tags: []
paths:
  /v1/flows/{id}/publish:
    post:
      tags:
        - flows
      summary: Publish a WhatsApp Flow
      description: >-
        Meta validates the Flow JSON on publish. A published Flow can no longer
        be edited — create a new version instead.
      operationId: PublicFlowsController_publish
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowResponseDto'
      security:
        - PAT: []
components:
  schemas:
    FlowResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Keebai flow id.
        channel_id:
          type: string
          description: Keebai channel this Flow belongs to.
        name:
          type: string
        description:
          type: string
          nullable: true
        meta_flow_id:
          type: string
          nullable: true
          description: >-
            Meta Flow id. Use it as `flow_id` when sending a message of type
            `flow`. Null until Meta accepts the Flow.
        categories:
          type: array
          items:
            type: string
            enum:
              - OTHER
              - SIGN_UP
              - SIGN_IN
              - APPOINTMENT_BOOKING
              - LEAD_GENERATION
              - CONTACT_US
              - CUSTOMER_SUPPORT
              - SURVEY
        status:
          type: string
          enum:
            - draft
            - published
            - archived
        flow_data:
          type: object
          description: Flow JSON currently stored in Keebai.
        metadata:
          type: object
        created_at:
          type: string
          format: date-time
          nullable: true
        updated_at:
          type: string
          format: date-time
          nullable: true
      required:
        - id
        - channel_id
        - name
        - categories
        - status
  securitySchemes:
    PAT:
      scheme: bearer
      bearerFormat: kbai_pk_<hex>
      type: http
      description: >-
        Personal Access Token con prefijo `kbai_pk_`. Generar desde el portal
        con permiso `developer.manage_tokens`.

````