# 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 %}
