Skip to content
BuildBase

Error Codes

The error codes and messages the SDK produces, what each one means, and what to do about it.

Most SDK failures are a plain Error whose message says what went wrong. A handful carry a machine-readable code you can branch on. This page lists both: the codes first, then the messages you are most likely to see.

How errors surface

WhereWhat you get
HooksAn error field (usually a string) on the hook result, for example useConnectedAgents(), PricingPage
Async calls you makeA rejected promise with an Error; read err.message, and err.code where this page lists one
onError in the server config(error, { method, path }) runs for every failed API request, before the error is thrown to you
onUnauthorizedOn the *Api client classes (WorkspaceApi and siblings): runs when a request gets a 401
useSessionEnded()Why a company ended the session (401 session_ended), reported before onUnauthorized runs
isReauthRequired(error)A change that needs a recent proof of who the person is (403 reauth_required); the session is kept
TrackingAn sdk_error event with component, action and code, never the message
import BuildBase from '@buildbase/sdk';

const bb = BuildBase({
  serverUrl: process.env.BUILDBASE_SERVER_URL!,
  orgId: process.env.BUILDBASE_ORG_ID!,
  onError: (error, { method, path }) => {
    console.error(`[buildbase] ${method} ${path}`, error.message);
  },
});

Aborted requests (an AbortError, from your own AbortController or an unmounted component) are treated as cancellations: the SDK does not report them, and you can ignore them too.

Error codes

Credits

CodeWhen it happensWhat to do
INSUFFICIENT_CREDITSuseConsumeCredits() or bb.credits.consume() gets a 402: the balance is too lowRead err.available and err.requested to explain the gap, then offer openCreditStore() or a plan change
HOLD_NOT_OPENA 409 on settling or releasing a hold that is no longer open. The body's status says what became of it: settled, released or expired (its ttlSeconds ran out)After released or expired the credits are back: reserve again if the work still needs them
AUTO_TOP_UP_INCOMPLETEA 400 on switching auto top-up on with no threshold or no packSend both
PACKAGE_CURRENCY_UNAVAILABLEA 400 on switching auto top-up on with a pack that has no price in the workspace's currencyChoose a pack priced in that currency
PACKAGE_VERSION_CHANGEDA 409 on agreeing to a pack's new terms (acceptVersion) when the version it names is no longer the one on sale: another was published since the payer read themRead the setting again (versionOnSale) and agree to what it shows
AGREEMENT_PAYER_ONLYA 400 on the console's support route for a workspace's auto top-up when it sends acceptVersion: only the payer agrees to a pack's new termsAsk the payer to agree from their own billing settings
TAX_REQUIRES_HOSTED_CHECKOUTA 409 on switching auto top-up on in an organization that collects tax: a saved-card charge does not compute tax yetSell packs through checkout instead
AUTO_TOP_UP_OFFA 403 on switching auto top-up on, or changing one that is on, when your organization does not offer it to its customers (Settings > General, card Automatic credit top-up)Buy packs through checkout, or switch the top-up off
MONTHLY_CAP_ABOVE_LIMITA 400 on setting an auto top-up's monthlyCap above the most top-ups a month your organization allowsChoose a cap within the limit the message names
CREDIT_PACKAGE_IN_USEA 409 on deleting a credit pack (DELETE /api/subscriptions/credit-packages/:id) while something still holds it: a plan version names it, an enabled auto top-up buys it, or credits bought or granted from it are still unspent. The body's inUse says whichSwitch the pack off (Active off) instead: that stops new sales, keeps what holders bought, and lets their auto top-ups keep buying it
import {
  useConsumeCredits,
  useSaaSAuth,
  useSaaSWorkspaces,
} from '@buildbase/sdk/react';

function Generate() {
  const { currentWorkspace } = useSaaSWorkspaces();
  const { consumeCredits } = useConsumeCredits(currentWorkspace?._id);
  const { openCreditStore } = useSaaSAuth();

  async function run() {
    try {
      await consumeCredits({ amount: 10, description: 'AI generation' });
    } catch (err: any) {
      if (err.code === 'INSUFFICIENT_CREDITS') {
        alert(
          `You have ${err.available} credits, this needs ${err.requested}.`
        );
        openCreditStore();
        return;
      }
      throw err;
    }
  }

  return <button onClick={run}>Generate</button>;
}

Billing and checkout

Each code is the code field of the server's JSON answer, beside its HTTP status.

CodeStatusWhen it happensWhat to do
TAX_SETTING_UNAVAILABLE503A checkout (a plan, a person's own plan, a credit pack or an add-on) could not read the organization's tax setting. Nothing was created or charged. The answer carries Retry-AfterRetry after the Retry-After seconds; the same request can succeed
STRIPE_PUBLISHABLE_KEY_MISSING400A checkout inside your app was asked for, and no Stripe publishable key is saved with the payment credentials. Refused before any session is madeSave the pk_live_... or pk_test_... key under Billing > Credentials, or use the hosted checkout
STRIPE_KEY_MODE_MISMATCH400An embedded checkout, and the saved publishable key is from the other mode (live or test) than the secret keyReplace the publishable key with the one from the same mode and Stripe account
STRIPE_NOT_CONNECTED409The organization has not connected Stripe, so a checkout cannot be made: a workspace's plan, a person's own plan or a credit pack. Nothing was sent to Stripe. The message your end user can be shown is "Payments are not set up for this app yet."Your end user cannot fix it: show the message. Connect Stripe under Billing > Credentials
STRIPE_CATALOG_SYNCING409 or 400A checkout (a workspace's plan or a person's own) or a plan change reached a plan whose Stripe prices another run of the price sync is making at that moment, such as the sync that starts when Stripe is connected. 409 from a checkout, 400 from a plan change or its preview. Nothing was created or charged. The message your end user can be shown is "This plan's prices are still being set up. Try again in a moment."Show the message and let them try again: the prices are made within moments
IDEMPOTENCY_KEY_REUSED409A billing write (a checkout, a plan change, a cancel, a pause, a purchase or a portal link) sent an Idempotency-Key that this person already used for a different request, or the checkout that key opened has closed and the one fresh session it may make has closed too. Nothing new was created or charged. The same key sent again with the same request gets the first answer backSend a new key for a new action. Reuse a key only to retry the same action
PURCHASE_SETTLING409A recurring add-on purchase arrived while another purchase of the same add-on is paid and still being added to the subscription, usually for seconds. Nothing was charged. Carries reason: "purchase_settling", the earlier purchaseId, retryAfterSeconds and a Retry-After header. The earlier purchase sent again is not refused: it gets its first answer back (a retry or a new purchase)Send the same request again after retryAfterSeconds. To buy the same quantity twice in a row, send each purchase with its own Idempotency-Key
SUBSCRIPTION_CURRENCY_MISMATCH400A checkout, a plan change or its preview named a currency other than the one the workspace (or person) is already billed in: Stripe bills one customer in one currency. Nothing was createdLeave currency out, or send the currency the subscription is billed in
PLAN_CURRENCY_UNAVAILABLE400The plan has no price in the currency it would be billed in. That is the currency the workspace is locked to, else the currency asked for, else the first of the organization's billing currencies (stored in alphabetical order) that the plan is priced in, and a plan priced in none of them is refused too. BuildBase never picks a currency outside the organization's billing currenciesChoose a plan priced in that currency, or add a price in it to the plan version
FEATURE_NOT_IN_PLAN402Your app's own BuildBase plan does not include the capability the call needs, such as enterprise single sign-on. The body names it in feature. It is never about your end user's plan: a workspace's or person's plan refuses with PLAN_LIMIT_REACHEDYour end user cannot fix it. Show a neutral message and upgrade your BuildBase plan. The SDK refreshes its entitlements on this answer
SEAT_LIMIT_REACHED402 or 403402 with currentUserCount and limit: members plus pending invitations fill the workspace's seats, on an invitation or anything else that would take a seat. 403 with no counts: your app's BuildBase plan has reached its member ceiling for the workspaceOn a 402, free a seat or move the workspace to a plan with more. On a 403, the end user cannot fix it: show a neutral message, and raise your BuildBase plan
PLAN_LIMIT_REACHED402A workspace or a person has reached a plan limit, such as creating one more item than the plan allows. The body carries limit, current and limitSlug, so a screen can show a meterRemove one, or move to a plan with more. A limit you marked as an end-user boundary answers 403 CEILING_REACHED instead (below)
QUOTA_EXHAUSTED402Recording usage past a metered quota that allows no overage (no paying for extra use), or while the workspace is on a trial. Nothing is recorded. The body carries quotaSlug and resetsAt, when the allowance starts again. It was a 400 before this platform releaseBranch on err.status === 402: @buildbase/sdk 0.0.90 and earlier drop the body's code, and 1.0.0 keeps it. Offer an upgrade, or say when the quota resets. See Quotas
PLAN_REQUIRED402Your app requires a plan before a workspace is used (Require a plan under New workspaces), and this workspace has none. Answered when it records usage or spends credits; reading, members, settings and billing stay open. The body carries upgradeTarget: "workspace" and next, the routes that end it: the plans, selecting a free plan and starting a checkoutShow your plans, or let the SDK's plan picker do it. An agent can read next, choose a free plan itself, or hand a person the checkout link for a paid one
RETENTION_ALREADY_USED409Accepting a retention offer a second time: each subscription gets it onceShow the answer; carry on with the cancellation
RETENTION_OFFER_CHANGED400The retention offer changed after it was shownRead the offer again with getRetentionOffer() and show the new one
RETENTION_OFFER_UNAVAILABLE400No retention offer applies to this subscription nowCarry on with the cancellation
CANCEL_NOW_OFF403A customer asked to end their subscription now (POST .../subscription/cancel-now, a workspace's or a person's own), and the organization lets customers cancel only at the end of the period (Ending a subscription now). Nothing changedOffer the cancel at the end of the period instead: the subscription read's capabilities.cancelNow.enabled is false
INTERVAL_SWITCH_OFF403A plan change, its preview or a move of the workspace plan to the person named another billing interval than the subscription's own, and the organization turned off customers' interval switch (Switching interval). Nothing changedOffer plans on the current interval only: the subscription read's capabilities.intervalSwitch.enabled is false. A change that names no interval keeps the subscription's
NO_PLANS_AVAILABLE404The organization sells no plans yet: no pricing group has a published versionFrom @buildbase/sdk 1.0.0 this is not a failure: usePlanGroupVersions and usePlanGroup answer it with no plans and error: null, and Plan & Billing shows its empty state. SDK 0.0.90 reports it as a failed load, in error. Publish a pricing group version
PLAN_VERSION_NOT_FOUND400Selecting a free plan (select-free-plan, for a workspace or a person) named a planVersionId that does not exist, or that no pricing group offers to this workspace or person. The two answer the same on purpose, so a guessed id learns nothingPick a plan from the plans the catalog lists (usePlanGroupVersions)
LAPSE_HELD409Selecting a free plan (select-free-plan, for a workspace or a person) after Stripe ended the paid plan for failed payments, while the organization keeps the lapse policy in force and the workspace or person is held read-only or suspended. Nothing changedSubscribe to a plan again; the hold ends then, or when the organization's Move to Free after days have run
FUTURE_VERSIONS_NOT_INCLUDED409Opting a lifetime add-on out of later versions, or back in (POST .../billing/add-ons/:grantId/future-versions), when the purchase was not sold with "includes future versions". reason is future_versions_not_includedNothing to choose: the add-on keeps what it was sold
NOT_HELD409The same choice on a lifetime licence that is no longer held: refunded, disputed or revoked. reason is not_heldNothing to choose until it is held again, such as after a dispute is won
RETURN_URL_DEFAULTED200Not an error: a returnWarning on the answer of a checkout (a plan, a credit pack, an add-on, an upgrade or a card setup) sent with no successUrl, when no checkout return page is set and none of the organization's apps has a public https address, so the buyer returns to the old default instead of your app. Every checkout answer names where the buyer lands in landingUrlSend successUrl and cancelUrl, set the checkout return page (Settings, Organization, After checkout), or add your app's https address as a redirect URL of its app client
RETURN_URL_REQUIRED400The same checkout once the platform stops falling back to the old default. Nothing is createdThe same as for RETURN_URL_DEFAULTED
PAID_GRANTS_PRESENT409Deleting a workspace, or a person deleting their account, while it still holds what was paid for (unexpired one-time or lifetime add-ons, consumable units, credits) and the organization blocks such deletes (addOns.deleteWithGrants: 'block'). The body lists what is held; an account delete also carries reason: "paid_grants_present". Nothing was deletedUse, refund or let them expire first. Not a 402: nothing to buy

The credit codes are under Credits above. An email sender missing when an invitation is sent is NO_SENDER_CONFIGURED, under Server API keys.

Catalog editor validation

The catalog editor's checks for add-on offers, offer items and plan versions. Each is a 400, never a 402: none is about a plan's limits. The rules live in one shared validator that the server, the console's add-on editor and the blueprint all run, so the same offer gets the same answer wherever it is written. Codes are added, never renamed.

Add-on offers. Sent by the offer routes: create (POST /api/subscriptions/offers), edit (PATCH /api/subscriptions/offers/:id), version edit (PATCH /api/subscriptions/offers/:id/versions/:versionId) and publish (POST /api/subscriptions/offers/:id/publish and POST /api/subscriptions/offers/:id/versions/:versionId/publish). The answer keeps the human message and the problems list, and adds the first refusal's code and every refusal in refusals: [{ code, path, message }], where path is a JSON pointer into the offer body (such as /items/0/mode). Refusals about an item carry itemSlug, and price refusals carry currency (and interval). Nothing is saved or published.

CodeStatusWhen it happensWhat to do
OFFER_NO_ITEM400The offer grants no item, and it is not a seat class (an offer with autoQuantity, which may grant none)Add at least one item
OFFER_VALIDITY_REQUIRED400A one-time offer without validityDays as a whole number of days of at least 1Set validityDays to 1 or more
OFFER_VALIDITY_ONE_TIME_ONLY400validityDays was sent on a shape other than one-timeRemove validityDays, or make the offer one-time
OFFER_QUOTA_SHAPE400A quota item on a one-time or lifetime offer: a quota is granted only by a recurring or a consumable offerSell the quota as a recurring or consumable offer, or remove it
OFFER_CONSUMABLE_QUOTA_ONLY400A feature or limit item on a consumable offer, which carries quota items only. GRANT_CONSUMABLE_KIND is listed beside itRemove the item, or choose another shape
OFFER_QUOTA_FLOOR400A quota item granted with mode: "floor". GRANT_QUOTA_FLOOR is listed beside itGrant the quota with another mode
OFFER_CONSUMABLE_TERM_ONLY400consumeOrder or rolloverCapUnits on a shape other than consumableRemove the field, or make the offer consumable
OFFER_ROLLOVER_CAP_INVALID400A consumable offer's rolloverCapUnits is not a whole number of units, 0 or more. The route's request schema usually refuses this first, with a plain 400 and no codeSend a whole number, 0 or more
OFFER_FUTURE_VERSIONS_LIFETIME_ONLY400includesFutureVersions is true on a shape other than lifetime: it promises every later version to a licence that never endsTurn it off, or make the offer lifetime
OFFER_DURING_TRIAL_RECURRING_ONLY400duringTrial on a shape other than recurringRemove duringTrial, or make the offer recurring
OFFER_SEAT_CLASS_RECURRING_ONLY400A seat class (autoQuantity) on a shape other than recurringMake the offer recurring, or remove autoQuantity
OFFER_SEAT_CLASS_WORKSPACE_ONLY400A seat class on an offer sold to a person: it counts a workspace's members, and a person's plan has no seatsSell the seat class to workspaces, or remove autoQuantity
OFFER_SEAT_RULE_INVALID400The seat class's seatCountRule cannot be read: not an object, a role list that is not a list of role names, or a switch that is not true or falseFix the rule's shape
OFFER_SEAT_RULE_ROLE_CONFLICT400The seat count rule both includes and excludes the same roleKeep each role in one list only
OFFER_SEAT_RULE_NO_ROLE400The seat count rule's includeRoles names no role, so no member would take a seatName at least one role, or remove includeRoles to count every role
OFFER_PLAN_PAYER_MISMATCH400appliesToPlans names a plan that is not sold to the offer's payer type (workspace or person). Checked by the server onlyName plans sold to the same payer type as the offer
OFFER_ITEM_DUPLICATE400One item is granted twice by the same offerGrant each item once
OFFER_ITEM_NOT_DECLARED400No item with this slug and kind is declared in the payer's scope (workspace or person). Checked by the server onlyDeclare the item for that payer, or fix the slug or kind
OFFER_CURRENCY_UNSUPPORTED400A price is in a currency the platform does not bill inPrice the offer in a supported currency
OFFER_PRICE_ONE_TIME_INVALID400A one-time, lifetime or consumable offer has no one-time price that is a whole number of minor units above 0Send prices.oneTime as a whole number above 0
OFFER_PRICE_RECURRING_ONCE400A recurring offer was priced once (oneTime): it is priced per intervalPrice it monthly, quarterly or yearly
OFFER_PRICE_RECURRING_NO_INTERVAL400A recurring offer's price names no intervalAdd at least one interval price
OFFER_PRICE_INTERVAL_INVALID400A recurring interval price is not a whole number of minor units above 0. The route's request schema usually refuses this first, with a plain 400 and no codeSend each interval price as a whole number above 0
OFFER_PUBLISH_PRICE_MISSING400Publish: the organization bills in a currency the offer has no price inAdd a price in every billing currency, then publish
OFFER_PUBLISH_INTERVAL_MISSING400Publish: a published plan for the same payer type is sold on an interval that this recurring offer has no price for, in that currencyAdd a price on that interval, then publish
OFFER_PUBLISH_NO_PRICE400Publish: the organization names no billing currency, and the offer has no price in any currencyAdd a price in at least one currency
OFFER_PUBLISH_UNIT_BILLED400Publish: an item is the unit a published plan bills by, so a grant of it would not change what is billedRemove the item from the offer
OFFER_CONSOLE_GATE_OFF400Publish in BuildBase's own management tenant only: the gate for a slug the offer grants is off or in shadow, so the grant would change nothingNot sent for your app's offers
OFFER_CONSOLE_CENTRAL_GATE_UNCONFIRMED400Publish in BuildBase's own management tenant only: an offer of team-members, before central's gate is recorded as armedNot sent for your app's offers
OFFER_CONSOLE_STORAGE_PACK400Publish in BuildBase's own management tenant only: storage sold as a consumable pack that counts downNot sent for your app's offers
OFFER_CONSOLE_STORAGE_UNCOUNTED400Reserved; not sent now. Publish in BuildBase's own management tenant would send it if storage were sold before anything counted it, and storage is countedNot sent for your app's offers
OFFER_CONSOLE_PACK_NOT_ORG_USAGE400Publish in BuildBase's own management tenant only: a consumable pack of something other than a quota recorded through org usageNot sent for your app's offers

Offer items as grant rows. Every item of an offer is also checked as the grant row a purchase of one unit would write, and those refusals come back in the same offer answer with these codes and a path such as /items/0/quantityPerUnit. The console's add-on editor words them in its own terms. When the grant service itself refuses a row (an admin grant, a version move's grant), it answers 400 GRANT_INVALID with the sentences in problems, not these codes.

CodeStatusWhen it happensWhat to do
GRANT_ITEM_MISSING400An item row names no item. The offer routes' request schema refuses an empty slug first, so the console editor shows this one before a savePick the item for every row
GRANT_QUANTITY_INVALID400quantityPerUnit is not a whole number, or is below -1 (unlimited). The route's request schema usually refuses this first, with a plain 400 and no codeSend a whole number, or -1 for unlimited
GRANT_FEATURE_QUANTITY400A feature item with a quantity other than 1: a feature grant only turns the feature onSet the quantity to 1
GRANT_QUOTA_FLOOR400A quota item with mode: "floor". Listed beside OFFER_QUOTA_FLOORGrant the quota with another mode
GRANT_CONSUMABLE_KIND400A consumable offer grants an item that is not a quota. Listed beside OFFER_CONSUMABLE_QUOTA_ONLYGrant quota items only on a consumable offer
GRANT_REMAINING_INVALID400A consumable offer's units per purchase are not a whole number, 0 or more, such as -1Send a whole number of units
GRANT_CONSUMABLE_UNLIMITED400A consumable offer grants -1 (unlimited) units: a pack holds unitsSend a number of units
GRANT_WINDOW_INVALID400Reserved; not sent yet. The shared rule refuses a grant that ends before it starts, but no route answers with this code: an offer item has no dates, and the grant service answers GRANT_INVALIDNothing to handle yet

Plan versions and pricing groups. Sent when a plan version cannot be sold to the payer (workspace or person) of the group it is published in: publishing a plan version that already sits in a published group (POST /api/subscriptions/plans/:planId/versions/:id/publish), and publishing a pricing group version (POST /api/subscriptions/groups/:groupId/versions/:id/publish). The answer carries code, field, the item slug where there is one, and message. Nothing is published. Two related reasons keep their older codes: a sponsored grant naming no user-scope item is SCOPE_MISMATCH, and a plan already in a group of the other payer is SUBJECT_KIND_MISMATCH.

CodeStatusWhen it happensWhat to do
PLAN_SCOPE_GRANT_KIND_MISMATCH400A sponsored grant (ownerGrants or memberGrants) names a user-scope item as another kind than the item isUse the item's own kind in the grant
PLAN_SCOPE_MEMBER_QUOTA_PERSON400A quota counted per member on a plan sold to a person, who has no membersCount the quota on the person instead
PLAN_SCOPE_MEMBER_QUOTA_OVERAGE400A quota counted per member that bills overage: a per-member allowance is hardTurn overage off, or fall back to a shared pool
PLAN_SCOPE_MEMBER_QUOTA_POOL_UNSIZED400A per-member quota falls back to a shared pool with no sizeSet poolIncluded to 0 or more, or -1 for no limit
PLAN_SCOPE_INSTALLATION_WORKSPACE400Per-installation pricing on a plan sold to a workspace: installations belong to a personPrice per seat, or move the plan to a group sold to people
PLAN_SCOPE_SEAT_PERSON400Per-seat pricing on a plan sold to a person, who has no seatsTurn seat pricing off; per installation is the unit a person's plan takes
PLAN_SCOPE_CREDIT_GRANT_PERSON400A credit grant on a plan sold to a person: such plans cannot grant credits yetTurn the credit grant off, or sell the plan to workspaces

Catalog

The console's catalog routes (plans, plan versions, pricing group versions, add-on offers and credit packages) answer these when an edit would change what customers already bought, or take away a version or an offer that an open move or grant still names, when a version of an add-on offer or a credit package is drafted, published or deleted out of turn, when archiving a plan would break something live, and when a change would put an archived plan back on sale.

CodeStatusWhen it happensWhat to do
VERSION_REQUIRED409An edit to a published plan version, pricing group version or add-on offer would change what it sold: its items, limits, quotas, prices, grants, credit grant or trial; a group version's plans; an offer's items, shape, term, caps or trial answer. Also an edit to a credit package something holds (a published plan version grants it, an enabled auto top-up buys it, or it was bought or granted) that would change its credits, validity or a priced currency's amount (PATCH /api/subscriptions/credit-packages/:id, which answered CREDIT_PACKAGE_TERMS_LOCKED before package versions, and still carries field and termsLock), and an edit to a published version of a package (PATCH /api/subscriptions/credit-packages/:id/versions/:versionId). fields names them and newVersion is the call that makes a new version instead. A field sent with the value it already holds passes, and so does a currency a held package is not priced in yetMake a new version (newVersion: POST with baseVersionId, for a plan version, an add-on offer or a credit package), change it there and publish it
CATALOG_ITEM_SOLD409An edit to a subscription item, or to the workspace feature it maps to, while a published plan version, a published add-on offer or a held grant sells it, and the edit would change what holders bought: the item's slug, workspace feature, count rule, link, claim policy or end-user boundary, or archiving it; the feature's enabled, subscriptionManaged or defaultValue, or archiving it. fields names them and soldIn counts what sells it. A field sent with the value it already holds passesCreate a new item for the change and publish new plan versions with it
VERSION_MOVE_PENDING409Archiving a plan version, an add-on offer or an add-on offer's version that an open move still names: a version move of holders from or onto the version, a move of the offer's holders to its current prices or to a newer version, a grant to the version's or the offer's holders, or a lifetime offer's new version on its way to the licences that include future versions. Open is awaiting confirmation, queued or running, or cancelled with holders it had started still being settled. moveId and moveKind name the moveCancel the move or grant, or let it complete, then archive the version or offer
VERSION_MOVE_PREVIEW_STALE409Starting or confirming a version move, or publishing a plan version, an add-on offer version or a credit package version that starts one, whose preview no longer matches: a version, the plan's, offer's or package's version move setting or the move's terms changed since the preview the request names. Nothing was published or startedPreview again in the console and confirm what it shows
VERSION_MOVE_NOT_OPEN409Confirming a version move that is no longer awaiting confirmation, or cancelling one that is already completed or cancelled. moveState names where it standsReload the move; there is nothing left to confirm or cancel
CREDIT_PACKAGE_NOT_PUBLISHED409A version route of a credit package nothing holds yet (draft, edit, publish or delete a version): its version 1 is a draft, edited through the package itself, until a sale, a published plan version or an auto top-up holds its termsEdit the package (PATCH /api/subscriptions/credit-packages/:id)
DRAFT_EXISTS409A second draft version of a credit package or an add-on offer while one is open. draftVersionId names itEdit, publish or delete that draft first
VERSION_REPLACED409A publish of a version of a credit package or an add-on offer that a later version replaced: what bought it keeps it, and it is never put back on saleDraft a new version from it (newVersion) and publish that
VERSION_PUBLISHED409A delete of a published version of a credit package, current or replaced: what bought it or was granted it holds it, so it is kept. Only a draft is deletedLeave it; to stop selling the package, switch it off (Active off)
CREDIT_PACKAGE_CHANGED409A credit package edit, or a version's edit, publish or delete, lost a race to another request (another version was made current, or the draft was published meanwhile). Nothing of it was kept; a Stripe price minted for a publish is reused by the next oneRead the package again and retry
PLAN_ON_SALE409Archiving a plan (PATCH /api/subscriptions/plans/:id with archived: true, or DELETE) while the current published version of a pricing group that is not archived lists one of its versions: the pricing page would offer a plan nobody can buy. groups names each group and its versionPublish a new version of the group without the plan, then archive it. Its subscribers keep it either way
PLAN_IS_DEFAULT_FREE409Archiving a plan whose version is the free plan new workspaces start on and fall back to when a paid plan ends (the organization's freemium workspace onboarding default). planVersionId names itChoose another default plan, then archive it
PLAN_IS_ONBOARDING_TRIAL409Archiving the plan new workspaces start a no-card trial of (the organization's workspace onboarding setting, in trial mode)Choose another trial plan, or another mode, then archive it
PLAN_ARCHIVED409Something would put an archived plan back in front of new customers: publishing a pricing group version that lists a version of it, unarchiving a pricing group whose current version lists one, or setting a version of it as the freemium workspace onboarding default (PATCH /api/organizations/settings/config, with path). plans names each one. Nothing was changedUnarchive the plan, or take its version out of the group (publish a group version without it), or choose another free plan

Billing versioning switches

Each part of versioned billing can be turned off for one organization in the console (the Billing versioning card in Settings > General, see Billing versioning switches). While one is off, the console's catalog routes answer these, with phase naming the switch. Nothing was started, published or changed; turn the switch back on and the same request goes through.

CodeStatusWhen it happensWhat to do
VERSIONING_MOVES_OFF409Version moves are off: previewing, starting or confirming a move (a plan's, an add-on's price or versions, a credit package's, a grant to holders, a lifetime add-on's new version), a console publish that asks to start one, or retrying a holder a running move waits on. Reading moves, cancelling one and leaving a holder where they are still workPublish without moving customers, or turn version moves back on; held moves then carry on
VERSIONING_OFFERS_OFF409Add-on and credit package versions are off: publishing a new version of an add-on offer or a credit package, or a lifetime add-on that includes future versions. Drafts stay editable, publishing the current version again still works, and what customers hold keeps workingKeep the draft, or turn add-on and credit package versions back on and publish it

Add-on upgrades

The quote and the purchase of an add-on upgrade (GET and POST /api/v1/public/workspaces/:workspaceId/billing/add-ons/:grantId/upgrade, and /api/v1/public/me/billing/add-ons/:grantId/upgrade for a person) answer these. Nothing is charged or written when one comes back. None is a plan refusal, and none is a 402.

CodeStatusWhen it happensWhat to do
ADDON_UPGRADE_GRANT_NOT_FOUND404No grant with that id is held by this workspace or personRead the held rows again (useWorkspaceAddOns) and send one of theirs
ADDON_UPGRADE_ALREADY_CURRENT409The holder already holds the version on sale. Asked again, it answers the sameNothing to do: hide the upgrade
ADDON_UPGRADE_NOT_ELIGIBLE409The grant cannot be upgraded. reason says why: shape_not_upgradable (a pack or a recurring add-on), not_a_purchase (an operator's or a plan's grant), not_active (refunded, taken back or ended), not_on_sale (the add-on is archived or off sale), term_ended (a pass whose new term, counted from when it started, is already over), quantity_invalid (the new version sells fewer units at once than are held), currency_unpriced (no price in the currency the holder pays in), outside_applies_to_plansShow the message; the holder keeps what they hold
ADDON_UPGRADE_PENDING409A payment is still settling: the purchase's own, or an upgrade of it already paid and not yet appliedWait for the payment to land, then read the add-ons again
ADDON_UPGRADE_INCLUDED409A lifetime licence sold with "includes future versions": every later version reaches it at no charge, so it is never upgraded by paying. A holder who opted out gets this too, with optedOut: true: opting back in brings the licence to the current version for nothing. Asked again, it answers the sameHide the upgrade. To take the current version, opt back in
IDEMPOTENCY_KEY_REUSED409The purchase's requestId was used before for a different upgrade, or its earlier session expired twiceSend a new requestId

Subscription state

A plan change, cancel, pause, resume, add-on change or other subscription operation that the subscription's current state does not allow answers 400 with the message and one of these codes, from a workspace's subscription routes and a person's own (/me/subscription). Moving a workspace's plan to a person (move-to-user) answers 409 instead, with SUBSCRIPTION_PAUSED when the subscription is paused. The code names the state, so branch on it rather than on the words: the remedy is the state's.

CodeWhen it happensWhat to do
NO_SUBSCRIPTIONThere is no subscription to changeStart a checkout for a plan
SUBSCRIPTION_ACTIVEThe subscription is active and the operation needs another state (a resume, say)Nothing to do; the subscription is already running
SUBSCRIPTION_CANCELINGThe subscription is set to cancel at the end of its periodReactivate it, then retry
SUBSCRIPTION_TRIALINGThe subscription is in its trial and the operation waits for it to endRetry after the trial converts
SUBSCRIPTION_PAST_DUEAn invoice is unpaid, including while Stripe retries itPay the open invoice or update the card, then retry
SUBSCRIPTION_PAUSEDThe subscription is paused, or a pause is scheduledResume it, then retry
SUBSCRIPTION_INCOMPLETEThe first payment has not completedFinish the payment, or start the checkout again
SUBSCRIPTION_SUSPENDEDPayment retries ran out on an unpaid invoice and access is suspendedPay the open invoice or update the card

An upcoming invoice with nothing to show is not an error: it answers kind: 'none' with a reason of cancels_at_period_end, no_subscription or trial_needs_payment_method (a trial started without a card ends with no invoice, and converts only if a payment method is added before it ends). See the upcoming invoice.

In-app card payment

Saving a card and paying an open invoice inside your app (POST .../billing/payment-method/setup, POST .../billing/payment-method/default with setupIntentId, and POST .../subscription/invoices/:invoiceId/pay, for a workspace and for a person under /me) answer these. See Billing. None is a 402.

CodeStatusWhen it happensWhat to do
PAYMENT_METHOD_PAID_BY_ANOTHER409Another account pays for this plan, so its card is not changed hereChange the card from the paying account's billing
SETUP_INTENT_NOT_FOUND404The setupIntentId is not this workspace's or person's, was not made in the app, or is goneStart the card setup again
SETUP_INTENT_NOT_SUCCEEDED409The card was not confirmed: 3-D Secure left half way, or a decline. Carries setupIntentStatusAdd the card again, or use another card
INVOICE_NOT_FOUND404The invoice is not one of this subject's own subscriptionRead the invoices again and pay one of those
INVOICE_NOT_OPEN409The invoice is voided or a draft, so there is nothing to pay. Carries invoiceStatus. A paid one answers paid: true insteadNothing to pay
PENDING_CHANGE_EXPIRED409The plan change this invoice pays for expired before it was paid. Carries pendingUpdateExpiresAtStart the change again
PAYMENT_METHOD_NOT_FOUND404The paymentMethodId is not a card on the invoice's customerAdd the card again, or pay with the default card
CARD_DECLINED400Stripe declined the card. Carries paymentError: true and declineCode when Stripe gave oneAsk for another card

Workspace members

Removing a member, or leaving, is DELETE /api/v1/public/workspaces/:workspaceId/users/:userId (removeUser). Any member may leave with their own id; see Leaving a workspace.

Changing a member's role is PATCH /api/v1/public/workspaces/:workspaceId/users/:userId (updateUser). The owner's role is not changed through it; see Required permissions.

CodeStatusWhen it happensWhat to do
WORKSPACE_OWNER_CANNOT_LEAVE409The workspace's owner, the person who created it, tried to leave. Ownership cannot be handed to another memberDelete the workspace instead
WORKSPACE_OWNER_ROLE_FIXED409Someone, the owner included, tried to change the role of the workspace's owner. The owner holds every permission whatever their role saysChange another member's role instead
PAYER_STILL_PAYS409The person leaving or being removed pays for the workspace's subscription with their own card. See PayersMove billing first, or cancel the subscription

Workspace features

A workspace changes its own features with PATCH /api/v1/public/workspaces/:workspaceId/features (updateFeature). Only a user-managed feature is the workspace's to change; see Feature flags.

CodeStatusWhen it happensWhat to do
FEATURE_NOT_USER_MANAGED403Every feature the request names follows the plan or is set by the app's team, listed in features. Beside ones it can change, they are skipped and named in ignoredFeaturesHide the toggle for those features; change them in the console or the plan instead

Workspace mode

Changing the organization's workspace mode (PATCH /api/organizations/settings/workspace-mode; see Workspace settings) can be refused because of the organization's own data. A refusal that is the plan's is a 402 from Billing and checkout.

CodeStatusWhen it happensWhat to do
PERSONAL_MODE_OWNERS_OVER_LIMIT409Switching to Personal mode, one workspace per person, while someone owns more than one. Carries ownersOverLimit and owners (the first few, with their workspaces)Move or delete the extra workspaces, then switch

Payers

When someone else pays for a workspace, the checkout and transfer-payer are checked before anything reaches Stripe, and a member who pays cannot leave or be removed until billing moves. A refusal carries one of these codes. None is a plan refusal, and none is a 402.

CodeStatusWhen it happensWhat to do
PAYER_NOT_ALLOWED403The caller may not spend the payer's money: a person pays only as themselves, and a workspace pays only for someone holding its billing-manage permissionPay as the signed-in person, or as a workspace they manage billing for
PAYER_NOT_FOUND404The payer names no workspace or person in the organizationCheck the payer's type and id
PAYER_SUBJECT_KIND400A person's own plan named another payer. Only a workspace is paid for by someone elseDrop payer from a person's checkout
PAYER_IS_PAID_FOR409The payer is a workspace someone else pays for. One level onlyChoose a payer that pays for itself
SUBJECT_IS_PAYER409The workspace pays for others, so it cannot be paid forLet it pay for itself
PAYER_CHILD_LIMIT409The payer already pays for maxChildren workspacesChoose another payer, or raise maxChildren (PATCH /api/organizations/settings/payers)
PAYER_CURRENCY_MISMATCH409The payer is billed in another currency: a Stripe customer holds oneChoose a payer billed in the plan's currency
PAYER_METERED_OVERLAP409Another plan this payer pays for already bills overage on the same quotaChoose another payer, or a plan without that overage
NO_PAID_SUBSCRIPTION409transfer-payer on a subscription with no Stripe subscription to moveNothing to move; check out with the new payer instead
SAME_PAYER409transfer-payer to the payer that already paysNothing to do
TRANSFER_NOT_POSSIBLE409transfer-payer while the subscription is trialing, paused, past due, renews within the hour, or holds recurring add-onsTry again after the trial or renewal, or once the add-ons are removed
PAYER_STILL_PAYS409Removing a workspace member, or a member leaving, while their own card pays for the workspace's live subscription. Carries workspaceId and subscriptionIdMove billing to another member or back to the workspace with transfer-payer, or cancel the subscription, then try again

A plan sold to the other kind of payer (a personal plan on a workspace checkout, or the reverse) is refused with 400 SUBJECT_KIND_MISMATCH. Two more codes are about who a plan is for:

CodeStatusWhen it happensWhat to do
SCOPE_MISMATCH400Publishing a plan version or pricing group version with a sponsored grant that names no user-scope item. An item declared for the other payer answers it too, as a warning in the publish's warnings until the platform turns strict publish on, then as a 400 with mismatchesGrant only user-scope items, and sell each item to the payer it is declared for
SELF_CHECKOUT_ONLY400A checkout link from the console or the admin checkout route (POST .../create-session) for a person, or a comp from nothing for a person with no paid subscriptionA person checks out only as themselves, from their own billing (/me/subscription/checkout)

Server API keys

Calls your backend makes with an organization API key (the server SDK, /api/v1/server) refuse with BuildBaseApiError, which carries the HTTP status and the server's code.

CodeStatusWhen it happensWhat to do
API_KEY_REQUIRED403The route was called with a session token instead of an organization API keyCall it from your backend with an API key
API_KEYS_SUSPENDED403BuildBase has suspended the organization's API keys: every request made with one is refusedContact support to have them restored
SENDING_SUSPENDED403BuildBase has suspended the organization's sending: a send is refused and nothing is queuedContact support to have it restored
NO_SENDER_CONFIGURED409The organization has no working email sender. An end user meets the same code as a 503 when a workspace invitation, a sign-in code or a magic link needs oneConnect a sender in the console under Messaging, Sender accounts
SENDER_NOT_USABLE409 or 503The send names a sender whose account is inactive or archived. 503 where an end user's flow needs the mail, 409 for the organization's own sendsTurn the sender back on, or name another
SENDER_VERIFICATION_FAILED400Saving an SMTP or SES sender, editing its SMTP settings, or a sender's test email, and the provider refused the credentials or the send. A test also carries stageFix the credentials the message points at, then save or test again
IDEMPOTENCY_KEY_REUSED422The Idempotency-Key was used before with a different requestUse a new key for a new email
IDEMPOTENCY_IN_PROGRESS409A request with this Idempotency-Key is still being processedRetry shortly with the same key

The send-specific codes (RECIPIENT_SUPPRESSED, SEND_LIMIT_REACHED, UNKNOWN_REFERENCE) are on Sending email.

The commerce writes (a refund, a part's charge, a subscription's cancel, resume or change, a booking's cancel, a shipment, a return, an affiliate or a grant action) answer the same two codes for an Idempotency-Key, on the server API, the SDK's seller routes and the console: 422 IDEMPOTENCY_KEY_REUSED when the key was used on that route with another body or another order, and 409 IDEMPOTENCY_IN_PROGRESS while the first request runs. The same key with the same request after it finished gets the first answer back, with Idempotent-Replayed: true (retrying a write safely).

Admin routes

The admin routes change what your organization sells or how it is set up: plans, pricing groups, items, item categories, add-ons and credit packages with their versions and publishing (/api/subscriptions/{plans,groups,items,item-categories,offers,credit-packages}), coupons and promotion codes (/api/organizations/payment/stripe/coupons), the Stripe keys (/api/organizations/payment/stripe/credentials), the organization's settings (/api/organizations/settings, PATCH /api/storage/settings), blueprints (/api/blueprint) and environments (a development or staging environment's kit and client secret, its export, and promotion between environments: /api/environments). They take a console session or an admin key: an API key issued as an admin key, with the owner or admin role (see key types).

CodeStatusWhen it happensWhat to do
ADMIN_SCOPE_REQUIRED403An admin route was called with an app-server key (whatever its role), with a key issued as an admin key whose role is no longer owner or admin, or with your app user's credential (the SDK's sign-in token or its session). Also when a key that is not an admin key tries to issue oneChange the catalog and settings from the console, or with an admin key. Your app's backend keeps an app-server key
CONSOLE_SESSION_REQUIRED403A route that moves customers between versions of the catalog (a move's preview, start, confirmation or cancel, or a publish that asks to start or skip one) was called with an API key. Only a person signed in to the console can do these; no key of either type can. Reading a plan's moves takes an admin key tooPreview and confirm the move in the console

Neither is a 401, so the SDK does not sign your user out. The public reads your app uses stay open to everyone: the plans list (GET /api/v1/public/:orgId/plans/:groupSlug) and promotion codes (GET /api/v1/public/:orgId/promotions/:code).

What changed. Before, these routes were held only by the key's role, so:

  • an app-server key (and a key issued before key types existed whose role is not owner or admin) that had been given a role with catalog, coupon, Stripe-key, settings or blueprint permissions could use them; it now gets 403 ADMIN_SCOPE_REQUIRED on every admin route, reads included;
  • your app user's sign-in token or SDK session got 401 on these routes; it now gets 403 ADMIN_SCOPE_REQUIRED. On every other console route it still gets 401.

A console session, and an owner or admin key issued before key types existed, are unchanged: they read as admin keys, so a blueprint run with your existing key keeps working.

Console sessions and organization access

These are about a person signed in to the BuildBase console, not your app's users: opening an organization (switch-org), the console's own sign-in and its two-step settings, and the console API behind them. A refusal of switch-org is a 200 with success: false and the code.

CodeStatusWhen it happensWhat to do
NO_ACTIVE_PLAN200 or 402The organization has no active plan or trial: 200 from switch-org, 402 from the console API. The console shows its paywallChoose a plan for the organization
SELF_HOSTING_LAPSED200 or 402A self-hosted organization whose owner's self-hosting plan lapsed past its grace. Carries upgradeTarget: "user"Renew the person's own plan under My billing in the account menu
NO_INSTALLATION200 or 409A self-hosted organization that is not attached to an installation: 200 from switch-org, 409 from completing its setupAttach it to an installation under Installations in the account menu
INSTALLATION_OUTDATED200switch-org into a self-hosted organization whose installation runs a tenant image older than the minimum, or reported no version. Carries minVersionPull the newer image, restart, then open the organization again
TWO_STEP_REQUIRED200switch-org into an organization that requires two-step sign-in, by someone with no authenticator appSet up an authenticator app; the console sends the person there
TWO_STEP_REQUIRED_BY_ORG403Turning two-step sign-in off while an organization the person belongs to requires it. Carries orgsLeave that organization, or ask an owner to change the setting
TWO_STEP_SET_UP_FIRST403Requiring two-step sign-in for an organization, by someone who has not set it up for their own accountSet it up on your own account first
TWO_STEP_LOCKED429 or 400Too many wrong codes on the account: 429 once locked, 400 on the wrong code that locks itWait up to 15 minutes and try again
TWO_STEP_CHALLENGE_EXPIRED400The sign-in waiting for a code expired, was used up, or ended after too many wrong codesSign in again
SESSION_ENDED401The console sign-in was ended (from the Security page, or by support), an organization now requires two-step and this sign-in has none, or a refresh is no longer admittedSign in again; the console signs out
SESSION_EXPIRED401A console token that no longer verifies: expired, or a bad signature. A request with no token, and a permission refusal, stay bare 401sSign in again; the console signs out
READ_ONLY_SESSION403A write, or a billing session, in a read-only support session (staff impersonation). Not your app's read_only_session under Account and securityNothing to retry in that session

AI agent sessions

An AI agent connected to the console acts as the member who connected it. The console API refuses its session with these, all 403, on every request it makes, so a change of setting takes effect at once.

CodeStatusWhen it happensWhat to do
AGENT_READ_ONLY403A write from an agent whose grant has no console:write scope, or while the organization lets agents only readReconnect the agent with console:write, or an owner or admin allows agents to make changes
AGENTS_OFF403The organization's AI agents setting is offAn owner or admin turns agents on in the console under Security (card AI agents)
AGENT_PERSON_ONLY403A route only a person may call: API keys, sign-in settings, payment and mail provider credentials, organization settings, or a blueprint's environment valuesA person does it in the console
AGENT_BLOCKED403An owner or admin blocked this member's agent in the organizationAn owner or admin removes the block

Account and security

The calls behind the Profile and Security screens (WorkspaceApi) keep the server's sentence as the message and carry its reason as err.code. Two of them can come from any change the user makes:

CodeWhen it happensWhat to do
reauth_requiredA 403: the change needs a sign-in from the last 10 minutes, and this session is olderisReauthRequired(err), then useSaaSAuth().requireReverification({ factors: err.factors }). See Confirm it's you
read_only_sessionA 403: an app owner is signed in as the user, read-onlyisReadOnlySession(err). Show the message; retrying cannot succeed
impersonation_sign_in_lockedA 403: an app owner is signed in as the user and tried to change how the person signs in (email, phone, username, password, second step, passkeys, linked accounts)Show the message; it applies to every sign-in-as session, read-only or not

Neither signs the user out. The rest are listed with their feature: Two-step sign-in, Phone sign-in, Connected Accounts, Usernames, Guest users and Deleting accounts.

From SDK 1.0.0, two codes come from the SDK itself when a page loads with a sign-in link in its address. onError receives an SDKError with the code; nothing is exchanged and whoever was signed in stays signed in.

CodeWhen it happensWhat to do
OAUTH_STATE_INVALIDA ?code= whose state is missing, was not issued by this browser's signIn(), or was already used. The code is removed from the addressStart sign-in again with signIn(). A sign-in link someone else sent is the usual cause; a link you build yourself needs the state from signIn()
IMPERSONATION_TICKET_INVALIDA ?bb_impersonation= ticket from the console's Sign in as user that expired (it lives 60 seconds), was already used or is for another appStart it again from the console

Device limit at sign-in

A sign-in call (password, code, magic link, passkey, phone or wallet) can answer 200 with success: false and this code instead of a token, when a device limit is linked to sign-in (claims).

CodeStatusWhen it happensWhat to do
DEVICE_LIMIT_REACHED200The person is signed in on as many devices as their limit allows, and the limit is set to refuse when full. Carries limitSlug, limit and currentShow the message; they sign out of another device, then sign in

Enterprise single sign-on

A refused call on bb.enterprise or an enterprise hook (from SDK 1.0.0) throws with the server's code, its HTTP status, and, when one input is at fault, the field to point at. The message is written for the company's admin and can be shown as it is. See Enterprise SSO.

CodeStatusWhen it happensWhat to do
ip_not_allowed403The request came from outside the company's IP allowlist. The session is keptShow useAccessRefused()'s sentence; the person works again from an allowed address
tenant_restricted403The network's proxy names companies of your app in allowed-company-ids, and this account is not one of theirs: a personal account, or another company's. At sign-in the reason is the same. The session is keptShow useAccessRefused()'s sentence; the person signs in with their work account, or works again off that network
tenant_header_invalid400The network's proxy sent allowed-company-ids twice, and one names a company of your app. The session is keptShow useAccessRefused()'s sentence: the company's IT team sets its proxy to replace the header, not add a copy
workspace_access_refused403A request in one of a company's workspaces that holds its people to stricter rules, and this session does not meet them there. Carries reason (app_team_session, app_not_allowed, ip_not_allowed, sso_required, sign_in_method, max_age or idle), workspaceId, message, reverifiable and methods. The session is kept, and works in the company's other workspacesuseWorkspaceAccess(workspaceId): when reverifiable, confirm() gets back in with one of methods; otherwise signInAgain(), or show the message (stricter rules for one workspace)
session_ended401The company's access policy ended the session. Carries reason (enterprise_idle, enterprise_max_age, enterprise_signout or enterprise_session_ended), minutes for a length, and message. The SDK signs out as for any 401Show useSessionEnded()'s sentence (when a company ends a session)
app_team_sessions_refused403The token exchange named one of a company's people, and the company does not let your team sign in as its people. The message names the companyAsk the company's admins to allow it in their access policy; nothing was minted
user_blocked403The token exchange named a blocked userUnblock the user in the console if that was a mistake
app_team_self_change403A change to whether your team may sign in as the company's people, saved from inside a session your team opened as one of them. The company's own admins decide it. A server that asks admins to confirm it's them refuses such a session with reauth_required firstChange it from your console, or ask the company's admins
reauth_required403The change needs a proof from the last 10 minutes, one of the ways in methods (sso, passkey): a sign-in that proved one of them, or a confirmation with one of them. A password or ordinary sign-in never counts. Carries maxAgeSeconds, methods and reverifiable. The session is kept, and reason carries the same value This is a company's settings; a person's own change answers the same code with factors instead, see Account and securityisReauthRequired(err): when reverifiable, call requireReverification() and try again; otherwise show the message (confirming it's you)
reverify_unavailable400Starting a confirmation from a session nobody signed in to (the token exchange, your team's session as one of a company's people, an agent's), or with methods that leave none of the ways that count for the personOffer to sign out and sign in again
invalid_return_url400A confirmation's returnUrl is not on the origin of one of the auth client's redirect URLsReturn to a page on your app's registered origin
invalid_request400Starting a confirmation without a codeChallenge, or with one that is not an S256 challenge (base64url, 43 to 128 characters): "This app's request to confirm it's you is incomplete. Reload the page and try again."Send the S256 of a code verifier you keep in the browser; requireReverification() does
invalid_reverify_code400Completing a confirmation with a code that is unknown, used, expired (after 5 minutes) or another session's, or a verifier that does not match: "That confirmation has expired or was already used. Confirm it's you again."Confirm again from the same browser
not_a_person404Signing out, reading or ending the sessions of, or resetting the passkeys of, someone who is not one of the company's peoplePick someone from the company's people
last_passkey_required409Removing the last passkey of someone whose company asks for passkeys: "Your company asks you to sign in with a passkey. Add another before you remove this one."Show the message; they add another passkey first
passkey_change_in_progress409Removing a passkey while another change to the same person's passkeys is being made: "Another change to your passkeys is in progress. Try again in a moment." Nothing was removedTry again
sign_in_method_not_offered409A company's sign-in methods name a way your app's sign-in does not offerTurn the method on for an auth client, or leave it off the list
session_not_found404Ending a session that is not one of that person's live sessions, or has already endedRead the person's sessions again
managed_by_app403Your team keeps the company's security settings, so its admin may read them but not change themNothing in the app; the change is yours to make in the console
would_lock_you_out409An IP allowlist saved from the app leaves out the address it was saved from (carries yourIp), or, with reason: "sign_in_method", sign-in methods that leave out the way the admin signed in: either the list includes Passkey and they have none ("Add a passkey first, or keep Password on the list."), or the list leaves Passkey out ("Sign in a way it allows first, or keep Password on the list."). From the app, a workspace's rules saved through that workspace that the admin's own session would not meet: reason: "workspace_policy", with the refusalOffer to add yourIp, as the SDK's screen does; for sign-in methods, add a passkey first, or sign in a way the list allows, or keep their way on the list
not_enterprise_people422A break-glass address is not one of the company's people. Carries emailsThey sign in through SSO (or are provisioned) first
invalid_policy400A session length or allowlist entry out of rangeShow the message next to the form
invalid_workspace_policy400A workspace's rules out of bounds, or none at all: "Choose at least one rule. To go back to the company's policy, remove these rules."Fix the value, or remove the workspace's rules
workspace_policy_not_stricter422A workspace's rule looser than the company's own. Carries fields: each rule with the company's value, the one asked and the sentenceChoose a value as strict as the company's or stricter
sso_not_usable409Requiring single sign-on in a workspace while it does not work for the companyFinish the company's single sign-on setup first
workspace_policies_full409Rules for 20 of the company's workspaces alreadyRemove another workspace's rules first
workspace_policy_changed409expectedUpdatedAt is not the workspace rules' updatedAt: someone saved sinceRead them again and save again
workspace_not_bound404The workspace is not one of the company's bound workspaces; the answer never says whose it isChoose one of the company's workspaces
workspace_policy_not_found404No stricter rules for that workspaceNothing to read or remove
binding_has_workspace_policy409Your console unbinding a workspace with stricter rules without removeWorkspacePolicies: trueConfirm: the binding and its rules go together
log_stream_limit409The company already has three log streamsRemove one first
invalid_log_stream400One input refused; field names it. Moving a Splunk stream, or an HTTPS stream with a header, asks for the token or header againPoint at field
nothing_to_renew409A certificate renewal link while no certificate is expiring or expiredNothing to renew; the warning has cleared
not_configured409A read of something WorkOS holds, such as the company's IT and security contacts, before your WorkOS key is saved. In the app's status it is itContacts.error, and the rest of the status still answersSave your WorkOS client ID and key on the console's Enterprise tab
rate_limited429WorkOS is rate limiting your WorkOS key while the server reads it, for example the IT and security contacts. Comes with Retry-After: 60; in the app's status it is itContacts.errorTry again in a minute
invitation_active409Inviting a company's IT admin while WorkOS still holds an open invitation for the company, without Withdraw it and resend, or when WorkOS kept it open whichever contact's invitation was withdrawn (console only)Choose Withdraw it and resend; if it stays open, the IT admin uses the email they already have
invalid_days400Insights for a window other than 7, 30 or 90 daysAsk for one of the three
invalid_mapping422A role mapping saved on the console route refused: an unknown role, or the owner rolePick another role
not_company_admin403The company has named its admins and this member holds no company roleShow the message; one of the company's admins makes the change
company_role_required403The member's company role does not reach this. Carries area and levelShow the message; someone who manages Company roles gives them a broader one
unknown_role422Naming someone with a company role the company does not havePick a role from GET /roles
preset_role409Changing or deleting Company admin, Security admin or AuditorMake a role of the company's own instead
too_many_roles422A custom company role past the limit of 20Delete one first
too_many_groups422A company group past the limit of 50Delete one first
group_cycle409Putting a group inside one it already includes, at any depth. Carries path, the groups outer to innerShow the message; take the other group out first (groups inside groups)
group_too_deep422Putting groups inside groups more than 3 deep, counting both ends. Carries chainShow the message; include the inner group in a group higher up instead
group_change_in_progress409Another change to the company's groups was being saved at the same momentTry again in a moment
group_manager_limit403A group's manager tried what managers may not. reason is company_role (the group gives a company role, itself or through a group that includes it), self or manager (adding or removing themselves, or another of its managers)Show the message; someone who manages the company's groups makes the change (group managers)
too_many_managers422Naming an eleventh manager of a groupRemove one first
managed_by_idp409Removing a company admin the identity provider made through a role mappingChange the mapping or the person's groups
role_in_use409Unpublishing or deleting a company role or group, or turning role assignment in WorkOS off, while the company's IT admin still has groups assigned to it in WorkOS. Carries roles, the names WorkOS kept; turning it off names every oneShow the message: the IT admin removes those groups in the Admin Portal (Assign roles in WorkOS), then try again
workos_roles_off409Publishing a role or group to WorkOS while your team has role assignment in WorkOS off for the companyTurn on Let the IT admin assign roles in WorkOS for the company in the console
company_admin_console_only403Publishing or unpublishing Company admin from the app or the company APIYour team does it from the console
role_slug_taken409WorkOS already holds a role under the slug BuildBase would publish. Carries slug, and heldBy when another of the company's own roles or groups holds itIn the console, Use the role WorkOS has; from the app or the company API, ask your team to confirm it there
too_many_admins422Naming a company admin past the limit of 20Remove one first
not_connected_apps422An approved app in the connected apps policy is not a third-party app or agent. Carries clientIdsApprove only agent clients; your own sign-in is never limited
app_not_allowed403The person's company does not allow this app or agent, at the consent stepThe hosted consent page shows the sentence and a way back
admins_required422A personal company API key while the company has named no adminsName the company admins first, or make the key for a service account
too_many_keys422A company API key past the limit of 50 working keysRevoke one first
name_taken409A service account, company role or group with a name the company already usesPick another name
too_many_service_accounts422A service account past the limit of 20Delete one first
invalid_key401The company API without a working company API key: none, malformed, unknown or alteredSend Authorization: Bearer bbck_...
key_revoked401A company API key revoked by hand, or whose owner holds no company role, or whose service account was deletedAsk a company admin for a new key
key_expired401A company API key past its expiryAsk a company admin for a new key
company_unavailable403A company API key whose company has single sign-on off, or was deactivated or deletedNothing to retry
scope_required403A company API call the key's scopes, or its owner's company roles, do not cover. Carries scopeMake a key with that scope, or give its owner a role that reaches it
already_decided409Approving or declining a request to join that someone already decidedReload the requests
outsiders_blocked403Inviting or adding someone outside the company to one of its workspaces, while its policy blocks people outside itShow the message; the company's admins decide who is outside it
outsider_role_limit403Inviting, adding or changing the role of someone outside the company above its cap. Carries maxRoleOffer maxRole or lower
outside_company403Someone outside the company using one of its workspaces while its policy blocks people outside it. The membership is keptShow the message; the workspace has left their list
audit_logs_off409A WorkOS export, the WorkOS log stream, or an audit_logs setup link while your org has company audit logs offTurn them on in the console's Enterprise tab, or use the CSV and BuildBase's streams
export_window422A WorkOS export longer than 31 days, or starting before the last three months or what WorkOS keeps. Carries earliestAsk from earliest, at most 31 days at a time, or download the CSV
export_empty422A WorkOS export of a range WorkOS holds no entries inPick another range; WorkOS holds only what was sent since the switch went on
retention_cannot_shrink422A WorkOS retention shorter than the one the company's log already has (console only)Keep it, or raise it: WorkOS does not lower a retention
sso_routing_invalid400Which identity provider signs in each domain was not saved. detail says why: unknown_connection, unverified_domain, too_many_for_domain, duplicate_domain, label_invalid, label_taken or default_required, and message says it in wordsShow message next to the form
sso_routing_conflict409Someone saved the routing since its version was read: "Someone changed this a moment ago. Look again before you save."Read it again, then save
use_workos_log_streams409Adding a BuildBase log stream while company audit logs are onSet the stream up in WorkOS, from the console; existing streams keep working
app_team_only403A setup link for log_streams from the app: WorkOS log streams are billed to your WorkOS account, so your team sets them upSet it up from the console, or invite the company's IT admin from there
agent_access_off409Saving the company's identity provider for agents, or turning it back on, while your team has not turned on enterprise-managed authorization (or the plan lacks agent readiness)Turn it on under User management > Access > Authentication > Agent readiness; the company's admin asks you
agent_issuer_invalid400The company's identity provider was not saved. detail says why: not_https, shared_issuer, discovery_unreachable, issuer_mismatch, no_signing_keys or jwks_unreachableShow the message beside the issuer field; for issuer_mismatch it names the issuer to paste
agent_issuer_taken409Another company in your app already trusts that identity provider (and tenant) for agents. The message never names itYour team checks which company holds it in the console
agent_issuer_not_found404Turning off, changing, checking or removing agents through the identity provider while the company trusts noneRead the company's agent access again
workload_identity_off409Saving a workload credential, turning one back on or widening one, while your team has not turned on workload identity for service accountsTurn it on in the console's WorkOS provider card; the company's admin asks you
workload_credential_invalid400The workload credential was not saved. detail says why: not_https, shared_issuer, use_preset, discovery_unreachable, issuer_mismatch, jwks_unreachable, no_signing_keys, matches_everything, pin_required, wildcard_not_allowed, foreign_audience, bad_condition or scope_beyond_you, and claim names the pin where one doesShow the message beside the field claim names
workload_name_taken409The service account already has a workload credential by that nameChoose another name
too_many_workload_credentials422A service account holds 20 workload credentials, or the company 100; max and per (service_account or company) say whichDelete one first
agent_session_refused403Any change to the company's settings (its identity provider for agents, policy, admins, roles, groups, keys, streams, sign-outs, setup links) made inside a session an agent got through the company's identity providerNothing to retry as the agent: the person signs in to the app themselves

Enterprise sign-in and confirmation reasons

These come back from the sign-in calls and the hosted sign-in page rather than from an SDK hook: as reason on a sign-in call your own form makes, and as reason on the redirect back to your login page. The hosted page shows its own fixed sentence for each, never text from the URL.

ReasonWhereWhen it happensWhat to do
sign_in_method_not_allowedEvery sign-in door, after the credential matchedThe person's company does not allow this way without single sign-on. Password, magic link and passkey carry allowed, the ways it does allow; sign-up (where anyone can type any address) and social sign-in do not, and a sign-up refusal is not recordedShow only the ways in allowed, with the message (sign-in methods)
policy_unavailableEvery sign-in doorThe person's company's rules could not be read just now, so the door refuses rather than lets them in: 503 with Retry-After on password, sign-up, magic link and passkey, the reason on the social redirect. "We could not check your company's sign-in rules just now. Try again in a moment."Show the message; they try again in a moment
passkey_verification_requiredPasskey sign-inThe company asks for passkeys that check the person (fingerprint, face or device PIN), and this one did notShow the message; the person uses a passkey that does
passkey_setup_requiredA sign-in door, then /redirectThe company asks for a passkey and the person has none, or the person confirms it's them with a passkey and has none: the door answers success with a token that can only set one up, and /redirect refuses that token with this reason (any other kind of token there is a 401)The hosted page takes them to add a passkey, then signs them in with it
passkey_sign_in_requiredAdding or removing a passkey on the hosted pageAdding: one of a company's people, or someone under a list with Passkey, has a passkey already, and another needs a passkey sign-in from the last 10 minutes; a setup token adds only a first one. "You already have a passkey. Sign in with it, then add another." Removing, for one of a company's people or under a list: the token is not a passkey sign-in that checked them in the last 10 minutes. "Sign in with one of your passkeys first, then remove this one."They sign in with their passkey, then add or remove one
wrong_accountConfirming it's youThe person signed in as someone other than the account being confirmed. The session keeps its old timeThey sign in with the account they are confirming
reauth_method_not_allowedConfirming it's youThey confirmed a way that does not count for them, such as a passkey that did not check them. The message names the ways that do: "Confirm it's you with your passkey."They confirm the way the message names
session_endedConfirming it's youThe session being confirmed ended while they were away. A 401, with the company's own reason when the company ended it, else "Your session has ended. Sign in again." The confirmation is dropped, and the hosted page sends them back to the app's pageThey sign in again

Uploads and storage

An upload through the SDK (useUpload, UploadsApi) rejects with an Error that has err.status and err.code set. uploadFailureOf(err) turns them into a reason you can word yourself - tooLarge, invalid, disabled, userLimit, unavailable or failed - which useUpload also returns as failure. The same codes come back from the console API's asset uploads and from a form's file field, where your own code reads the response body.

CodeStatusWhen it happensWhat to do
UPLOAD_TOO_LARGE413The file is larger than the route, the form field, the organization's end-user limit or the 1 MB SVG limit takes: when it is declared, while a multipart body is read, or on complete when more arrived than was declared. The body always carries maxBytes, the limit in bytes, and the message states it exactlySay the limit with maxBytes and ask for a smaller file. On the 5 MB multipart route, upload direct instead
INVALID_UPLOAD400The declared size or type is missing or not an image, an end-user upload names an unknown purpose, what arrived is empty or not a supported image, or a multipart upload uses a field the route does not takeSend JPEG, PNG, GIF, WebP or SVG with its real size, and pick the file again
UPLOADS_DISABLED403The organization turned end-user uploads offHide the upload control: the public settings answer uploads.enabled: false
USER_UPLOAD_LIMIT403The file would take this user past the organization's per-user total. The body carries heldBytes and limitBytesAsk the user to remove an earlier file, or raise the per-user total in the console
UPLOADS_UNAVAILABLE503, 501503: the organization cannot take the file right now (storage full or a plan limit), said neutrally to an end user or a form visitor. 501: the server has no direct uploads configuredShow a "try later" message. As the organization, read the storage meter; on a self-hosted install, set up direct uploads
UPLOAD_NOT_RECEIVED409complete was called before the PUT to storage finishedComplete once the PUT answers; retry after a moment
UPLOAD_FINALIZING409Another call is completing the same upload right nowRetry after a moment; it answers the same file
INLINE_FILE_TOO_LARGE413A JSON body carries a data: file over 16 KB in one field, named in field, while the storage gate is enforced. The body carries maxBytes (16,384), and the message states the limit and the size in bytesUpload the file and send its URL instead
PLAN_LIMIT_REACHED402On the console API, with quotaSlug: "storage-gb": the upload does not fit under the storage ceiling. The body carries storage with usedBytes, reservedBytes, ceilingBytes, wantedBytes and cause (plan, trial or payment). With limitSlug: "max-asset-size-mb" instead: the file is over your plan's per-file limit. The body also carries maxBytes, and the message states the limit and the size in bytesDelete files you no longer need or move to a plan with more storage; for trial, start the plan; for payment, fix the payment method. See Assets. Over the per-file limit, move to a plan with larger files

An end user and a form visitor never see PLAN_LIMIT_REACHED: the organization's plan is not theirs to act on, so they get UPLOADS_UNAVAILABLE with 503.

Agent token verification

These are the code values on AppBridgeError, thrown by verifyClientJwt(), verifyAppTokenRequest() and verifyAppRevokeRequest() when a request from BuildBase to your applicationTokenUrl or applicationRevokeUrl fails verification.

CodeWhen it happensWhat to do
invalid_tokenThe token or client secret is missing, the JWT is malformed, or a claim has a bad typeCheck the Authorization: Bearer header reaches your handler intact
invalid_algorithmThe JWT header is not HS256Reject it; BuildBase only signs with HS256
invalid_signatureThe signature does not match the client secretConfirm the client secret in your environment matches the one in the dashboard
invalid_secretsignClientJwt() was called without a signing secretCheck the environment variable holding the client secret is set where the code runs
token_expiredexp has passed, beyond the 60-second clock toleranceCheck your server clock; widen clockToleranceSec only if your clock skew is known
token_not_yet_validnbf is still in the futureSame as above: usually clock skew
invalid_issueriss does not equal the issuer option you passedFix the expected issuer, or drop the option
invalid_audienceaud does not contain the audience option you passedFix the expected audience, or drop the option

handleAppTokenRequest() and handleAppRevokeRequest() catch these for you and return a 401 whose body message is the code, so you only handle AppBridgeError directly when you call the verify functions yourself.

OAuth token endpoint: an identity provider's grant

When a company's identity provider approves an agent (agents through a company's identity provider), the agent presents an ID-JAG at your token endpoint with grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer. A refusal is OAuth's shape, { "error": "...", "error_description": "..." } (RFC 6749 section 5.2). The description stays generic for anything about the assertion or the person, and the company's trail keeps the reason; the agent sees these, not your users.

errorStatusWhen it happensWhat to do
unsupported_grant_type400Enterprise-managed authorization is off, or your plan does not include agent readinessTurn it on under User management > Access > Authentication > Agent readiness
invalid_client401No client, an unknown one, a wrong secret, or a metadata-document URL your app could not resolve ("Invalid client")Check the client ID; for a metadata document, your server's log names the reason
unauthorized_client400"This client cannot use the JWT bearer grant.": an app client, or a dynamically registered oneUse a registered agent client, or a metadata-document agent
invalid_request400"The assertion is required." or "The assertion is too large." (over 8 KB)Send the ID-JAG as assertion
invalid_grant400"The assertion could not be verified.": its issuer, signature, type, audience, lifetime, the person or the network. Or the company's connected-apps sentence when its policy refuses the agentRead the company's trail (enterprise_agent_access_refused) for the reason
invalid_grant400"The assertion was issued to another client.", "The assertion was already used." or "This assertion asks for something this app does not support yet."Use the client the assertion names; ask the identity provider for a fresh assertion; drop cnf and authorization_details
invalid_scope400"The requested scope is beyond the assertion's."Ask for the assertion's scopes or fewer
invalid_target400"The requested resource is beyond the assertion's."Ask for the assertion's resource
temporarily_unavailable503The single-use check could not be made, or your Application token URL did not mint a tokenRetry; if it keeps failing, check your token URL

Company token endpoint: a workload's exchange

A company's CI job or cloud workload exchanges its own token at POST /api/v1/company/token (workload identity). A refusal is OAuth's shape, { "error": "...", "error_description": "..." }:

errorStatusWhen it happensWhat to do
invalid_request400A field missing or malformed, a token over 16 KB, a reference that does not parseSend the workload's JWT as subject_token and the credential's reference
unsupported_grant_type400Another grant, or workload identity is off ("This app does not exchange workload tokens.")Use the token-exchange grant; the app's team turns workload identity on
invalid_grant400"The token could not be exchanged.": its issuer, signature, type, audience, lifetime or pinsRead the credential's last refusal, or the trail (enterprise_workload_token_refused)
invalid_grant400"This token was already exchanged."Ask the platform for a fresh token
invalid_scope400"The credential does not allow that scope."Ask for the credential's scopes or fewer
ip_not_allowed403The credential's addresses, or the company's IP allowlistRun from an allowed address, or change the credential
tenant_restricted403The network's allowed-company-ids header names other companies of your appRun on a network that allows the company
temporarily_unavailable503The single-use check could not be madeRetry

Refusal reasons in the trail: credential_disabled, company_unavailable, service_account_gone, wrong_type, wrong_issuer, bad_signature, wrong_audience, expired, too_long, conditions_not_met, replayed, ip_not_allowed, tenant_restricted and scope_beyond.

Environments

These are the refusals you can get around a development or staging environment, whether the request came from the console, the CLI or the SDK. Each carries a code beside its status. Branch on the code, never on the wording of the message.

CodeStatusWhen it happensWhat to do
ENVIRONMENT_NOT_FOUND404The key is not one of the organization's environments, the environment was archived, or environments are not open to the organization. A switch into one answers success: false with this codeCheck the key in the Environments card under Settings > General. An archived environment's key never works again
ENVIRONMENT_NOT_ALLOWED-The member has no access to that environment, so the switch into it is refusedAn owner or admin gives the member access under Settings > Users
ENVIRONMENT_INVALID400A name outside 1 to 40 characters, or a key, name or slug that does not match its shapeFix the value. A key is exactly eight lowercase letters
ENVIRONMENT_LIMIT_REACHED403Adding an environment past the platform's own ceiling on environments per organization, which no plan raisesArchive one you no longer use. Past your plan's own limit, the refusal is 402 PLAN_LIMIT_REACHED with limit and current
ENVIRONMENTS_DISABLED403Adding an environment while environments are not open to the organization yetNothing to fix on your side; contact support
ENVIRONMENT_PLAN_UNPUBLISHED503A request into an environment while the plan environments run on is not available. Production is not affectedRetry later; production keeps working
ENVIRONMENT_KEY_MODE400A live Stripe key saved outside productionUse test keys (sk_test_, pk_test_) in an environment. Live keys belong in production
ENVIRONMENT_UNSUPPORTED400A custom sign-in domain or a sending domain added outside productionAdd it in production. Reads still work in the environment, with nothing in them
ENVIRONMENT_SECRET_ISSUED409Asking a second time for the client secret an environment hands out to connect an app. It is handed out onceCopy it from whoever has it, or rotate it (--rotate-secret, or Rotate in the console): the one before stops working
AGENT_TENANT_MISMATCH401An agent's token, issued in one environment, used by a request that names another in its x-org-id header: a Staging token at an MCP server set up for production, or the other way roundConnect the agent again from the environment the server is set up for. Tokens issued before this check keep working until they expire

Promotion between environments (buildbase env push and pull, the console's Changes) answers 403 when the caller is not an owner or admin who may enter both environments, and 404 when the other environment does not exist.

Invitations

Workspace invitations through the SDK (see Invitations) answer these beside the codes listed below.

CodeStatusWhen it happensWhat to do
INVITATION_NOT_FOUND404No invitation with that id in this organizationRead the invitations again; it may have been revoked
USER_BLOCKED403Inviting an account that is blocked, or accepting or declining from a blocked accountUnblock the user in the console if that was a mistake
INVITATION_EMAIL_FAILED502The invitation email could not be sent, on a new invitation (nothing was kept) or a resendCheck the organization's email sender, then try again

Codes documented with their feature

These carry a code too. Each is described in full on the page of the feature that answers it.

CodeStatusWhere
INVITATION_EXPIRED, INVITATION_ALREADY_HANDLED, INVITATION_EMAIL_MISMATCH, INVITATION_RATE_LIMITED, EMAIL_NOT_VERIFIEDvariesInvitations
WORKSPACE_INVITES_DISABLED403Invitations
NOTIFICATION_EVENT_NOT_SET_UP403Notifications
SUBSCRIBER_NOT_FOUND404Subscribers
CEILING_REACHED403Users and workspaces
CLAIM_LINKED, RELEASE_BUDGET_EXHAUSTED409Users and workspaces
CLAIM_CAP_REACHED429Users and workspaces
SIGN_IN_ADDRESS_MISMATCH403Your own domain
SIGN_IN_ADDRESS_UNCHECKED503Your own domain

Tracking codes

The code on an sdk_error tracking event is SDK_ERROR when an operation threw an Error, and UNKNOWN_ERROR when it threw something that was not an Error. Use component and action on the same event to find which operation failed.

Common error messages

These have no code; match on the situation rather than the exact string.

MessageWhen it happensWhat to do
Invalid serverUrl: "...". Must be a valid URL.Provider config has a serverUrl that does not parseInclude the protocol, e.g. https://
Invalid orgId: "...". Must be a valid MongoDB ObjectId (24 hexadecimal characters).orgId is not a 24-character hex idCopy the organization id from the dashboard
Invalid version: "...". Only "v1" is currently supported.version is not v1Pass ApiVersion.V1
SDK is not ready (missing serverUrl, version, or orgId)An API call ran before the config was setMount SaaSOSProvider above the component, or pass all three to BuildBase()
use... must be used within a ...ProviderA hook rendered outside SaaSOSProviderMove the provider higher in the tree
Request timeout after 30000ms: GET ...A request outlived the timeout option (30 seconds by default)Raise timeout, or set maxRetries for transient failures (retries apply to network errors and 5xx)
No workspace selectedA credit purchase ran with no current workspaceWait for useSaaSWorkspaces() to load, or pick a workspace first
Workspace not foundA delete targeted an id that is not in the user's loaded workspace listRefresh the workspace list; the user may have been removed
Only the workspace creator can delete the workspaceA non-owner called deleteHide the action with usePermissions().isOwner
Cannot remove the workspace owner / Cannot change the role of the workspace ownerAn action targeted the ownerFilter the owner out of member actions

Messages from the server

When the API responds with an error, the thrown message is the server's own message when it sends one. When it does not, the SDK falls back to <action> (<status>: <reason>), for example Failed to fetch credit balance (403: Forbidden - You do not have permission):

StatusFallback reasonUsually means
400Bad RequestA required field is missing or malformed
401Unauthorized - Please check your sessionThe session expired or was revoked; sign the user in again. With code: "session_ended", the user's company ended it, and the body says why
403Forbidden - You do not have permissionThe user's role lacks the permission; see Permissions. With code: "reauth_required", the change needs a recent sign-in, and the session is kept
404Resource not foundThe id is wrong, or the resource belongs to another workspace
500Internal server errorRetry; if it persists, contact support
502Bad GatewayThe server is unreachable or restarting; retry
503Service unavailableSame as 502

Some methods also attach the HTTP status as err.status. It is not set on every call, so check for it before relying on it.

A server failure with no more specific reason answers 503 with the code server_error (lowercase, as sent) and the generic message something went wrong. Treat it as a retry; a 5xx without that code (a coupon's or Stripe's 502, for instance) carries a sentence meant for the person, so show its message.

When the server's cache could not answer a request that needed it (under heavy load, or while it restarts or fails over), the sign-in routes, and any route that has no answer of its own for the failure, answer 503 with code: "temporarily_unavailable", a Retry-After header and the same seconds as retryAfterSeconds in the body. Nothing was wrong with the request: send it again after retryAfterSeconds. Its message says to try again in a moment, and the hosted sign-in page says so in its own language. A sign-in code is used once, so if the retried code exchange is refused, start the sign-in again.

Next steps