# Update account conversion goals

Updates account conversion goals. Fields you leave out keep their current values. Works with Google Ads.

```http
PATCH https://api.pozy.ai/v1/ads/conversions/goals
```

- Area: Ads / Conversions
- Auth: Authorization: Bearer pz_live_...

## Request body

Content type: `application/json`

- `accountId`, string, required
- `adAccountId`, string: Matches `^\d+$`
- `customerId`, string: Matches `^\d+$`
- `goals`, array of object, required: At least 1 item. Up to 100 items
  - `category`, string, required: Matches `^[A-Z][A-Z0-9_]*$`
  - `origin`, string, required: Matches `^[A-Z][A-Z0-9_]*$`
  - `biddable`, boolean, required

## Example request

```bash
curl -X PATCH "https://api.pozy.ai/v1/ads/conversions/goals" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "goals": [
    {
      "category": "string",
      "origin": "string",
      "biddable": true
    }
  ]
}'
```

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

## Response 200

- `customerId`, string
- `goals`, array of object
  - `category`, string
  - `origin`, string
  - `biddable`, boolean
  - `resourceName`, string
  - `conversionActions`, array of object
    - `id`, string
    - `name`, string
    - `status`, string
    - `primaryForGoal`, boolean

```json
{
  "customerId": "691909ff82eb5ed7c816716d",
  "goals": [
    {
      "category": "string",
      "origin": "string",
      "biddable": true,
      "resourceName": "Acme",
      "conversionActions": [
        {
          "id": "6bfebd43ddc270f6d2c56fc5",
          "name": "Acme",
          "status": "active",
          "primaryForGoal": true
        }
      ]
    }
  ]
}
```
