// Handball API errors

Errors

The error shape and every code, fixed for v1.

Every error has the same shape. The code is for code and never changes in v1; the message is for people.

{"error": {"code": "upgrade_required", "message": "This match is on the Results plan. Plans: https://handballapi.com/pricing",
  "plan": "results", "docs": "https://handballapi.com/documentation/errors#upgrade_required"}}
CodeHTTPMeaning
bad_request400A value is wrong: a bad date, an unknown country, a key sent in the address. The message says what was expected.
unauthorized401No key was sent, or the key is not valid or has been revoked.
upgrade_required403Your plan does not reach this: an endpoint or a date further back. error.plan names the plan that does.
not_found404No endpoint at that address, or no finished match with that id.
method_not_allowed405The API only answers GET.
unknown_parameter422A parameter the endpoint does not take. The message lists the ones it does.
rate_limited429Too many requests this minute. Wait for Retry-After seconds.
quota_exceeded429Today's calls are used up. They reset at 00:00 UTC; Retry-After says when.
server_error500Something went wrong on our side. It has been logged; try again shortly.