HTTP Statuses
Along with the HTTP methods that the API responds to, it will also return standard HTTP statuses, including error codes.
Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided. Codes in the 5xx range indicate an error with SafetyWing's servers.
HTTP Status code | Summary |
---|---|
200 - OK | Everything worked as expected. |
400 - Bad Request | The request was unacceptable, often due to missing a required parameter. |
401 - Unauthorized | No valid API key provided. |
403 - Forbidden | The API key does not have permissions to perform the request. |
404 - Not Found | The requested resource does not exist. |
405 - Not Allowed | Method not allowed. |
429 - Too Many Requests | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. |
500, 502, 503, 504 - Server Errors | Something went wrong on SafetyWing’s end. |
Some 4xx errors contain additional attributes like code or a message that provides additional information about the problem.
Attribute name | Description |
---|---|
code | Short string indicating problem. Such an error can be handled programmatically. |
message | Human readable explanation with more details about the problem. |
param | If the problem is related to the parameters provided, this attribute contains information about the parameter related to the error. |
Error codes
Error code | Description |
---|---|
no_valid_api_key | No valid API key provided |
api_not_configured | API integration is not enabled for the endpoint used. Please contact our support team to find out more. |
api_integration_disabled | API key is correct but integration is temporarily disabled. Please contact our support team to find out more. |
internal_server_error | Internal server error. Such an error is rare and if the problem persists, please contact support. |
param_validation | The request provided incorrect parameters |
not_found | The requested resource was not found |
bad_request | The request was unacceptable, often due to missing a required parameter. More information should be provided in the response message. |
Updated over 1 year ago