Status Codes and Error Responses

The response header contains an HTTP status code. If the response isn’t successful, the response body contains an error message, and if appropriate, information about the field or object where the error occurred.

HTTP Status CodeDescription
200Success with GET, PATCH, or HEAD request
201Success with POST request
204Success with DELETE
400The request could not be understood, usually because the ID is not valid for the particular resource. If the request is for a batch record operation, see the corresponding usage guidelines.
401The session ID or OAuth token has expired or is invalid. Or, if the request is made by a guest user, the resource isn’t accessible to guest users. The response body contains the message and errorCode.
403The request has been refused. Verify that the context user has the appropriate permissions to access the requested data, or that the context user is not an external user.
404Either the specified resource was not found, or the resource has been deleted.
409A conflict has occurred. For example, an attempt was made to update a request to join a group, but that request had already been approved or rejected.
410The requested resource has been retired or removed. Delete or update any references to the resource.
412A precondition has failed. For example, in a batch request, if haltOnError is true and a subrequest fails, subsequent subrequests return 412.
500An error has occurred within Lightning Platform, so the request could not be completed. Contact Salesforce Customer Support.
503Too many requests in an hour or the server is down for maintenance.

Example 

This request requires a 15 or 18 character record ID, but this record ID doesn’t contain enough characters.

1GET /ui-api/record-ui/003R000000

The response body is:

1HTTP/1.1 400 Bad Request
2Date: Tue, 29 Nov 2016 00:16:36 GMT
3X-Content-Type-Options: nosniff
4X-XSS-Protection: 1; mode=block
5Content-Security-Policy: reflected-xss block;report-uri /_/ContentDomainCSPNoAuth?type=xss
6Content-Security-Policy: referrer origin-when-cross-origin
7Set-Cookie: BrowserId=q27CK9tSSCeI3klUaYMo6A;Path=/;Domain=.salesforce.com;Expires=Sat, 28-Jan-2017 00:16:36 GMT
8Expires: Thu, 01 Jan 1970 00:00:00 GMT
9Content-Type: application/json;charset=UTF-8
10Transfer-Encoding: chunked
11
12
13[ {
14  "errorCode" : "ILLEGAL_QUERY_PARAMETER_VALUE",
15  "message" : "recordId should be a valid record ID: 003R000000"
16} ]