A refusal is JSON with an error object: a code to branch on, a message written for a person, and a request_id. Some add detail, such as the parameters an endpoint accepts or the plan that reaches it.
{
"error": {
"code": "upgrade_required",
"message": "/v1/ratings is on every paid plan, from Live at $39 a month. You are on Free key.",
"needs": "Live",
"your_plan": "Free key",
"pricing": "https://dartsapi.com/pricing",
"request_id": "req_2c81f0a94e7b1d63"
}
}| Status | Code | What it means |
|---|---|---|
| 400 | bad_id | An id of the wrong type, such as a match id given as a player. |
| 401 | no_key, bad_key, unknown_key | The key is missing, malformed or not ours. See Authentication. |
| 402 | upgrade_required | Your plan does not reach this endpoint. The message names the plan that does. |
| 402 | outside_window | The endpoint is yours, but the date asked for is outside your plan's window. |
| 404 | not_found, no_such_endpoint | No such record, or no such path. A path close to a real one gets suggestions. |
| 405 | wrong_method | A GET endpoint called with POST, or the other way round. |
| 422 | bad_parameter, unknown_parameter, missing_parameter | A parameter is malformed, not one the endpoint takes, or required and absent. The message names it. |
| 429 | rate_limited, allowance_used | Over the minute, or the day's or month's allowance is used. Retry-After says when. See Rate limits. |
| 503 | archive_unavailable, ratings_building | Something at our end is briefly unavailable. Retry shortly; it never counts against you. |