# Connect the chosen Google Analytics property

Connects the chosen Google Analytics property.

```http
POST https://api.pozy.ai/v1/connect/googleanalytics/select-property
```

- Area: Accounts & connections / Connect
- Auth: API key plus X-Connect-Token header

## Request body

Content type: `application/json`

- `pendingDataToken`, string, required
- `propertyId`, string, required

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/connect/googleanalytics/select-property" \
  -H "X-Connect-Token: $CONNECT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "pendingDataToken": "string",
  "propertyId": "67197e35a04da83e86751673"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/connect/googleanalytics/select-property", {
  method: "POST",
  headers: {
    "X-Connect-Token": process.env.CONNECT_TOKEN!,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    pendingDataToken: "string",
    propertyId: "67197e35a04da83e86751673"
  }),
});
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/connect/googleanalytics/select-property",
    headers={"X-Connect-Token": os.environ["CONNECT_TOKEN"]},
    json={
        "pendingDataToken": "string",
        "propertyId": "67197e35a04da83e86751673",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `redirect_url`, string
- `account`, object: Can be null
  - `accountId`, string
  - `platform`, string
  - `username`, string
  - `displayName`, string

```json
{
  "redirect_url": "https://pozy.ai/media/example-1.jpg",
  "account": {
    "accountId": "696e0b682d0a31188e7a2ba9",
    "platform": "instagram",
    "username": "acme",
    "displayName": "Acme"
  }
}
```
