Endpoints
GBP
Session-authenticated Google Business Profile connection, review, reply, and posting endpoints.
GET
GBP endpoints power the dashboard connection flow for Google Business Profile. They use the signed-in app session, not
Successful responses redirect to the OAuth consent screen. Missing app integration configuration returns:
Successful callbacks redirect to the return path with
When no connection is visible:
If there is no visible connection, the response is still successful:
If the active business is missing or not connected, the route returns an empty review array with an explanatory
Org-owned businesses require the
Bulk posting requires a plan with
X-NearIQ-Key, and operate on the user’s active accessible business.
These endpoints are not public v1 API-key endpoints. They require an authenticated dashboard session and may return
401 when the session is missing.GET /api/gbp/connect
Starts the OAuth connection flow and redirects the browser to the consent screen.Optional relative path to return to after a successful connection. Non-relative values are ignored.
Set to
1 when the user is explicitly authorizing spreadsheet export access in the same flow.Set to
sheets as an alternate way to include spreadsheet export access.GET /api/gbp/callback
Handles the OAuth callback, verifies the signed-in user matches the state payload, stores encrypted tokens, discovers the first available location, and redirects back to the requested dashboard path.gbp=connected. Failure redirects include gbp=error and a reason such as missing_code, invalid_state, auth_mismatch, token_exchange_failed, no_business, or encryption_unavailable.
GET /api/gbp/status
Returns the current user’s visible GBP connection status.POST /api/gbp/disconnect
Disconnects the visible GBP connection for the active business. Token revocation is best effort; the local connection is removed either way.GET /api/gbp/reviews
Fetches reviews for the active connected location and normalizes them for the dashboard review reply flow.error value.
POST /api/gbp/reply
Posts or updates a reply to a GBP review.Full review resource name returned by
GET /api/gbp/reviews.Reply text. Either
comment or reply is accepted.Alternate reply text field kept for legacy clients.
review_responses_post permission.
DELETE /api/gbp/reply
Deletes a reply from a GBP review.DELETE /api/gbp/reviews/reply is an alias for the same handler.
POST /api/gbp/post
Creates a local post for the active connected GBP location.This endpoint requires a plan with
gbpAutoPost access. Org-owned businesses also require the social_media_publish permission.Post text. Must be 1-1500 characters.
One of
BOOK, ORDER, SHOP, LEARN_MORE, SIGN_UP, or CALL.Optional CTA URL.
Optional public image URL.
POST /api/gbp/bulk-post
Creates the same local post for multiple owned business locations.Owned business IDs to post to. The route accepts 1-50 IDs.
Post text. Must be 1-1500 characters.
gbpAutoPost access and only posts to businesses owned by the signed-in user.