API

Error catalog

Every ValorBrain error code with cause and action, generated from the engine catalog.

Generated from the credential matrix · version 1 · sha 9d2b630103a5. Do not edit by hand: the source is src/credential-matrix.ts in the engine.

Match on the code, not the text. The code comes in the JSON error (or code) field, in an OAuth redirect's ?error= or in WWW-Authenticate's error=. An engine test guarantees every code the server returns is on this list.

Codes

CodeHTTPSurfaceCauseWhat to do
missing_bearer401MCPMCP request without Authorization: Bearer.Send a vbm_ token or follow WWW-Authenticate into OAuth discovery.
invalid_token401MCP, REST, SaaS ingest, OAuthUnknown, revoked or expired token (or, on MCP, a secret with no prefix).Create a new token in Settings → MCP Tokens or redo the signup/consent.
wrong_credential_type401MCPREST key (vb_, vb_agent_) or ingest key (fk_) sent to MCP.Use the mcp_token (vbm_…) on MCP and keep the api_key for REST.
agent_key_required401RESTThe signup MCP token reissue (POST /api/v1/agents/mcp-token) got a credential other than the workspace's vb_agent_ key.Call the route with the api_key (vb_agent_…) the signup returned.
insufficient_scope403REST, SaaS ingest, MCP toolThe token is valid but lacks the scope the route or tool requires.Issue a token with the scope named in required_scope (or write for ingest).
credential_required403RESTDocument purge without a bearer credential.Send the tenant token; dry_run=true works without one.
admin_required403RESTOperation that requires the tenant ADMIN role.Repeat with a workspace administrator's token.
attestation_required403RESTClass-A authority act without X-VB-Attestation.Send a live interactive attestation envelope for this request.
cap_human_forbidden400RESTMandate with cap=human: human approval cannot be delegated.Use a cap below human.
identity_denied200MCP toolThe token has scoped_access and the tool asked for a collection outside its allow-list.Ask the workspace owner to add the collection to the token.
scope_denied200MCP toolThe tool requires a scope the MCP token lacks.Issue a token with the tool's scope (Settings → MCP Tokens).
outside_keyspace200, 403REST, MCP toolAn integration credential tried to write outside its keyspace: a fact key outside it, or any write that is not a keyed fact (document, message, state). Nothing was written.Write only keyed facts (POST /api/v1/keyed-facts or upsert_keyed_fact) with keys in the keyspace; for another keyspace, ask the admin to widen the integration.
profile_identity_unavailable200MCP toolPlugin profile without a resolved user identity.Connect with a token bound to a workspace user.
mcp_init_failed403, 500MCPThe token belongs to another target (audience) or the MCP transport failed to start.Use the token for the right instance; on 500, retry.
internal_error500MCPUnexpected failure while serving the MCP request.Retry shortly; if it persists, open a ticket with the request time.
invalid_tenant_header400RESTX-Tenant-ID is not a tenant UUID.Drop the header (the tenant comes from the credential) or send a valid UUID.
invalid_user_header400RESTX-User-ID is not a user UUID.Drop the header or send the user's UUID.
invalid_member_id400RESTmember_id is not a member UUID.Send the team member's UUID.
not_document_owner403RESTPOST /documents over another user's private document, or changing an owned document's sensitivity, without being the owner on their own credential, a tenant admin or the platform; also a foundation PUT/DELETE on another user's private document. Nothing was written.Write with the owner's, a tenant admin's or the platform credential, or use another path.
sensitivity_change_requires_admin403RESTPOST /documents changing the sensitivity of a document with no owner: lowering it opens it to restricted tokens, raising it locks the team out. Nothing was written.Ask a tenant admin, or write without changing the sensitivity.
integration_not_minted_here400RESTPOST /api/v1/mcp/tokens with credential_kind: integration: an integration credential is created with its mandate, on another route. Nothing was created.Create the integration at POST /api/v1/authority/integrations, or ask for personal or gateway here.
user_not_in_tenant400REST, OAuthMCP token (or app OAuth consent) requested for a user_id that is not a tenant member.Provision the user before issuing the token or approving the consent.
email_already_registered409RESTThe admin e-mail already exists in another tenant.Sign in with the existing account.
user_id_conflict409RESTThe e-mail is already bound to another user id in the tenant.Use the returned engine_user_id.
rate_limited429OAuthOAuth dynamic registration above the per-IP limit.Wait for Retry-After and reuse the client_id you already registered.
answer_burst_exceeded429RESTToo many answers for the tenant in a short window.Wait for Retry-After.
answer_cap_reached429RESTThe customer's monthly answer cap was reached.Raise or remove the cap in settings.
not_found404, 200REST, MCP toolDocument, file or gap does not exist in this tenant.Check the docid/path; similarFiles suggests close names.
ambiguous409RESTThe name matches more than one entity.Pick one of the candidates and repeat with its id.
ambiguous_docid400RESTThe docid prefix matches more than one document.Use a longer prefix.
confirmation_required400RESTWhole-collection purge without confirm equal to the target.Run dry_run=true, then repeat with confirm and an admin credential.
superseded_document404RESTThe docid is a replaced version.Read read_at or the live document in superseded_by.
supersedes_self400REST, MCP toolsupersedes points at the document being written.Drop the target: rewriting the same path is already a revision.
supersedes_invalid400REST, MCP toolsupersedes list too long or with a malformed target.Send up to the maximum targets, each a docid or a path.
supersedes_not_found400REST, MCP toolA supersedes target does not exist.Check the replaced document's docid or path.
supersedes_ambiguous400REST, MCP toolA supersedes target matches more than one document.Use the full docid or the path.
revision_conflict409RESTexpected_revision is not the current revision.Reread the document (current_revision) and reapply the change.
update_failed200RESTOne batch item could not be updated.Retry only the items with ok: false.
resolve_failed200MCP toolThe knowledge gap could not be marked resolved.Retry shortly; if it persists, open a ticket with the request time.
approval_required403, 200REST, MCP toolWrite with weaker authority than the winning value; it becomes a proposal.Ask for human approval or correct with assert_authority_correction.
pii_defense_block422REST, MCP toolWrite refused: high-risk PII that could not be vaulted.Remove the sensitive data or store it with secrets.
invalid_request400, 405OAuthMissing or invalid parameter (PKCE S256, redirect_uri, form body).Fix the request per error_description.
invalid_client401, 400OAuthUnknown client_id.Register the client again at /oauth/register.
invalid_client_metadata400OAuthInvalid dynamic registration metadata.Fix the /oauth/register body.
invalid_redirect_uri400OAuthredirect_uri not allowed (http only on loopback; dangerous schemes refused).Use https, loopback or an app-specific scheme.
invalid_grant400OAuthCode expired, reused, from another client, wrong PKCE or invalid EMA assertion.Restart the authorization flow.
invalid_scope400, 302OAuthRequested scope outside read write.Ask for read, write or both.
invalid_target400, 302OAuthresource (RFC 8707) is not a resource of this issuer.Use the MCP URL or omit resource.
access_denied302OAuthThe person denied the consent.Nothing to do; offer to try again.
unsupported_grant_type400OAuthgrant_type other than authorization_code or jwt-bearer.Use authorization_code with PKCE (or jwt-bearer for EMA).
unsupported_response_type302OAuthresponse_type other than code.Use response_type=code.
method_not_allowed405OAuthOAuth endpoint called without POST.Use POST.
server_error500OAuthInternal failure in the authorization server.Retry shortly; if it persists, open a ticket with the request time.
invalid_consent_session400OAuthconsent_session tampered with, signed by another key or malformed.Start the connection again from the app (new /oauth/authorize).
consent_session_expired400OAuthThe consent_session is past its 15 minutes.Start the connection again from the app.
consent_session_used409OAuthThis consent was already decided (approval or denial is single use).Start the connection again from the app.
tenant_inactive403OAuthThe session's workspace is not billing-active.Restore the workspace subscription and approve again.
unauthorized401OAuthInternal consent endpoint called without the platform credential (only the SaaS calls it).Clients do not call this endpoint: use /oauth/authorize.

Answers without a code

Some gates still answer with a fixed message in the error field. The message is stable and can be compared literally.

CodeHTTPSurfaceCauseWhat to do
Unauthorized401RESTREST without a bearer, or with a credential that is not for REST (fk_, admin secret).Send Authorization: Bearer vbm_… (or the account's vb_agent_).
Unauthorized: admin secret required401RESTPlatform administration route.Not a client route; use the public REST routes.
Forbidden: admin credential required for money routes403RESTCredit or subscription route called with a tenant token.Not a client route; change plans in the app.
Forbidden: /metrics is served only to local scrapers403REST/metrics from outside the local network without the metrics token.Not a client route.
Rate limit exceeded — please slow down429RESTPer-credential (or per-IP, on a public route) limit exceeded.Wait retry_after_ms and slow down.

On this page