Skip to main content
All error responses follow a consistent structure:
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Human-readable description of what went wrong.",
    "details": {}
  },
  "correlation_id": "uuid-for-support"
}
The correlation_id is included on every response and can be provided to MeshQu support for troubleshooting.

HTTP status codes

StatusCode constantMeaning
200Success.
201Resource created.
400VALIDATION_ERRORRequest body or query parameters failed validation. Check details for field-level errors.
401UNAUTHORIZEDMissing or invalid API key.
403FORBIDDENAPI key lacks the required scope, or tenant ID does not match the key.
404NOT_FOUNDResource does not exist or is not accessible to this tenant.
408REQUEST_TIMEOUTServer-side processing exceeded the timeout.
409DUPLICATE_CODEA policy or group with this code already exists.
429TOO_MANY_REQUESTSRate limit exceeded. See rate-limit-* headers and retryAfter in the body.
500INTERNAL_ERRORUnexpected server error.
503SERVICE_UNAVAILABLEA downstream dependency (e.g. database) is unreachable.

Domain-specific errors

These may appear in the code field for specific operations:
CodeContextMeaning
NO_ACTIVE_POLICIESDecision evaluationNo active policies matched the decision_type.
NO_ACTIVE_RULESDecision evaluationPolicies exist but have no active rules.
SNAPSHOT_NOT_FOUNDDecision replayThe policy snapshot for this decision could not be located.
ALREADY_DELIVEREDWebhook retryDelivery was already successful; cannot retry.
STILL_PENDINGWebhook retryDelivery is still pending; no retry needed.

Handling errors in the SDK

The TypeScript SDK throws typed error classes:
import {
  MeshQuError,
  MeshQuValidationError,
  MeshQuAuthError,
  MeshQuForbiddenError,
  MeshQuNotFoundError,
  MeshQuConflictError,
  MeshQuRateLimitError,
  MeshQuNetworkError,
  MeshQuTimeoutError,
} from '@tradequ/meshqu-client';

try {
  const result = await client.evaluate(context);
} catch (err) {
  if (err instanceof MeshQuRateLimitError) {
    // Back off and retry
  } else if (err instanceof MeshQuValidationError) {
    // Fix request payload
    console.error(err.message, err.details);
  } else if (err instanceof MeshQuAuthError) {
    // Check API key
  } else if (err instanceof MeshQuNetworkError) {
    // Network issue — retry with backoff
  }
}

Correlation IDs

Every response includes a correlation_id (also available as the x-correlation-id response header). Include this when contacting support.

Retry guidance

ErrorRetry?Strategy
400NoFix the request.
401 / 403NoCheck credentials and scopes.
404NoVerify the resource ID.
408YesRetry with same request.
409NoUse a different code or check existing resources.
429YesWait for Retry-After seconds, then retry.
500YesRetry with exponential backoff.
503YesRetry with exponential backoff.