# Render previews of an existing ad

Renders previews of an existing ad. Works with Meta Ads.

```http
GET https://api.pozy.ai/v1/ads/{adId}/preview
```

- Area: Ads / Ad Creatives
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `adId` (string, required)

## Query parameters

- `accountId` (string)
- `formats` (string)

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/ads/6f40fa2fb0a7e728dd1a73b7/preview" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/ads/6f40fa2fb0a7e728dd1a73b7/preview", {
  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.get(
    "https://api.pozy.ai/v1/ads/6f40fa2fb0a7e728dd1a73b7/preview",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `adId`, string
- `synced`, boolean
- `previews`, array of object
  - `format`, string
  - `html`, string: Can be null

```json
{
  "adId": "6f40fa2fb0a7e728dd1a73b7",
  "synced": true,
  "previews": [
    {
      "format": "string",
      "html": "string"
    }
  ]
}
```
