Errors
When a request fails, the API answers with an HTTP status of 400 or above and a JSON body holding three keys: statusCode, the same number as the status; name, one of the names below; and message, a sentence that says what went wrong, naming the field or parameter at fault when there is one. Write your code against name, which never changes for a given cause, and show or log message, which may be reworded.
| Name | Status |
|---|---|
invalid_idempotency_key |
400 |
validation_error |
400, 401, 403, 413, 415, 422 |
missing_api_key |
401 |
restricted_api_key |
401, 403 |
email_above_quota |
403 |
invalid_permission |
403 |
suspended_api_key |
403 |
not_found |
404 |
method_not_allowed |
405 |
concurrent_idempotent_requests |
409 |
invalid_idempotent_request |
409 |
resource_locked |
409 |
forge_not_enabled |
409 |
forge_unavailable |
422 |
invalid_attachment |
422 |
invalid_parameter |
422 |
missing_required_field |
422 |
missing_required_parameter |
422 |
return_path_unavailable |
422 |
daily_quota_exceeded |
429 |
monthly_quota_exceeded |
429 |
rate_limit_exceeded |
429 |
application_error |
500 |
dns_lookup_failed |
503 |
service_unavailable |
503 |
terms_acceptance_required |
403 |
domain_check_quota_exceeded |
429 |
Status: 400
When it happens. The request carries an Idempotency-Key header whose value is empty or longer than the API accepts.
What to do. Send a value made for this one request, such as a UUID, and keep it short.
Statuses: 400, 401, 403, 413, 415, 422
When it happens. Something in the request is not what the operation expects: a field has the wrong type or form, the body is too large or not JSON, the API key is not one we know, or the message would be sent from a domain your team has not verified. The status narrows it down, and message names the part at fault.
What to do. Read message, correct that part of the request, and send it again. Repeating the same request unchanged gets the same answer.
Status: 401
When it happens. The request has no Authorization header.
What to do. Send your API key as Authorization: Bearer <key> on every request.
Statuses: 401, 403
When it happens. The key is valid but may not do this. A sending access key can only send email, so any other operation refuses it; a key that is not active is refused everywhere.
What to do. Use a full access key for operations other than sending.
Status: 403
When it happens. You asked for the content of a received message that arrived while your team was over its quota. The content of such a message cannot be read.
What to do. Keep your team under its quota, so that the messages it receives later can be read.
Status: 403
When it happens. The access token was granted to an application without the permission this operation needs.
What to do. Ask for the missing permission when the application is authorised again.
Status: 403
When it happens. The key has been suspended, so every request made with it is refused.
What to do. Use another key until this one is restored.
Status: 403
When it happens. Your account or team has not accepted the current Terms of Service and Acceptable Use Policy, or the grace window after a material update has ended without a team Admin accepting the new version.
What to do. Sign in to the Hermesmail dashboard as an account holder or team Admin, review and accept the updated legal terms, and then retry your request.
Status: 404
When it happens. The path matches no operation, or the thing it names does not exist in your team: it was deleted, the id is mistyped, or it belongs to another team.
What to do. Check the path against the reference and the id against the one the API gave you when the thing was created.
Status: 405
When it happens. The path exists, but not with this HTTP method.
What to do. Use one of the methods the Allow header of the answer lists.
Status: 409
When it happens. Another request with the same Idempotency-Key is still being worked on.
What to do. Wait a moment and send it again. Once the first request is done, the retry gets its outcome.
Status: 409
When it happens. The Idempotency-Key was already used with a different request body on the same operation, while that key is still remembered.
What to do. Use a new key for a new request. Reuse a key only to retry exactly the same request.
Status: 409
When it happens. Another request is changing the same thing at the same moment, and this one stopped waiting for it.
What to do. Send the request again after a short pause.
Status: 409
When it happens. No Hermesmail operation answers with this name. It is listed because client libraries already know it, so you can tell at a glance that it does not concern you.
What to do. Nothing: no request to Hermesmail fails this way.
Status: 422
When it happens. No Hermesmail operation answers with this name. Client libraries already know it, and it is listed here so you can see that it never applies.
What to do. Nothing: no request to Hermesmail fails this way.
Status: 422
When it happens. An attachment in the message has neither its content nor a path to fetch it from.
What to do. Give each attachment its content, encoded in base64, or a path the API can fetch it from.
Status: 422
When it happens. A path or query parameter has the wrong form, such as an id that is not one the API could have made.
What to do. Check the parameter that message names against the operation's reference page.
Status: 422
When it happens. The body leaves out a field the operation cannot do without.
What to do. Add the field that message names. Each reference page marks the required fields.
Status: 422
When it happens. A query or path parameter the operation cannot do without is missing.
What to do. Add the parameter that message names.
Status: 422
When it happens. No Hermesmail operation answers with this name. It is kept in the list because client libraries know it, so that a search for it lands somewhere.
What to do. Nothing: no request to Hermesmail fails this way.
Status: 429
When it happens. Your team has sent all the email its plan allows in one day. The request is refused whole, and nothing from it is queued.
What to do. Send again once the daily count starts over.
Status: 429
When it happens. Your team has sent all the email its plan allows in one billing month, and the plan does not let you send past it. Nothing from the request is queued.
What to do. Wait for the next month.
Status: 429
When it happens. Your requests are arriving faster than your plan allows.
What to do. Pause and send the request again, waiting a little longer each time it happens. Spreading requests out, or sending several messages in one batch, keeps you under the rate.
Status: 500
When it happens. Something went wrong on our side while the request was being handled.
What to do. Send the request again later; with an Idempotency-Key, a retry cannot send a message twice.
Status: 503
When it happens. The request needed a DNS lookup, such as while checking a domain's records, and the lookup failed.
What to do. Send the request again in a few minutes. If it keeps failing, check that the domain's name servers answer.
Status: 503
When it happens. The API cannot handle requests at the moment, for example while a service it depends on is down.
What to do. Send the request again later, waiting a little longer after each try.
Status: 429
When it happens. Your team has used all the domain checks its plan allows in the current billing period, or its plan does not include domain checks. No lookup runs and nothing is counted.
What to do. Wait for the next billing period, shown in the Retry-After header, or move to a plan with a higher monthly allowance.