Troubleshooting
MarkdownWhen a request can’t complete, the API returns an HTTP status and a short JSON message:
{ "error": "extension offline" }Common responses
Section titled “Common responses”| Response | Next step |
|---|---|
503 extension offline |
Open the connected browser. Check its status before trying again. |
503 extension outdated |
Apigami in that browser must be updated before it can connect again. Chrome installs the update on its own; if it hasn’t reconnected within a few minutes, ask the user to restart Chrome. |
403 not paired |
This user isn’t connected to this app. Send them through the connect page. |
403 account disabled |
Apigami disabled this account. Skip this person: your other users still answer, and this one may come back. |
403 app is private |
This person left your private app’s team. They pass again if they come back. |
403 a --staging version acts for its team's members only |
Your --staging version’s key, or a run of that version, named someone outside your team. Try with a member’s account; production serves everyone. |
404 unknown user_ref |
The reference isn’t one of your team’s. Check you saved the user_ref from the code exchange and use a key of the same team. |
403 consent requested with consentPending |
The user never decided this site, or with permission, your emails or AI, and the approval window is on screen in their browser. Wait for their answer, then try again. |
403 consent requested without consentPending |
Nobody asked yet. If the person is connected to your app, send them to one of your pages, to your install link, or to your link from POST /connect/par, where Apigami asks them (New permissions). If you reach them through another application (your key as a sub-app, your task), that application asks: put the work aside and try again later, never send them to your own install link (When an application calls yours). |
403 consent requested with terms |
The person has yet to agree to the terms or subprocessors of the applications whose app_id it lists, after a version that added one or changed its terms, on every route that serves a person, in place of any permission. Only the connect page asks it, never the approval window: send them to connect_url, your install link, present when they agree under your application, or to one of your pages (Your app’s terms); reached through another application, retry later. |
403 no grant |
The user declined or removed access to this site, or with permission, to your emails or AI. Only they change this, on their Apigami space: send them to settings_url, which opens your app’s entry there when the refusal is your app’s own, else the space itself. Don’t retry on your own. |
401 bad client credentials |
Check the API key. It may be missing, incorrect or revoked. |
An approval window on screen also includes "consentPending": true. Don’t open a new connection
flow for this: the browser is connected and waiting for the user’s decision. permission ("emails" or
"ai") is there only when the decision is about one of them, absent for a site.
Handle an error in your code
Section titled “Handle an error in your code”const data = await response.json()
if (!response.ok) { if (data.consentPending) { console.log('Please answer the approval window in your browser.') } else if (data.error === 'consent requested') { // Nobody asked yet. Connected to you: send them to your pages. Reached through another app: retry later. console.log('Not decided yet: putting this work aside.') } else { console.error(data.error) }} else { console.log(data.result)}Other responses
Section titled “Other responses”Account access and verification
| Response | Next step |
|---|---|
403 client disabled |
No member of the app’s team has an active account. Contact us if you think this is a mistake. |
403 client not verified |
This unlisted or public app has reached ten connected users. Contact us for verification. |
| Email not confirmed | Creating an app and using the MCP server require a confirmed address. The MCP server sends the confirmation email; open its link, or sign in with a code, then try again. |
400 clientId does not match the token |
Remove appId or clientId from the body. The API key already identifies your app. |
Connecting a user
| Response | Next step |
|---|---|
400 invalid_grant from POST /connect/token |
The code is wrong, expired, already used or issued to another app, or code_verifier or redirect_uri doesn’t match. Start a new connection. |
400 redirect_uri is not registered for this app |
Register the URL with app_settings (redirect_uris), path included. Only the query and the fragment can vary. |
400 code_challenge (S256) is required |
Send a base64url SHA-256 challenge and code_challenge_method: "S256". |
error=access_denied on your redirect URL |
The user cancelled. Offer the connect button again. |
error=expired on your redirect URL |
The user took more than 30 minutes. Start a new connection. |
Choosing the user's browser
| Response | Next step |
|---|---|
403 install_ref is not a browser of this user |
Use an install_ref listed by GET /v1/users/{user_ref}/installs, or leave it out. |
409 no browser is attached to this user |
Ask the user to open your connect link in the Chrome they use and attach it. |
409 several browsers of this user are online… |
The site was never asked about, or allowed again and held by none of their browsers, and more than one browser could ask. Send install_ref. |
409 no browser of this user holds the permission for … |
None of the user’s browsers can reach that site. Ask the user to open that browser, or send install_ref. |
Invalid request parameters
| Message | Next step |
|---|---|
user_ref is required |
Send the user’s user_ref in the body. It replaces extensionId: get one by connecting the user. |
user_ref must be a string or install_ref must be a string |
Send the references as strings, exactly as Apigami returned them. |
op is required |
Include the name of the operation. |
params.domain is required |
Include a hostname such as example.com in params.domain. |
targetDomain is required |
Include the hostname in the approval request. |
These responses have HTTP status 400.
403 <domain> is Apigami's own domain answers a call or an approval request on apigami.com,
apigami.tech or a host under them, such as your application’s address, {slug}.apigami.tech: no
operation may run there and no approval window opens for it.
Emails and AI
emails.send, ai.generate and ai.transcribe are answered by Apigami, never a browser, and refuse
with their own messages, each with what to do: Emails to your users,
AI in your application and the refusals of ai.transcribe.
Event and list query parameters
| Message | Next step |
|---|---|
since must be an ISO timestamp |
Send an ISO timestamp such as 2026-09-10T00:00:00Z. |
bad cursor |
Pass back the previous response’s next value without changing it. |
limit must be a number |
Send an integer. The default is 100 for GET /events and 500 for GET /v1/users, GET /v1/installs and GET /v1/users/unreached; the maximum is 1000. |
days must be a whole number from 1 to 365 |
Send days as an integer from 1 to 365 on GET /v1/users/unreached, or leave it out for 30. |
These responses have HTTP status 400. See Reading events and
Everyone connected to your app.
An operation failed or timed out
| Response | Next step |
|---|---|
502 extension disconnected |
The browser disconnected during the call. Check whether the action completed before retrying. |
502 operation has timed out |
The browser did not answer within 35 seconds, or stopped answering for 20 seconds during the call. Reduce the work and check for a result before retrying. |
502 the response is too large… |
The site’s answer does not fit in one call, 25 MB. Ask the site for less (a page, a range), or for gzip, which shrinks text but not images, PDFs or archives. |
502 operation failed or another browser message |
Check the URL, tab, selector and approved domain for the operation. |
tab <id> was closed or tab <id> is not on the granted domain <domain> |
Pass the tabId tabs.open returned, or one from tabs.list. A tab id belongs to one browser until it restarts. |
the tab opened on <domain> is still loading |
The tab has not reached the site yet. Try again in a moment. |
request.fetch answers status: 403 with x-datadome, cf-mitigated: challenge, or a body naming captcha-delivery or challenge-platform |
Anti-bot protection, not a sign-in problem. Open a tab of the site with tabs.open, then retry. Don’t read or copy the anti-bot cookie. |
403 <host> serves another application's pages, on its author's own domain… |
Another application, of your group or not, serves its pages at that name, its author’s own address, and they hold their token there: no operation of yours runs on that name or under it, and no approval window opens for it. Its parent domain and the names beside it stay reachable. If the name is yours, contact us. |
500 internal error |
An Apigami error occurred. If it persists, write to Apigami. |
Your app’s address, https://{slug}.apigami.tech, answers 404 No application answers at this address. |
No version answers at that host: check the slug, deploy a version with app_deploy and publish it with app_publish. {slug}--staging serves the version your latest deployment put there, and answers this when there is none. A slug you renamed away from answers this too. |
A page of your app’s address answers 503 This page took too long or This page was stopped |
That request used more than its 300 seconds of computing time, or the 128 MB of memory its instance shares with the requests it serves at once: look for a loop that does not end, or move the work to an action. app_logs says which (Limits). |
A page of your app’s address answers 502 This page failed |
Your code threw while answering it: app_logs has what it printed. |
An action or GET /v1/me answers 401 bad page token to the page token of a side panel |
The token expired or was renewed, or the request comes from another origin than its page’s. Use the latest token; apigami.js keeps it for you. |
An action, a task or stream.subscribe answers 403 subapp_not_accepted |
The application is an optional sub-app this person has not accepted under the application they connected to, or has removed. Read apigami.subapps() and show a button that opens it with apigami.open: the person accepts it there. 403 subapp_not_accepted (Mail), answered to a call of your application, calls a mandatory sub-app of the optional one it names: that is the one the person accepts, from its settings. |
A call to another application answers 403 not_a_subapp: … |
The calling version does not declare it, nor does a sub-app it declares still have it for mandatory as when the version was written (app_status says which changed). Add it to x-apigami.subapps, or write a new version to take a sub-app’s mandatory ones of now, then deploy; publish for your API key, which calls with production’s declaration. |
A call to another application answers 409 sub-application not published |
It has no production your application may call: never published, unpublished, or turned private by its group. Your next deployment that still declares it is refused, subapp_not_published or unknown_subapp. |
POST /v1/apps/{app_id}/tasks answers 400 unknown queue, with the index of the task; a queue’s read, pause or purge answers 404 unknown queue |
No queue has that name in this environment: staging and production each have their own. A sub-app’s run for one person sees only the queues that person’s runs configured. Configure it, with app_queues_write configure or PUT /v1/apps/{app_id}/queues/{name}, then add the tasks again. |
| A queued task is tried again every 2 seconds while its person’s Chrome is closed | Apigami refuses it extension offline, and its queue holds for nobody, so the task is deferred again and again, for up to 24 hours. Give each person whose Chrome the work needs a queue of their own with hold_while_user_offline (A queue per person, held while their Chrome is offline). |
403 queue settings require app scope |
A run that serves a person configured or paused a queue of its own application. Do it with app_queues_write, or under a run that serves nobody, such as a cron’s. |
403 queue belongs to another run scope |
A sub-app’s run for one person configured a queue made for another person, or for none. Put the person’s user_ref in the queue’s name; a queue made for nobody is changed with app_queues_write. |
An action’s answer has no X-Apigami-* header your code set |
Apigami removes them all: they are its own. X-Apigami-Settings is read before, to ask the person to set up or reconnect. |
A 502 whose body carries "outcome": "unknown" means the browser received the call and its answer
was lost: the request may have reached the site. Before repeating a write, such as sending a message,
read the site to see whether the first one went through.
Messages such as invalid url, no open tab for example.com or no element matches explain
what the browser couldn’t do. The operation guide lists the expected parameters.
Refusals at an application’s address
Section titled “Refusals at an application’s address”A refusal of Apigami’s at an application’s address, https://{slug}.apigami.tech, is JSON,
{ "error": "…" }, sometimes with hint, and carries X-Apigami-Platform: 1; an answer without that header
is the action’s own (Calling an application at its address).
| Response | Next step |
|---|---|
400 bad path parameter |
A path parameter is empty, or decodes to /, \ or a control character, or the path has an empty segment. Encode the value, %40 for @. |
400 this credential is not taken at an application's address |
A run token, an agent token, a GitHub Actions token, a person’s own Apigami token or X-Apigami-Extension. Call with an API key, or from a page with its session or its page token; hint lists what is taken. |
400 one Apigami credential per request |
X-Apigami-User-Ref without a key. Send it only with your API key or env.APIGAMI_KEY. |
401 bad client credentials |
No credential on an action that is not open, a key unknown or revoked, a token of another address. A key made in the last two minutes may not be known there yet: try again shortly. A version’s key that no longer serves production nor --staging answers this too, with a hint. |
403 a --staging version acts for its team's members only |
X-Apigami-User-Ref names someone outside your team, under your --staging version’s key or at your --staging address. Try with a member’s account. |
401 session expired: sign in again |
The page’s session ended. apigami.js sends the person to be connected again. |
401 this request's context has ended |
Your code called Apigami for the person more than an hour after the request arrived, or after the person stopped being served. Move long work to a queue. |
403 cross-site request: call this action from a page of this address |
A session cookie reached an action from another site. Call it from a page of the same address, with apigami.call. |
404 unknown user_ref |
The reference isn’t one of your team’s, or was made in the last two minutes: try again shortly. |
405 <METHOD> is not an action of <path>: use <methods> |
Call the path with a method its manifest declares, named in Allow. |
413 the body is over 64 MiB, the most an action takes at an application's address |
Send less, or put the file in file storage and send its name. |
429 too many calls: retry after <n> s |
Wait for Retry-After. |
503 this address cannot be reached right now: retry in a few seconds |
The one refusal to retry, after its Retry-After. |
403 not paired, 403 client disabled, 403 consent requested, 403 subapp_not_accepted and 403 not_a_subapp
mean what they mean on the API, above.
API calls aren’t queued or retried automatically. Before retrying an action that changes something on a site, check whether it already completed. This avoids sending a message or submitting a form twice.