Error Codes

All error codes returned by the mail-catcher API.

All error responses follow a consistent format:

{
  "error": "ERROR_CODE"
}

Error reference

CodeHTTP StatusDescriptionEndpoint
UNAUTHORIZED401Missing or invalid Bearer tokenAll protected endpoints
NOT_FOUND404Email or attachment not foundGET /v1/emails/:id, DELETE /v1/emails/:id, GET /v1/emails/:id/raw, GET /v1/emails/:id/attachments/:file
MISSING_INBOX400Required inbox parameter missingGET /v1/emails, DELETE /v1/emails
INVALID_INBOX400Inbox contains invalid characters (valid: a-z 0-9 . _ -)GET /v1/emails, DELETE /v1/emails
INVALID_LIMIT400limit is outside the 1100 rangeGET /v1/emails
VALIDATION_ERROR400Other parameter validation failureGET /v1/emails

HTTP status codes

StatusMeaning
200Success
302Redirect to pre-signed S3 URL (raw email and attachment downloads)
400Bad request, check the error code for details
401Unauthorized, invalid or missing authentication
404Resource not found

Notes

  • All 401 responses return the same UNAUTHORIZED code regardless of whether the token is missing, malformed, or invalid. This prevents token enumeration.
  • The VALIDATION_ERROR code is a catch-all for request validation issues not covered by the specific codes above.
  • Error responses never include stack traces or internal details.

Search Documentation

Search through the docs