> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pendpost.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Business Profile

> Set up Google Business Profile local posts. Beta, and gated behind a Google API access request.

The Google Business Profile lane publishes local posts to a verified business location. It publishes only once a GBP credential is present in your `.env`; until then the lane is live-but-unauthenticated and waits for you to connect it (set `PENDPOST_MODE=mock` to exercise it through the mock driver).

> [!NOTE]
>
> **Beta lane, and access-gated.** Google gates the Business Profile APIs behind a per-project access request. Until that request is approved, every call returns 403 and the lane stays beta. The OAuth flow can still complete before approval; only publishing is blocked.

You own your Business Profile and are responsible for Google's terms of service and local-post content policies. pendpost drafts and schedules, but a human approves before anything goes live.

## Setup ceremony

1. **Request Business Profile API access.** Submit the access request for your Cloud project (the form at `https://developers.google.com/my-business/content/prereqs`). Until it is approved, publishing returns 403.

2. **Create the OAuth client.** In the Google Cloud console create OAuth credentials, enable the Business Profile APIs (My Business Account Management, My Business Business Information, and Google My Business API v4), and register the loopback redirect `http://127.0.0.1:8088/oauth/gbp/callback`. Copy the client id and secret.

3. **Authorize.** Run the CLI below. It opens the consent screen for the `business.manage` scope, exchanges the code, stores the tokens, and (once access is approved) prints your account and location ids as candidates.

   ```bash theme={null}
   node scripts/gbp-social.mjs auth
   ```

4. **Set the target location.** Set `GBP_ACCOUNT_ID` and `GBP_LOCATION_ID` to the numeric ids of the verified location posts should appear on.

## Environment variables

| Variable | Purpose |
| - | - |
| `GBP_CLIENT_ID` | Your Google Cloud OAuth client id. |
| `GBP_CLIENT_SECRET` | Your Google Cloud OAuth client secret. |
| `GBP_ACCOUNT_ID` | The numeric account id of the business. |
| `GBP_LOCATION_ID` | The numeric id of the verified location to post on. |

> [!NOTE]
>
> A lane publishes only once its credential is present. If the GBP variables are blank, the GBP lane is live-but-unauthenticated and waits for you to connect it. Set `PENDPOST_MODE=mock` to exercise it through the mock driver.

## Validate the lane

A present credential is not the same as a working one. After setup, validate the GBP lane in the **Setup** tab, or run a live probe with the `health_recheck` tool, to confirm the credential is live and not just configured. The lane is ready when it reports live.

> [!NOTE]
>
> **Over MCP.** Setup and rotation are an interactive human ceremony; secrets are never written through MCP. An agent can still check status (`account_status`), run a live liveness probe (`health_recheck`), and read non-secret config (`config_get`) over MCP without touching credentials.

## Common failures

| Symptom | Cause | Fix |
| - | - | - |
| Every API call returns 403 after a successful consent. | The Cloud project has not been approved for the Business Profile APIs yet. | Submit the access request form and wait for approval; the OAuth token itself is fine. |
| Publish fails with a location error. | `GBP_ACCOUNT_ID` / `GBP_LOCATION_ID` are missing, or the location is not verified or owned by the authorized account. | Run auth to list candidates, verify the location in the Business Profile manager, and set both ids. |
| The post is created but never becomes visible. | Google reviews local posts; a REJECTED state means a content-policy hit. | Check the post state and adjust the content (no phone numbers in the summary, policy-safe imagery). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.