# Edit published post

Edits a published post.

```http
POST https://api.pozy.ai/v1/posts/{postId}/edit
```

- Area: Publishing / Posts
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `postId` (string, required)

## Request body

Content type: `application/json`

- `platform`, string, required: One of `twitter`, `discord`, `facebook`, `reddit`, `linkedin`, `telegram`, `pinterest`, `googlebusiness`, `youtube`, `slack`
- `content`, string, required
- `accountId`, string

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/posts/6108a2cc742cb4e991051e0c/edit" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "platform": "twitter",
  "content": "Hello from Pozy"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/posts/6108a2cc742cb4e991051e0c/edit", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    platform: "twitter",
    content: "Hello from Pozy"
  }),
});
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/posts/6108a2cc742cb4e991051e0c/edit",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "platform": "twitter",
        "content": "Hello from Pozy",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `success`, boolean
- `id`, string
- `url`, string (URL)
- `message`, string

```json
{
  "success": true,
  "id": "6bfebd43ddc270f6d2c56fc5",
  "url": "https://pozy.ai/media/example-1.jpg",
  "message": "Hello from Pozy"
}
```
