---
title: "Select GBP location"
method: POST
path: "/v1/connect/googlebusiness/select-location"
tags: ["Connect"]
---

# Select GBP location

`POST /v1/connect/googlebusiness/select-location`

Complete the headless GBP flow by saving the user's selected location. The pendingDataToken is returned in your redirect URL after OAuth completes (step=select_location). Tokens and profile data are stored server-side, so only the pendingDataToken is needed here. Use X-Connect-Token header if connecting via API key.

## Request body

- object
  - `profileId` string, required — Profile ID from your connection flow
  - `locationId` string, required — The Google Business location ID selected by the user
  - `accountId` string — Optional but recommended. The Google Business Account resource name ("accounts/123") that owns the selected location (returned per-location by GET /v1/connect/googlebusiness/locations). When provided, the location is resolved directly instead of by enumerating the account, which is required for accounts that own many locations. Omit only for small accounts.
  - `pendingDataToken` string, required — Token from the OAuth callback redirect (pendingDataToken query param). Tokens and profile data are retrieved server-side from this token.
  - `redirect_url` string, uri — Optional custom redirect URL to return to after selection

## Response `200`

Google Business location connected successfully

- object
  - `message` string
  - `redirect_url` string — Redirect URL if custom redirect_url was provided
  - `account` object
    - `accountId` string — ID of the created SocialAccount
    - `platform` 'googlebusiness'
    - `username` string
    - `displayName` string
    - `isActive` boolean
    - `selectedLocationName` string — Human-readable location display name, NOT a resource name. Do not use it to build API paths.
    - `selectedLocationId` string — Bare GBP location id. Combine with the GBP account id as accounts/{gbpAccountId}/locations/{selectedLocationId} to form the location resource names that gmb-reviews/batch expects in locationNames.

## Other responses

- `400` — Missing required fields (profileId, locationId, or tempToken), or the provided accountId is not one of the accounts this connection manages
- `401` — Unauthorized
- `403` — User does not have access to the specified profile
- `404` — Selected location not found in available locations
- `500` — Failed to save Google Business connection

---

[API](https://skmtc.net/zernio/apis/zernio-api.md) · [All operations](https://skmtc.net/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zernio/zernio-api/versions/f81ca70ea6b9/schema)
