Errors
The Phase API will return approriate status codes and error messages when something goes wrong or a request cannot be processed. Let's look at some status codes and error messages 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 status code and error message to figure out what has gone wrong and do some rudimentary debugging.
Status codes
Here is a list of the different categories of status codes returned by the Protocol API. Use these to understand if a request was successful.
- Name
200- Type
- Description
A 200 status code indicates a successful response.
- Name
400- Type
- Description
A 400 status code indicates a bad request. This is typically due to a request that's missing some data requried to process the request, such as missing
idfields.
- Name
403- Type
- Description
A 403 status code indicates an authentication or access error. Check your authentication credentials if you see this error, and make sure the token you're using has the approriate scope for the App and Environment you're trying to access.
This error may also occur due to a Network Access Policy that restricts access from your IP address. Read more about Network Access Policy exceptions.
- Name
409- Type
- Description
A 409 status code indicates that the requested operation will create a conflict in your secret configuration. This is generally due to attempting to set the
keyof a secret at a given path where this key already exists.
- Name
5xx- Type
- Description
A 5xx status code indicates a server error — something went wrong with the Phase API.
Error types
Whenever a request is unsuccessful, the Phase API will return an error response with a message. You can use this information to understand better what has gone wrong and how to fix it.
Error response
{
"error": "Duplicate secret found",
}