google account is one location. These endpoints list the locations a Google login manages, connect another one to a brand, update a location’s public profile, and manage the photos and videos on it.
Endpoints
{loginId} is the login_id returned when you connect Google and on every Google account: see Choose a Google Business Profile. {id} is the connected account ID (acc_...). The full schemas are in the API reference.
Read a location’s details
GET /v1/platforms/google/logins/{loginId}/locations returns the locations the Google login can manage, read from Google at request time. A location added in Google Business Profile after the login was authorized appears at once, with no new consent screen.
details carries these fields. Each one is absent when Google returns no value for it, so treat every field as optional. A service-area business (a locksmith, a plumber) has no storefront_address and carries service_area instead.
A boolean flag that is absent means Google told SocialAPI nothing. It does not mean
false: check that the key is present before treating a flag as a denial.
Connect another location to a brand
POST /v1/platforms/google/logins/{loginId}/locations/{locationId}/assign connects one location from the login to a brand, without a second consent screen. {locationId} is the platform_account_id, with the slashes either sent as they are or URL-encoded as %2F.
- One brand per location. A location belongs to exactly 1 brand. Assigning a location that another brand holds returns
400 validation.location_already_assigned. - One Google Business Profile per brand. A brand holds at most 1 location. Assigning a second location to the same brand returns
409 platform.google.brand_has_account. Disconnect the first account, or assign the location to another brand. - The login must still grant the location. A location the login no longer manages returns
400 validation.location_not_granted. - The brand must exist. An unknown brand returns
404 brand.not_found. A missingbrand_idreturns400 validation.field_required. - Cost. Assigning a location costs no credits.
Update a location
PUT /v1/platforms/google/accounts/{id} writes the location’s public profile. Send only the fields you want to change:
data, in the shape of details above:
Lists replace instead of merging:
regular_hours.periods, labels, additional_phones, and additional_categories each overwrite the whole list, so include every entry you want to keep. Objects merge: inside storefront_address you can send only postal_code and the rest of the address stays.
Not writable: place_id, maps_uri, new_review_uri, and the status flags are output only. language_code is fixed when the location is created. A request with none of the writable fields returns 400 validation.no_fields_to_update. A value Google rejects returns 502 platform.google.api_error, with Google’s reason in error.message.
Validate before you write
Google has no sandbox, so every write changes a real Business Profile. Addvalidate_only=true to have Google check the change and apply nothing:
Edits are moderated
A200 means Google accepted the change for review. It does not mean the change is live on Search and Maps. Read the location back to see what is live, and check details.has_pending_edits for edits still under review.
Profile media
A location’s profile carries its own photos and videos: the logo, the cover image, interior and exterior shots. They are separate from the media attached to a post, and they are what customers see on the listing.GET /v1/platforms/google/accounts/{id}/media lists them:
GET /v1/platforms/google/accounts/{id}/media/{mediaId} returns one item. mediaId accepts the bare ID or the full resource name from the list.
Add a photo or video
POST /v1/platforms/google/accounts/{id}/media adds one item. media takes exactly 1 entry, in the same {source_type, source} form the publishing endpoints accept:
category is one of COVER, PROFILE, LOGO, EXTERIOR, INTERIOR, PRODUCT, AT_WORK, FOOD_AND_DRINK, MENU, COMMON_AREA, ROOMS, TEAMS, or ADDITIONAL. PROFILE sets the avatar shown for the location. LOGO is the fallback when no PROFILE photo exists.
A request with other than 1 media entry returns 422 google.media.single_item_required. An unknown category returns 422 google.media.invalid_category. A media entry that cannot be resolved returns 422 google.media.unresolvable.
Remove a photo or video
DELETE /v1/platforms/google/accounts/{id}/media/{mediaId} removes an item you added and returns 204 with no body. mediaId accepts the bare ID or the full resource name.
Photos your customers posted
Customers add their own photos to a listing. They live in a separate read-only gallery. Read it withcontributed=true:
attribution block with profile_name, profile_photo_url, profile_url, and takedown_url. Google requires you to display the attribution exactly as given, without changing or removing it. A delete on a customer photo returns 403 platform.google.access_denied. Report the photo to Google through its takedown_url instead.
Limits
Scopes
Related
- Google Business Profile API: capabilities, connect rules, and limits for the platform
- Reviews: list and reply to the reviews on a location
- Google Business Profile publishing: publish local posts to a location
- Connect accounts: choose a location when a login manages more than 1
- Errors: every error code