HTTP status codes

Managment API response error messages include an HTTP status code and an error message.

For example, if you try to create a cache entity with the same name as an existing cache, the response is:

HTTP/1.1 409 Conflict
{ "code": "messaging.config.beans.CacheAlreadyExists", "message": "Cache duplicate_cache already exists in environment test", "contexts": [] }

The following table summarizes the most common HTTP status codes and what they mean in Apigee Edge.

HTTP Status Code Description
2xx Success. The API call was successful. An HTTP 204 indicates that the response is submitted with no content, typically because a DELETE operation succeeded.
401 Unauthorized. The credentials that you are using to make a request do have the appropriate permissions to perform the operation. Verify the roles for the account you are using.
403 Forbidden. The username and password combination you are using is not valid for the organization you specified. To test your credentials, log in to login.apigee.com/login. If you need an account, sign up.

Make sure that you are using the correct credentials for you organization and double-check spelling.

404 Not found. Verify that the request URL is spelled corectly and that the API you are trying to access exists. For example, ensure that you are not trying to access the wrong revision of an API. See also 404 Unable to identify proxy for host: <virtual host name> and url: <path>.
405 Method not allowed. You specified a method that is not supported. For example, you used the GET verb for an API call that requires the POST verb.
409 Request timeout. Indicates a conflict with an existing entity. For example, you attempted to create a cache using a name that already exists.
415 Unsupported media type. Typically, this error occurs on POST or PUT requests when the Content-type HTTP header is set to the wrong value. For example, an HTTP 415 error is returned if you POST the following to an API that only supports JSON:
$ curl https://api.company.com/v1/json_service
  -X POST
  -H "Content-type:text/xml"
  -d '<SomeXML>'

For GET requests, use the Accept header instead of the Content-type header.

429 Too many requests. The rate limit was exceeded on Quota or Spike Arrest policies. The current default status code for exceeding the rate limit is 500, but the default may change to 429 in the future. See Spike Arrest policy and Quota policy for information on how to change the 500 to a 429.
500 See 500 Internal Server Error.
502 See 502 Bad Gateway.
503 See 503 Service Unavailable.
504 See 504 Gateway Timeout.