List of status codes and error types you might encounter.
You can tell if your request was successful by checking the status code when receiving an API response.
If a response comes back unsuccessful, you can use the error type and error message to figure out what has gone wrong and do some rudimentary debugging.
Whenever a request is unsuccessful, the UsageGuard API will return an error response with an error type and message. You can use this information to understand better what has gone wrong and how to fix it. Most of the error messages are pretty helpful and actionable.
Errors returned from providers are returned as is, so you can use the error message and error code to understand what went wrong.
Error Response
{"requestId":"traceid-ug-ltexted6fk3d3","error":{"code":"MISSING_REQUIRED_FIELDS","message":"Policy type is required","details":"The policy type cannot be null or empty. Please provide a valid policy type and try again.","docUrl":"https://docs.usageguard.com/errors" }}