Errors
Error Status
Bayou's API handles errors by sending custom responses that provide valuable insight to developers and guidance on how to fix the error.
In general, 200 HTTP codes correspond to success, 4XX codes are for developer- or user-related failures, and 5XX codes are for Bayou-related issues.
HTTP Code | Status | What Bayou uses it for |
---|---|---|
200 | Ok | Everything worked as expected |
400 | Bad request | Request unacceptable, usually because of a missing parameter |
401 | Unauthorized | No valid API key provided |
403 | Forbidden | API key doesn’t have permission to perform the requested action |
404 | Not Found | The requested object doesn’t exist |
405 | Method Not Allowed | The request's HTTP method is not supported for this route |
409 | Conflict | Request conflicts with another request, usually related to external_id |
415 | Unsupported Media Type | The payload format is in an unsupported format |
500 | Server error | Issue on Bayou's side |
Error Code Convention
Error codes from Bayou's API follow a standard format. The error object includes the following fields: error_type, error_code, error_message, and docs_url. Below is an example of a 400 error code:
http code 400
{
"error_type": “invalid_input”,
"error_code": “utility_code_invalid”,
”error_message”: “The utility code you provided in the request is invalid. Did you mean commonwealth_edison? A full list of utility codes can be found here: https://docs.bayou.energy/reference/utility-support”,
”docs_url”: “https://docs.bayou.energy/docs/error-codes#utility_code_input_invalid”
}
Error Types
Below is a list of the error_types in Bayou's API:
error_type | Explanation |
---|---|
invalid_input | An input error occurs when a request has an invalid or missing parameter. |
invalid_request | An invalid request occurs when a requested route or the requested information doesn’t exist. |
auth_error | An auth error occurs when the API key is missing or doesn’t have permission to perform the requested action. |
api_error | API errors cover any internal errors that may occur. |
Updated 29 days ago