Error Codes

All API errors return a JSON body with an error code and a human-readable message.

Error Response Format

{
  "error": "ERROR_CODE",
  "message": "Human-readable description of what went wrong and what to do next."
}

HTTP Status Codes

400Bad Request

Invalid JSON body or missing required parameters.

Fix: Check that your request body is valid JSON and includes the required fields (e.g., "drugs" array for /check).

401Unauthorized

Missing or invalid API key.

Fix: Include a valid API key in the x-api-key header. Keys start with "rxlg_".

403Forbidden

API key revoked, expired, or account suspended.

Fix: Check your key status in the dashboard. Generate a new key if needed.

429Too Many Requests

Rate limit or monthly quota exceeded.

Fix: Wait for the rate limit to reset or upgrade your plan for higher limits.

502Bad Gateway

Pipeline execution error — an upstream service (openFDA, RxNorm, or Bedrock) failed.

Fix: Retry after a brief delay. If persistent, check status.rxlabelguard.com or contact support.

Best Practices

  • Retry logicImplement exponential backoff for 429 and 502 errors. Start with 1 second, double on each retry, max 3 retries.
  • Validate inputsCheck that drug names are non-empty strings before sending. The API rejects empty arrays and arrays with more than 10 items.
  • Monitor usageCheck X-RateLimit-Remaining headers to avoid hitting limits unexpectedly.