Skip to content

Error Reference

All errors use the same envelope. The error field is a stable machine-readable code — safe to switch on in your application code.

json
{
  "success": false,
  "error": "NOT_FOUND",
  "message": "Dye with ID 999999 not found.",
  "details": { "id": 999999 },
  "meta": { "requestId": "...", "apiVersion": "v1" }
}

Error Codes

Client Errors (4xx)

CodeHTTPDescription
VALIDATION_ERROR400Invalid parameter value or format
MISSING_PARAMETER400Required parameter not provided
INVALID_HEX400Hex color format invalid
INVALID_MATCHING_METHOD400Unknown color distance algorithm
INVALID_LOCALE400Unsupported locale code
INVALID_STAIN_ID400stainId is not a positive integer
INVALID_CATEGORY400Unknown category name
NOT_FOUND404Dye, stain, or route not found
RATE_LIMITED429Rate limit exceeded

Server Errors (5xx)

CodeHTTPDescription
INTERNAL_ERROR500Unexpected server error
SERVICE_UNAVAILABLE503Upstream service unavailable
UPSTREAM_ERROR502Upstream returned an error

Validation Details

When validation fails, details includes the offending parameter:

json
{
  "error": "INVALID_HEX",
  "details": {
    "parameter": "hex",
    "received": "#F53",
    "expected": "Hex color string matching /^#?[0-9A-Fa-f]{6}$/"
  }
}

For multiple validation errors in the same request:

json
{
  "error": "VALIDATION_ERROR",
  "message": "Multiple validation errors.",
  "details": {
    "errors": [
      { "parameter": "perPage", "received": "500", "expected": "<= 200" },
      { "parameter": "order", "received": "random", "expected": "asc or desc" }
    ]
  }
}

Hex Color Rules

RuleDetail
Format/^#?[0-9A-Fa-f]{6}$/
Missing #Auto-prepended — FF0000 is valid
CaseCase-insensitive
3-digit shorthandNot supported#F00 returns INVALID_HEX

Numeric Ranges (Phase 1)

ParameterRangeDefault
page≥ 11
perPage1 – 20050
stainId (path)≥ 1
maxDistance> 0
limit (within-distance)1 – 13620
kL, kC, kH> 01.0

Enum Values (Phase 1)

ParameterValid values
localeen ja de fr ko zh
method (matching)rgb cie76 ciede2000 oklab hyab oklch-weighted
sort (dyes)name brightness saturation hue cost
orderasc desc
idType (batch)auto item stain
consolidationTypeA B C none

Rate Limited Response

A 429 response includes actionable retry information:

json
{
  "success": false,
  "error": "RATE_LIMITED",
  "message": "Rate limit exceeded. 60 requests per minute allowed for anonymous access.",
  "details": {
    "limit": 60,
    "remaining": 0,
    "resetAt": "2025-12-15T12:01:00Z",
    "retryAfter": 30,
    "tier": "anonymous"
  },
  "meta": { ... }
}

The Retry-After header is also set on 429 responses. See Rate Limits.

Not affiliated with Square Enix.