# Select Google Business Profile location

Selects a Google Business Profile location.

```http
POST https://api.pozy.ai/v1/connect/googlebusiness/select-location
```

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

## Request body

Content type: `application/json`

- `profileId`, string, required
- `locationId`, string
- `locations`, array of object: At least 1 item. Up to 25 items
  - `locationId`, string, required
  - `accountId`, string
- `accountId`, string
- `pendingDataToken`, string, required
- `redirect_url`, string (URL)

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/connect/googlebusiness/select-location" \
  -H "X-Connect-Token: $CONNECT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "profileId": "6a0b6573846efc28aaa9a3ff",
  "pendingDataToken": "string"
}'
```

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

## Response 200

- `message`, string
- `redirect_url`, string
- `account`, object
  - `accountId`, string
  - `platform`, string: One of `googlebusiness`
  - `username`, string
  - `displayName`, string
  - `isActive`, boolean
  - `selectedLocationName`, string
  - `selectedLocationId`, string
- `accounts`, array of object
- `failed`, array of object
  - `id`, string
  - `code`, string
  - `message`, string

```json
{
  "message": "Hello from Pozy",
  "redirect_url": "https://pozy.ai/media/example-1.jpg",
  "account": {
    "accountId": "696e0b682d0a31188e7a2ba9",
    "platform": "googlebusiness",
    "username": "acme",
    "displayName": "Acme",
    "isActive": true,
    "selectedLocationName": "Acme",
    "selectedLocationId": "69b17abfcdf8b6b424fe92d1"
  },
  "accounts": [
    {}
  ],
  "failed": [
    {
      "id": "6bfebd43ddc270f6d2c56fc5",
      "code": "string",
      "message": "Hello from Pozy"
    }
  ]
}
```
