# Create a conversion destination

Creates a conversion destination. Works with Google Ads and LinkedIn Ads.

```http
POST https://api.pozy.ai/v1/accounts/{accountId}/conversion-destinations
```

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

## Path parameters

- `accountId` (string, required)

## Request body

Content type: `application/json`

- `adAccountId`, string, required
- `name`, string, required: Up to 255 characters
- `type`, string, required
- `attributionType`, string: One of `LAST_TOUCH_BY_CAMPAIGN`, `LAST_TOUCH_BY_CONVERSION`
- `postClickAttributionWindowSize`, integer: One of `1`, `7`, `30`, `90`, `365`
- `viewThroughAttributionWindowSize`, integer: One of `1`, `7`, `30`, `90`, `365`
- `valueType`, string: One of `DYNAMIC`, `FIXED`, `NO_VALUE`
- `value`, object
  - `currencyCode`, string, required: 3 to 3 characters
  - `amount`, string, required
- `autoAssociationType`, string: One of `ALL_CAMPAIGNS`, `OBJECTIVE_BASED`, `NONE`. Default `ALL_CAMPAIGNS`
- `countingType`, string: One of `MANY_PER_CLICK`, `ONE_PER_CLICK`
- `primaryForGoal`, boolean

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/conversion-destinations" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "adAccountId": "666219aad7bab67ace411e4f",
  "name": "Acme",
  "type": "string"
}'
```

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

## Response 201

- `platform`, string: One of `linkedinads`, `googleads`
- `destination`, object
  - `id`, string, required
  - `name`, string, required
  - `type`, string
  - `status`, string: One of `active`, `inactive`
  - `adAccountId`, string

```json
{
  "platform": "linkedinads",
  "destination": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "name": "Acme",
    "type": "string",
    "status": "active",
    "adAccountId": "666219aad7bab67ace411e4f"
  }
}
```
