# Duplicate a workflow

Duplicates a workflow.

```http
POST https://api.pozy.ai/v1/workflows/{workflowId}/duplicate
```

- Area: Automations / Workflows
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `workflowId` (string, required)

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/workflows/6e299f518f373bfd669857c4/duplicate" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/workflows/6e299f518f373bfd669857c4/duplicate", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
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.post(
    "https://api.pozy.ai/v1/workflows/6e299f518f373bfd669857c4/duplicate",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 201

- `success`, boolean
- `workflow`, object
  - `id`, string
  - `name`, string
  - `description`, string
  - `status`, string: One of `draft`
  - `platform`, string
  - `accountId`, string
  - `profileId`, string
  - `entryNodeId`, string: Can be null
  - `nodeCount`, integer
  - `createdAt`, string (date-time)

```json
{
  "success": true,
  "workflow": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "name": "Acme",
    "description": "A short description",
    "status": "draft",
    "platform": "instagram",
    "accountId": "696e0b682d0a31188e7a2ba9",
    "profileId": "6a0b6573846efc28aaa9a3ff",
    "entryNodeId": "6cb80338d0fb8bf8544ff5a4",
    "nodeCount": 42,
    "createdAt": "2026-10-02T09:00:00.000Z"
  }
}
```
