# Update a blog

Updates a blog. Fields you leave out keep their current values. Works with Shopify accounts.

```http
PATCH https://api.pozy.ai/v1/accounts/{accountId}/blogs/{blogId}
```

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

## Path parameters

- `accountId` (string, required)
- `blogId` (string, required)

## Request body

Content type: `application/json`

- `title`, string
- `handle`, string

## Example request

```bash
curl -X PATCH "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/blogs/652782a6c235ab5a16404097" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Launch day",
  "handle": "acme"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/blogs/652782a6c235ab5a16404097", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    title: "Launch day",
    handle: "acme"
  }),
});
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.patch(
    "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/blogs/652782a6c235ab5a16404097",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "title": "Launch day",
        "handle": "acme",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `platform`, string: One of `shopify`
- `blog`, object
  - `id`, string
  - `platform`, string: One of `shopify`, `wordpress`, `wix`, `webflow`
  - `title`, string
  - `handle`, string

```json
{
  "platform": "shopify",
  "blog": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "platform": "shopify",
    "title": "Launch day",
    "handle": "acme"
  }
}
```
