Error Codes

Understand common API error codes, response formats, and troubleshooting details.

Public Access and Email Resource APIs use the actual HTTP status for failures. Successful responses return business data directly; they are not wrapped in success, code, message, or data fields.

Error response format

All documented errors use:

{
  "error": "invalidParameter",
  "message": "One or more parameters are invalid."
}
  • error is the stable value for application branching.
  • message is human-readable context for logging and troubleshooting.
  • Use the HTTP status as the request result. Do not look for a body-level code or success field.

Error values

HTTP statuserrorMeaning
400invalidParameterA required value is missing, malformed, too long, or outside its accepted range.
401invalidCredentialBasic credentials or the Application access token are missing, invalid, or expired.
403invalidContextThe token or userId cannot resolve the required Application and End User context.
403insufficientScopeThe token is valid but is not an Application-scoped token.
404emailNotFoundThe Email slug cannot be resolved or the Email does not belong to the requested user.
405methodNotAllowedThe path exists but does not support the supplied HTTP method.
500emailQueryFailedAn unexpected Email Resource query or mutation failure occurred.
500serverErrorAn unexpected non-Email server failure occurred, such as token creation failure.

Access API errors

POST /access/token

HTTP statuserrorTypical cause
401invalidCredentialMissing or malformed Basic Auth, or invalid credentials.
500serverErrorToken creation failed because of an unexpected server error.

Authentication failures intentionally use the same response so callers cannot distinguish a missing Client ID from an incorrect Client Secret:

{
  "error": "invalidCredential",
  "message": "The credential or access token is invalid or expired."
}

POST /access/code

HTTP statuserrorTypical cause
400invalidParameterMissing or invalid JSON body, userId, name, email, phone, email format, or field length.
401invalidCredentialMissing, malformed, invalid, or expired Application access token.
403insufficientScopeThe supplied token is not Application-scoped.

Email resource API errors

The following rules apply to all /resource/email operations:

HTTP statuserrorTypical cause
400invalidParameterInvalid userId, request body, name, subject, pagination, or extra size.
401invalidCredentialMissing, malformed, invalid, or expired Application access token.
403invalidContextApplication context is unavailable, or the userId does not exist for an operation that requires it.
403insufficientScopeThe supplied token is not Application-scoped.
404emailNotFoundThe Email slug is unknown or is outside the requested End User scope.
500emailQueryFailedAn unexpected query, ID resolution, create, update, delete, or copy failure occurred.

POST /resource/email may create a previously unknown userId. List, detail, update, delete, and copy operations require the End User context to exist.

Examples:

{
  "error": "emailNotFound",
  "message": "Email not found."
}
{
  "error": "emailQueryFailed",
  "message": "Email query failed."
}

Validation errors

A missing body or malformed JSON returns HTTP 400:

{
  "error": "invalidParameter",
  "message": "Request body is invalid."
}

Field validation messages may be more specific, for example:

  • userId is required
  • userId can only contain letters, numbers, underscores, and hyphens
  • name must not exceed 200 characters
  • email format is invalid
  • email must not exceed 200 characters
  • phone must not exceed 50 characters
  • name must not exceed 64 characters
  • pageNo must be positive and pageSize must be between 1 and 100

Recovery guidance

HTTP statusRecommended action
400Correct the request before retrying.
401Obtain or provide a valid Application access token, then retry.
403Check token scope, Application ownership, and the supplied userId.
404Check the public Email slug and End User scope; do not retry unchanged input.
405Use the HTTP method defined by the endpoint.
500Retry with bounded backoff. If failures continue, log the endpoint and response for support.