Errors

The Martis Core API uses conventional HTTP status codes to indicate requests response statuses. Codes in the 2xx range indicate success, 4xx codes indicate client errors, and 5xx codes indicate server errors.


Error Response Format

Endpoints within the Martis Core API service returns an HTTP status code

CodeStatusDescription
200OKRequest succeeded
201CreatedResource created successfully
400Bad RequestInvalid request parameters or malformed request body
401UnauthorizedMissing or invalid API key
403ForbiddenValid API key but insufficient permissions
404Not FoundRequested resource does not exist
409ConflictRequest conflicts with current state (e.g., duplicate idempotency key)
422Unprocessable EntityRequest understood but cannot be processed
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer error; retry the request
502Bad GatewayUpstream service unavailable
503Service UnavailableService temporarily unavailable

Error Attributes

  • Name
    status
    Type
    string
    Description

    Error category: fail for client errors, error for server errors

  • Name
    message
    Type
    string
    Description

    Human-readable error description (primarily for 5xx errors)

  • Name
    data
    Type
    object
    Description

    Field-specific error messages (primarily for 4xx errors)


Error Handling

If you experience unexpected errors, follow these steps for initial diagnosis:

  • Check the status code — Use the HTTP status code to determine the error category
  • Parse error messages — Extract field-specific errors from the data object for validation errors
  • Implement retries — Retry requests that fail with 5xx errors using exponential backoff
  • Log errors — Record error responses for debugging and monitoring
  • Handle gracefully — Display user-friendly messages for common errors
SymptomPossible CauseSolution
All requests return 401Invalid API keyVerify the API key is correct and not revoked
401 in production onlyEnvironment mismatchEnsure production API key is used with production URL
400 with empty dataMalformed JSONValidate request body is valid JSON
409 on retryIdempotency conflictGenerate a new idempotency key for new operations
403 after successful authFeature not enabledContact support to enable the required feature
Intermittent 5xx errorsServer issuesImplement retry logic with exponential backoff

Before contacting support, verify the request format and parameters. Most errors result from incorrect request construction or missing required fields.

Was this page helpful?