# Diagnose Customer Token Scopes

Canonical: https://docs.bluehola.com/docs/business-verification/get-v1-business-portfolios-id-token-scopes
OpenAPI: https://docs.bluehola.com/openapi.yaml

<div class="endpoint"><span class="endpoint-method endpoint-method--get">GET</span><code class="endpoint-path">/v1/business-portfolios/{id}/token-scopes</code></div>

Diagnose which scopes Meta granted to this Portfolio's customer Embedded Signup token (via debug_token). Used to determine whether an analytics/WABA status permission error is because the token is missing whatsapp_business_management or the platform's App is missing Advanced Access. Does not echo back the token itself.

:::note[Authentication]

Send `Authorization: Bearer <API_KEY>` in the request headers, with scope: `onboarding:read`. Which resources an API Key can reach is determined by its current authorization scope.

:::

## Request

Base URL: `https://api.bluehola.com`

### Parameters

| Name | In | Required | Type / constraints | Description |
| --- | --- | --- | --- | --- |
| `id` | path | Yes | string | The platform's Business Portfolio ID, `bm_...` |

## Response

| Status | Description |
| --- | --- |
| `200` | OK |
| `4xx` | Client error |

For the common error envelope and how to handle it, see [Error Codes](../guides/error-codes.md).

## Notes

This depends on the platform's own App ID + App Secret being fully configured before it can call Meta's `debug_token` endpoint; when they are not configured, this diagnostic capability itself is unavailable and it returns 500 rather than an empty result meaning "this token has no scopes at all" — the two have entirely different meanings, and confusing them leads to misdiagnosing it as a customer authorization problem. Besides the top-level `scopes` array, the response also echoes `granularScopes` (which includes the specific `targetIds` each permission is bound to), because a permission such as `whatsapp_business_management` may on Meta's side be scoped to a specific range of WABA/business ids — looking only at the top-level scope list would miss the more subtle failure case of "this token does genuinely have this permission, but it does not cover the specific asset you are operating on".
