REST API response codes and error messages

The REST API responds to each request with an HTTP response code.

The HTTP standard RFC 2616 is a primary source of information for the meaning of error codes.

However, this table provides details of response codes, typical scenarios, and what information can be expected in the response body.

Table 1. REST response codes
Response code Description
200 OK Request accepted, response contains result. This is a general purpose response code that can be returned from any request. For GET requests, the requested resource or data is in the response body. For PUT or DELETE requests, the request was successful and information about the result (such as new resource identifiers, or changes in resource status) can be found in the response body.
201 CREATED This response code is returned from PUT or POST, and indicates that a new resource was created successfully. The response body might for example contain information about a new resource, or validation information (for example, when an asset is updated).
204 NO CONTENT Indicates that the request was accepted but that there was nothing to return. This is returned when the request was processed, but no additional information about the result has been returned.
400 BAD REQUEST The request was not valid. This code is returned when the server has attempted to process the request, but some aspect of the request is not valid, for example an incorrectly formatted resource or an attempt to deploy an invalid event project to the event runtime. Information about the request is provided in the response body, and includes an error code and error message.
401 UNAUTHORIZED Is returned from the application server when application security is enabled, and authorization information was missing from the request.
403 FORBIDDEN Indicates that the client attempted to access a resource which they do not have access to. This might be encountered if the user accessing the remote resource does not have sufficient privileges; for example, by having the WBERestApiUsers or WBERestApiPrivilegedUsers role. Users who attempt to access private event projects owned by other users might also see this error, but only if they have the WBERestApiUsers role rather than the WBERestApiPrivilegedUsers role.
404 NOT FOUND Indicates that the targeted resource does not exist. This might be because the URI is malformed, or the resource has been deleted.
405 METHOD NOT ALLOWED Returned when the targeted resource does not support the requested HTTP method; for example, the functions resource only allows GET operations.
406 NOT ACCEPTABLE The data format requested in the Accept header or accept parameter is not supported by the targeted resource. That is, the client has requested that data is returned in a particular format, but the server is unable to return data in that format.
409 CONFLICT Indicates that a conflicting change has been detected during an attempt to modify a resource. The response body provides further information.
415 UNSUPPORTED MEDIA TYPE The data format of the request body, specified in the Content-Type header, is unsupported by the targeted resource.
500 INTERNAL SERVER ERROR An internal error occurred in the server. This might indicate a problem with the request, or might indicate a problem in the server side code. Error information can be found in the response body.