# Update a flow

`PATCH https://api.morevoice.ai/v1/flows/{id}`

Changes only the fields you send. Returns the updated `Flow`. Answers `404` with the code `resource_missing` when nothing has this ID in this organisation and mode.

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `flows_update`.

## Parameters

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | A flow ID (`flow_…`). |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |

## Request body

Optional, `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `archived` | `boolean` | no | true archives the flow (hidden from lists); false restores it. |
| `assistant_id` | `string \| null` | no | `asst_…` ID. |
| `description` | `string` | no | — |
| `name` | `string` | no | — |

Example:

```json
{
  "name": "Reception (2026)"
}
```

## Responses

### 200 OK

OK Returns `Flow`.

| Field | Type | Description |
| --- | --- | --- |
| `id` | `string` | The flow's ID. |
| `object` | `"flow"` | — |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `name` | `string` | — |
| `description` | `string` | — |
| `kind` | `"voice" \| "agent_script" \| "ivr"` | voice: drives an AI assistant; agent_script: a human agent's branching script; ivr: a phone menu. |
| `status` | `"draft" \| "published" \| "archived"` | — |
| `published_version` | `integer \| null` | The version calls run (null: never published). |
| `latest_version` | `integer` | — |
| `draft_rev` | `integer` | The draft's revision: send it as `base_rev` when you write the draft. |
| `assistant_id` | `string \| null` | `asst_…` ID. |
| `template_id` | `string \| null` | — |
| `node_count` | `integer` | — |
| `updated` | `string` | An ISO-8601 timestamp in UTC. |

Example:

```json
{
  "assistant_id": "asst_3cYbE6uYvGkH8w4ZK1rTqd",
  "description": "Identify the caller and route them.",
  "draft_rev": 17,
  "id": "flow_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8",
  "kind": "voice",
  "latest_version": 3,
  "livemode": true,
  "name": "Reception",
  "node_count": 12,
  "object": "flow",
  "published_version": 3,
  "status": "published",
  "template_id": null,
  "updated": "2026-11-03T09:14:22.000Z"
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). Returns `ErrorEnvelope`.

### 404 Not Found

No object with this ID exists in this organisation and mode. Returns `ErrorEnvelope`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

const flow = await mv.flows.update("flow_7Hk2Lm9Qp", {
	name: "Reception (2026)",
});
console.log(flow);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

flow = client.flows.update("flow_7Hk2Lm9Qp", {
    "name": "Reception (2026)",
})
print(flow)
```

**cURL**

```sh
curl -X PATCH https://api.morevoice.ai/v1/flows/flow_7Hk2Lm9Qp \
  -H "Authorization: Bearer $MOREVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Reception (2026)"
}'
```
