# Assign Google Business Profile location to another profile

Assigns a Google Business Profile location to another profile.

```http
POST https://api.pozy.ai/v1/accounts/{accountId}/gmb-locations/assign
```

- Area: Accounts & connections / Connect
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `accountId` (string, required)

## Request body

Content type: `application/json`

- `profileId`, string, required
- `selectedLocationId`, string, required
- `googleAccountId`, string

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/gmb-locations/assign" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "profileId": "6a0b6573846efc28aaa9a3ff",
  "selectedLocationId": "69b17abfcdf8b6b424fe92d1"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/accounts/696e0b682d0a31188e7a2ba9/gmb-locations/assign", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    profileId: "6a0b6573846efc28aaa9a3ff",
    selectedLocationId: "69b17abfcdf8b6b424fe92d1"
  }),
});
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/gmb-locations/assign",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "profileId": "6a0b6573846efc28aaa9a3ff",
        "selectedLocationId": "69b17abfcdf8b6b424fe92d1",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `message`, string
- `account`, object
  - `accountId`, string
  - `platform`, string
  - `username`, string
  - `displayName`, string
  - `isActive`, boolean
  - `selectedLocationName`, string
  - `selectedLocationId`, string

```json
{
  "message": "Hello from Pozy",
  "account": {
    "accountId": "696e0b682d0a31188e7a2ba9",
    "platform": "instagram",
    "username": "acme",
    "displayName": "Acme",
    "isActive": true,
    "selectedLocationName": "Acme",
    "selectedLocationId": "69b17abfcdf8b6b424fe92d1"
  }
}
```
