Level uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with Level's servers (these are rare).
Status Code | ||
---|---|---|
200 | OK | The request was successful. |
400 | Bad Request | The request failed, often due to a missing parameter. |
401 | Unauthorized | A valid API key was not provided. |
404 | Not Found | The requested resource does not exist. |
500 | Server Error | Something went wrong on Level's end. |
The error body will contain a detailed error message about what went wrong:
{
error: "Error message"
}