> ## 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.

# PUT /v1/flows/{id}

> Update a WhatsApp Flow. Sending flow_data re-uploads the Flow JSON at Meta.

Updates a Flow's metadata and, when `flow_data` is present, re-uploads its Flow JSON to Meta.

<Warning>
  Meta does not allow editing a Flow that is already `published`. Update the Flow while it is still a draft, or create a new one and switch your sends over to its `meta_flow_id`.
</Warning>

## Endpoint

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

## Required scope

`flows:write`

## Body

| Field         | Type       | Required | Description                                                   |
| ------------- | ---------- | -------- | ------------------------------------------------------------- |
| `name`        | `string`   | No       | Up to 100 characters.                                         |
| `description` | `string`   | No       | Up to 500 characters.                                         |
| `categories`  | `string[]` | No       | Same values as on [create](/dev/endpoints/flows-create#body). |
| `flow_data`   | `object`   | No       | Replacement Flow JSON. Re-uploaded as the Flow asset at Meta. |
| `metadata`    | `object`   | No       | Free-form metadata stored in Keebai.                          |

## Example request

```bash curl theme={null}
curl -X PUT https://api.keebai.com/v1/flows/66a1f2b3c4d5e6f708192a3b \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "description": "Reserva de mesa — v2 con selector de sucursal" }'
```

## Response

### 200 OK

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

### 400 Bad Request

Invalid id, invalid Flow JSON, or Meta refused the update because the Flow is published.

### 404 Not Found

`FLOW_NOT_FOUND`.


## OpenAPI

````yaml PUT /v1/flows/{id}
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}:
    put:
      tags:
        - flows
      summary: Update a WhatsApp Flow
      description: >-
        Sending flow_data re-uploads the Flow JSON at Meta. A published Flow
        must be republished for the change to reach recipients.
      operationId: PublicFlowsController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFlowDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowResponseDto'
      security:
        - PAT: []
components:
  schemas:
    UpdateFlowDto:
      type: object
      properties:
        name:
          type: string
          maxLength: 100
        description:
          type: string
          maxLength: 500
        categories:
          type: array
          items:
            type: string
            enum:
              - OTHER
              - SIGN_UP
              - SIGN_IN
              - APPOINTMENT_BOOKING
              - LEAD_GENERATION
              - CONTACT_US
              - CUSTOMER_SUPPORT
              - SURVEY
        flow_data:
          type: object
          description: Replacement Flow JSON. Re-uploaded as the Flow asset at Meta.
        metadata:
          type: object
    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`.

````