# Add Search ad-group keywords

Adds Search ad-group keywords. Works with Google Ads.

```http
POST https://api.pozy.ai/v1/ads/keywords
```

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

## Request body

Content type: `application/json`

- `accountId`, string, required
- `adSetId`, string, required
- `keywords`, array of string or object, required: At least 1 item. Up to 1000 items
  - one of: string
  - one of: Option 2
    - `text`, string, required: 1 to 80 characters
    - `matchType`, string: One of `exact`, `phrase`, `broad`
- `negative`, boolean: Default `false`

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/ads/keywords" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "adSetId": "60484b408d44e7c2492bfec5",
  "keywords": [
    "string"
  ]
}'
```

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

## Response 201

- `keywords`, array of object
  - `id`, string
  - `platformCriterionId`, string
  - `resourceName`, string
  - `accountId`, string
  - `profileId`, string
  - `platform`, string: One of `google`
  - `adAccountId`, string
  - `campaignId`, string
  - `campaignName`, string: Can be null
  - `campaignStatus`, string: Can be null
  - `adSetId`, string
  - `adSetName`, string: Can be null
  - `adSetStatus`, string: Can be null
  - `keyword`, string
  - `matchType`, string: One of `exact`, `phrase`, `broad`, `unknown`
  - `status`, string: One of `active`, `paused`
  - `negative`, boolean
  - `qualityScore`, integer: Can be null
  - `quality`, object
    - `score`, integer: Can be null
    - `expectedCtr`, string: One of `BELOW_AVERAGE`, `AVERAGE`, `ABOVE_AVERAGE`. Can be null
    - `adRelevance`, string: One of `BELOW_AVERAGE`, `AVERAGE`, `ABOVE_AVERAGE`. Can be null
    - `landingPageExperience`, string: One of `BELOW_AVERAGE`, `AVERAGE`, `ABOVE_AVERAGE`. Can be null
  - `syncedAt`, string (date-time): Can be null
  - `metrics`, object: Can be null
    - `windowDays`, integer
    - `clicks`, integer
    - `impressions`, integer
    - `cost`, number
    - `conversions`, number
    - `firstPageCpc`, number: Can be null
    - `firstPositionCpc`, number: Can be null

```json
{
  "keywords": [
    {
      "id": "6bfebd43ddc270f6d2c56fc5",
      "platformCriterionId": "6882078ac440c35a806f87dc",
      "resourceName": "Acme",
      "accountId": "696e0b682d0a31188e7a2ba9",
      "profileId": "6a0b6573846efc28aaa9a3ff",
      "platform": "google",
      "adAccountId": "666219aad7bab67ace411e4f",
      "campaignId": "65a3737dd8b11ea61f199e6e",
      "campaignName": "Acme",
      "campaignStatus": "active",
      "adSetId": "60484b408d44e7c2492bfec5",
      "adSetName": "Acme",
      "adSetStatus": "active",
      "keyword": "string",
      "matchType": "exact",
      "status": "active",
      "negative": true,
      "qualityScore": 1,
      "quality": {
        "score": 1,
        "expectedCtr": "BELOW_AVERAGE",
        "adRelevance": "BELOW_AVERAGE",
        "landingPageExperience": "BELOW_AVERAGE"
      },
      "syncedAt": "2026-10-02T09:00:00.000Z",
      "metrics": {
        "windowDays": 1,
        "clicks": 1,
        "impressions": 1,
        "cost": 12.5,
        "conversions": 12.5,
        "firstPageCpc": 12.5,
        "firstPositionCpc": 12.5
      }
    }
  ]
}
```
