Skip to main content

Pin a Google Business Location to a Profile

Connecting Google Business links a Google account, which may manage several business locations. Google's account chooser lets the user pick the account, not the location, so a multi-location account has to send gbp_location_id on every upload — and omitting it fails with "gbp_location_id is required. Your account has N locations — please select one."

When a profile should always publish to one location — the usual case when each of your customers or storefronts has its own profile — pin that location to the profile once. From then on every upload from that profile (photos, text, video, scheduled posts and retries) goes to the pinned location and you can omit gbp_location_id.

The same selection is available in the dashboard (User Management → Google Business card) and in the white-label connect page, so end users can pick their location themselves right after connecting.

Precedence

A pinned location takes precedence over the gbp_location_id parameter of the upload endpoints, exactly like the Facebook Page pin and the LinkedIn Page pin. To publish to another location from the same profile, clear the pin first (DELETE) or use another profile.

Accounts with a single location keep working with no pin at all: it is auto-detected.

  • Authentication: any of
    • Authorization: Apikey <YOUR_API_KEY> (API key)
    • Authorization: Bearer <user JWT> (dashboard session)
    • the profile-scoped JWT issued for the connect page (see User Profiles API)

Get available locations and the current pin

  • Method: GET
  • Endpoint: /api/uploadposts/users/google-business-location
ParameterTypeDescriptionRequired
profile_usernamestringThe profile's username (query parameter).Yes
  • Successful Response (200 OK)
{
"success": true,
"locations": [
{
"name": "locations/1234567890",
"title": "Acme Madrid",
"account_id": "google-business-account-key",
"account_name": "accounts/9876543210"
}
],
"selected_location_id": "locations/1234567890",
"selected_location_name": "Acme Madrid"
}

locations is the same list returned by Get Google Business Locations for that profile, including locations that live under a secondary Google account (account_name is the one that owns each location). selected_location_id / selected_location_name are null when nothing is pinned. The same two fields are returned for each profile by the User Profiles API and by validate-jwt.

Pin a location

  • Method: POST
  • Endpoint: /api/uploadposts/users/google-business-location
  • Body (JSON):
FieldTypeDescriptionRequired
profile_usernamestringThe profile's username.Yes
gbp_location_idstringLocation name from the list (locations/1234567890), the bare id (1234567890) or the full path (accounts/98/locations/12). Must belong to the account connected to this profile.Yes
curl -X POST https://api.upload-post.com/api/uploadposts/users/google-business-location \
-H "Authorization: Apikey YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"profile_username": "acme", "gbp_location_id": "locations/1234567890"}'
  • Successful Response (200 OK)
{
"success": true,
"gbp_location_id": "locations/1234567890",
"gbp_location_name": "Acme Madrid"
}

The location title and its owning Google account are taken from Google, never from the request. A gbp_location_id the connected account cannot post to returns 400.

Clear the pin

  • Method: DELETE
  • Endpoint: /api/uploadposts/users/google-business-location
  • Body (JSON): {"profile_username": "acme"}

After clearing, uploads fall back to the default behaviour: the gbp_location_id parameter, or auto-detection when the account has exactly one location.

Error Responses

StatusMeaning
400Missing profile_username / gbp_location_id, profile has no Google Business connected, token unavailable, or the location is not available to that account.
404Profile not found.