# Create a product feed

Creates a product feed. Works with Meta Ads.

```http
POST https://api.pozy.ai/v1/ads/catalogs/{catalogId}/feeds
```

- Area: Ads / Product Catalogs
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `catalogId` (string, required)

## Request body

Content type: `application/json`

- `accountId`, string, required
- `catalogAccountId`, string
- `name`, string, required: Up to 100 characters
- `schedule`, object
  - `interval`, string, required: One of `HOURLY`, `DAILY`, `WEEKLY`
  - `url`, string (URL), required
  - `hour`, integer: 0 to 23
  - `dayOfWeek`, string: One of `SUNDAY`, `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`, `SATURDAY`

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/ads/catalogs/6f2f2ffcf4ace3659342c4c2/feeds" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "name": "Acme"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/ads/catalogs/6f2f2ffcf4ace3659342c4c2/feeds", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accountId: "696e0b682d0a31188e7a2ba9",
    name: "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.post(
    "https://api.pozy.ai/v1/ads/catalogs/6f2f2ffcf4ace3659342c4c2/feeds",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "accountId": "696e0b682d0a31188e7a2ba9",
        "name": "Acme",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 201

- `feed`, object
  - `id`, string
  - `name`, string
  - `productCount`, integer
  - `schedule`, object: Can be null
    - `interval`, string
    - `url`, string
    - `hour`, integer: Can be null
    - `dayOfWeek`, string: Can be null
  - `createdTime`, string: Can be null
  - `latestUpload`, object
    - one of: Meta Feed Upload
      - `id`, string
      - `url`, string: Can be null
      - `startTime`, string: Can be null
      - `endTime`, string: Can be null
      - `errorCount`, integer
      - `warningCount`, integer
      - `itemsDetected`, integer
      - `itemsDeleted`, integer

```json
{
  "feed": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "name": "Acme",
    "productCount": 42,
    "schedule": {
      "interval": "string",
      "url": "https://pozy.ai/media/example-1.jpg",
      "hour": 1,
      "dayOfWeek": "string"
    },
    "createdTime": "string",
    "latestUpload": {
      "id": "6bfebd43ddc270f6d2c56fc5",
      "url": "https://pozy.ai/media/example-1.jpg",
      "startTime": "string",
      "endTime": "string",
      "errorCount": 42,
      "warningCount": 42,
      "itemsDetected": 1,
      "itemsDeleted": 1
    }
  }
}
```
