Assign GBP location to another profile
Connect a Google Business location onto a DIFFERENT profile by reusing the OAuth grant from an already-connected GBP account — no browser, no re-authorization. Built for agencies whose single Google account has manager access to many client locations and who run one profile per client: connect one location the normal way (browser OAuth), then bulk-assign the rest onto each client's profile via this endpoint. The path accountId is a SOURCE connected GBP account (the token holder); the body profileId is the TARGET profile. Returns 409 if the target profile already has a Google Business connection (switch its location with PUT gmb-locations instead).
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
A source connected GBP account whose OAuth grant is reused.
Target profile to connect the location onto.
The Google Business location ID to assign (e.g. "locations/123").
Optional but recommended. The Google Business Account resource name ("accounts/123") that owns the location (from GET gmb-locations). When provided the location is resolved directly instead of by enumerating the account, required for accounts with many locations.
Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.connect.assignGoogleBusinessLocation({ path: { accountId: 'account_abc123', }, body: { profileId: 'profile_abc123', selectedLocationId: 'selectedlocation_abc123', },});console.log(data);{
"message": "Google Business location assigned to profile successfully",
"account": {
"accountId": "6a41f0ab70e2d329a7741307",
"platform": "googlebusiness",
"username": "Snap Fitness Dianella",
"displayName": "Snap Fitness Dianella",
"isActive": true,
"selectedLocationName": "Snap Fitness Dianella",
"selectedLocationId": "12345678901234567890"
}
}{
"error": "Unauthorized"
}Select GBP location POST
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.
List GBP locations GET
Returns Google Business Profile locations the connected account can access, plus the currently selected location. The list is bounded (see hasMore); for accounts that own many locations, use the search or filter query params to find a specific one instead of loading them all, or raise limit to enumerate an account with more than 100 locations.