Google — exchange OAuth code for access token

Exchanges a Google OAuth code for an access token, stores it (google_access_tokens), and then branches: with connect_google=1 + company_id_hash it links the token to that company and syncs its GBP locations (dispatching DuplicateGMBDebugger). With source=app it returns the token plus fetched account/location data; otherwise it returns only the stored token id + token. Requires the business.manage scope to have been granted at consent. Records gbp_connection_events.

Auth

  • Auth-optional. Bearer token (api guard) OR the public connect-page pair (connect_google=1 + company_id_hash) OR an invite hash. No token needed for the latter two.

Rate limit

  • 30 requests/min per IP (public).

Query

FieldTypeRequiredNotes
codestringRequiredGoogle OAuth authorization code.
connect_googleinteger (0,1)Optional1 → link token to company + sync GBP locations.
company_id_hashstringOptionalRequired when connect_google=1. Hashid of the target company.
sourcestring (app,web)Optionalapp returns account+location data; picks the redirect URI.
hashstringOptionalInvite hash encoding [store_id, 15]; grants access without a token.

Behaviour

  • 200 with the token payload (web/app) or the synced location list (connect_google=1). 400 for an invalid company hash. Note: missing business.manage scope, absent access token, and Google token-endpoint errors are surfaced via errorResponse (HTTP 500) with an explanatory message.

Errors: 422 on validation failure.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
string
required

Required. Google OAuth authorization code.

string

Optional. App|web. app returns account+location data; also selects the redirect URI.

Responses

Language
Credentials
Bearer
JWT
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json