# Updating a flow

NB: ***Once a flow is published it cannot be updated.***

```
PUT https://gateway.lipachat.com/api/v1/whatsapp/manage/flow/:id
NB: Replace :id with the flow id you want to update
```

**Headers**

| Name         | Value                                                                           |
| ------------ | ------------------------------------------------------------------------------- |
| Content-Type | multipart/form-data                                                             |
| apiKey       | Get apiKey from app portal settings tab <https://app.lipachat.com/app/settings> |

**Body**

| Name       | Type   | Description                                                                  |
| ---------- | ------ | ---------------------------------------------------------------------------- |
| name       | string | Name of your flow                                                            |
| categories | string | Category of the flow: Example: OTHERS                                        |
| file       | file   | The file containing your updated whatsapp flow. File should be of type .json |

**Example Request**

```json
{
  "name": "BANK_TEST_FLOW_V2",
  "categories": "OTHER",
  "file": "filename.json"
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "timestamp": "2024-03-12T10:01:04.71248",
  "data": {
    "id": 4,
    "waFlowId": "2044724355999872",
    "name": "BANK_TEST_FLOW_V2",
    "status": "DRAFT",
    "categories": [
      "OTHER"
    ],
    "createdAt": "2024-03-12T07:00:55.887+00:00",
    "updatedAt": "2024-03-12T07:00:58.598+00:00"
  },
  "status": "success",
  "message": "",
  "errors": null
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "timestamp": "2024-09-15T20:06:38.675567555",
    "data": null,
    "status": "error",
    "message": "Request failed.",
    "errors": null
}
```

{% endtab %}

{% tab title="401" %}

```json
{
    "timestamp": "2024-09-15T20:07:23.464199513",
    "data": null,
    "status": "success",
    "message": "Invalid credentials",
    "errors": null
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lipachat.com/api/whatsapp-flows/update-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
