API error codes
TL;DR: Every refusal has the body
{ "error": { type, code, message, param, requestId, docUrl, retryable } }. This page describes each field, then lists eachcode, the HTTP status it is sent with and what the caller should do.
The error body
{
"error": {
"code": "invalid_request",
"docUrl": "https://mmw-docs.apidocumentation.com/errors#invalid_request",
"message": "Invalid request. answers.0.questionId: Too small: expected string to have >=1 characters",
"param": "answers.0.questionId",
"requestId": "8f14e45f-ceea-467f-a8d4-b8e6a1c2b6f3",
"retryable": false,
"type": "invalid_request_error"
}
}
| Field | What it holds |
|---|---|
code |
What went wrong, as a stable code to branch on. |
docUrl |
The code's entry on the public error-code page. |
message |
What went wrong, for a developer to read. It may change. |
param |
The dotted path of the first request field that was wrong, such as answers.0.questionId, or null when no one field was. |
requestId |
The id of this request, the same as the request-id response header. Quote it to MMW about a failure. |
retryable |
Whether sending the same request again may succeed. |
type |
The family of the error, by HTTP status. |
Codes
invalid_request is sent with 400, and with 422 when the request is well formed and the data refuses it. A code marked retryable may succeed if the same request is sent again. Each code below is the target of the docUrl of an error with that code.