# Upload flow JSON

Uploads a flow JSON.

```http
PUT https://api.pozy.ai/v1/whatsapp/flows/{flowId}/json
```

- Area: WhatsApp / WhatsApp Flows
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `flowId` (string, required)

## Request body

Content type: `application/json`

- `accountId`, string, required
- `flow_json`, object or string, required

## Example request

```bash
curl -X PUT "https://api.pozy.ai/v1/whatsapp/flows/6dcb639fb7c2f34487add973/json" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "flow_json": {}
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/whatsapp/flows/6dcb639fb7c2f34487add973/json", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accountId: "696e0b682d0a31188e7a2ba9",
    flow_json: {}
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.put(
    "https://api.pozy.ai/v1/whatsapp/flows/6dcb639fb7c2f34487add973/json",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "accountId": "696e0b682d0a31188e7a2ba9",
        "flow_json": {},
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `success`, boolean
- `validation_errors`, array of object
  - `error`, string
  - `error_type`, string
  - `message`, string
  - `line_start`, integer
  - `line_end`, integer
  - `column_start`, integer
  - `column_end`, integer

```json
{
  "success": true,
  "validation_errors": [
    {
      "error": "string",
      "error_type": "string",
      "message": "Hello from Pozy",
      "line_start": 1,
      "line_end": 1,
      "column_start": 1,
      "column_end": 1
    }
  ]
}
```
