# Troubleshooting the APIs

> Why a widget stays empty, and the errors the public reviews API, the review requests API and the MCP server answer with, what each one means and what to do about it.

Source: https://docs.bifrostorbit.com/presence/developers/troubleshooting/

Errors from Presence Orbit's APIs have the same shape. The `message` is written so you can show it as it is:

```json
{ "error": { "code": "forbidden", "message": "This website isn't allowed to show these reviews" } }
```

## The widget stays empty

The widget shows nothing when the reviews can't be loaded, so open the browser's developer tools and look at the request to `/presence/api/public/…/reviews` under **Network**.

| You see | Why | What to do |
| --- | --- | --- |
| No request at all | The script isn't on the page, or the element was added after the script ran, as in a single-page app | Check the `script` tag. In a single-page app, load the script again after the element is added. See [Embed review widgets](https://docs.bifrostorbit.com/presence/developers/widgets/) |
| A request blocked by a content security policy | Your website's policy doesn't allow `app.bifrostorbit.com` | Add it to `script-src` and `connect-src`, and allow inline styles |
| `404` 'No reviews here' | `data-business` isn't your **Short name**, or `data-location` or `data-group` matches no location | Copy the snippet again from **Widgets**. A location's slug changes when it is renamed, and the short name when an Admin changes it under **Settings** |
| `403` 'This website isn't allowed to show these reviews' and a CORS error | The website isn't listed under **Settings**, **Your website** | An Admin adds it, such as `https://staging.northwilds.com`. Only the scheme, host and port count, so `https://www.northwilds.com` is a different website |
| `402` 'Reviews are paused' | The organisation's Presence Orbit trial or plan has ended | An owner chooses a plan under **Billing** in Orbit |
| `429` 'Too many requests. Try again in a minute.' | More than 120 requests a minute from one address, often a server or a test | Cache answers on your server. Browsers each have their own address, so visitors rarely hit it |
| `200`, but the widget shows only the average and a count | The layout is `badge`, or no review matches `data-min` and `data-sources` | Change `data-layout`, or widen the filters |

A new review takes up to about 5 minutes to show, because answers are cached.

## Review requests API

| Status | You see | What to do |
| --- | --- | --- |
| `401` | 'This API key isn't valid for this organisation…' | The key is wrong, or belongs to another organisation than the id in the address. Check both under **API keys** |
| `401` | 'This API key has been revoked…' or '…has expired…' | Create a new key |
| `401` | 'Sign in with your company account to continue' | No key was sent. Send it as `Authorization: Bearer pre_sk_…` or `X-Api-Key` |
| `403` | 'Review requests need a secret key (pre_sk_). Public keys aren't accepted…' | The key is an older public key. Create a new key under **API keys**, and revoke the old one |
| `403` | 'A secret key can only be used from a server, never from a browser.' | The call came from a browser. Send review requests from your own server |
| `403` | 'The management API is not in the Presence Orbit Starter plan…' | Review requests from the API need the Growth plan or above. An owner upgrades under **Billing** in Orbit |
| `402` | `subscription_inactive` | The trial or plan has ended. Nothing is deleted, and requests work again once an owner chooses a plan |
| `422` | `invalid`, with `issues` | The body doesn't fit: an unknown `channel` or `basis`, a missing `name` or `location`, a name over 120 characters, or more than 100 people. Nothing is sent |

A `200` can still hold rows that weren't sent. Read each result's `status` and `reason`:

| `reason` | What to do |
| --- | --- |
| 'There is no location called …' | Use the location's id, slug, code or exact name |
| 'None of the channels switched on under Review requests can reach this person.' | Add an email address, or switch on another channel under **Review requests** |
| 'Text messages need the Growth plan and a Twilio account under Review requests.' | Connect Twilio, or send by email |
| 'WhatsApp messages need the person's consent…' | Send `"basis": "consent"` only when they agreed, or use another channel |
| 'They were asked on … The next request is allowed from …' | Nothing: the person was asked recently. The gap is set under **Review requests** |
| 'They opted out on …' | Nothing: they asked not to be asked again |

## MCP server

| Status | You see | What to do |
| --- | --- | --- |
| `401` | 'Connect the assistant to Presence Orbit again' | The token is missing, expired or revoked, or the assistant was disconnected under **AI assistants**. Let the client sign in again |
| `403` | 'The person who connected this assistant no longer has Presence Orbit in the organisation' | Someone with access connects it again |
| `413` | 'The request is too large' | Keep requests under 1 MB |

If the assistant can't sign in at all, check that it supports remote MCP servers with OAuth (Streamable HTTP). See [The MCP server](https://docs.bifrostorbit.com/presence/developers/mcp/).
