# Invite a client account to a manager

Invites a client account to a manager. Works with Google Ads.

```http
POST https://api.pozy.ai/v1/ads/accounts/manager-links
```

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

## Request body

Content type: `application/json`

- `accountId`, string, required
- `managerCustomerId`, string, required
- `clientCustomerId`, string, required
- `validateOnly`, boolean: Default `false`

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/ads/accounts/manager-links" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "managerCustomerId": "6d00a12c8c36af8967d368bc",
  "clientCustomerId": "6e67bc70e85edf2d772ad4fb"
}'
```

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

## Response 200

- `managerCustomerId`, string
- `clientCustomerId`, string
- `managerLinkId`, string: Can be null
- `status`, string: One of `PENDING`, `ACTIVE`, `REFUSED`, `CANCELED`, `INACTIVE`
- `validateOnly`, boolean

```json
{
  "managerCustomerId": "6d00a12c8c36af8967d368bc",
  "clientCustomerId": "6e67bc70e85edf2d772ad4fb",
  "managerLinkId": "6083e4956af6ca4aa26c607c",
  "status": "PENDING",
  "validateOnly": true
}
```
