Error Codes

All API errors return a consistent JSON envelope.

Error Response Format

{
  "code": 401,
  "message": "Unauthorized",
  "data": null,
  "success": false,
  "timestamp": 1710154200000
}

HTTP Status Codes

Status Meaning
200 Success
401 Unauthorized — missing or invalid API key
403 Forbidden — key lacks required scope
404 Not Found — resource does not exist or belongs to another account
500 Internal Server Error

Common Errors

401 Unauthorized

{
  "code": 401,
  "message": "Unauthorized",
  "success": false
}

Causes:

  • Authorization header not included
  • Token does not start with gly_
  • API key has been revoked

403 Forbidden

{
  "code": 403,
  "message": "Forbidden: missing scope brand:read",
  "success": false
}

Causes:

  • API key does not have the scope required by the endpoint
  • Attempting to access another user's resource

404 Not Found

{
  "code": 404,
  "message": "Brand analysis not found",
  "success": false
}

Causes:

  • Resource ID does not exist
  • Resource belongs to a different account

500 Internal Server Error

{
  "code": 500,
  "message": "Internal Server Error",
  "success": false
}

Retry with exponential backoff (1 s → 2 s → 4 s). If the error persists, contact support.

Retry Guide

Error Retry? Action
401 No Check or regenerate your API key
403 No Verify the scope assigned to your key
404 No Confirm the resource ID is correct
500 Yes Exponential backoff