diegosouzapw/OmniRoute · error

AUTH_004

AUTH_004

Error message

Insufficient permissions

What it means

AUTH_004 (403): the authenticated API key or account lacks the scope/role required for the requested operation — the credential is valid but not authorized for this resource. Thrown by the policy/authorization layer when a permission check fails.

Solutions

  1. Verify the API key has the required scopes/roles for the endpoint
  2. Request elevated permissions from the operator or use an admin key
  3. Confirm the target resource (provider, combo, settings) allows this key's tier
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/shared/constants/errorCodes.ts:38 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/c57fa39920425fbf. Report an issue: GitHub.

Appendix: source

Thrown at src/shared/constants/errorCodes.ts:38

interface ErrorDetails {
  detail?: string;
  requestId?: string;
  retryAfter?: number;
}

export const ERROR_CODES: Record<string, ErrorCodeDef> = {
  // ── Auth ──
  AUTH_001: {
    code: "AUTH_001",
    message: "Authentication required",
    httpStatus: 401,
    category: "AUTH",
  },
  AUTH_002: { code: "AUTH_002", message: "Invalid API key", httpStatus: 401, category: "AUTH" },
  AUTH_003: { code: "AUTH_003", message: "API key expired", httpStatus: 401, category: "AUTH" },
  AUTH_004: {
    code: "AUTH_004",
    message: "Insufficient permissions",
    httpStatus: 403,
    category: "AUTH",
  },
  AUTH_005: { code: "AUTH_005", message: "Account locked", httpStatus: 423, category: "AUTH" },
  AUTH_006: {
    code: "AUTH_006",
    message: "No credentials for provider",
    httpStatus: 400,
    category: "AUTH",
  },
  AUTH_007: {
    code: "AUTH_007",
    message: "Session expired (re-login required)",
    httpStatus: 401,
    category: "AUTH",
  },

View on GitHub (pinned to a179ffed5b)