---
schema_version: "1"
id: 7eb3f8af768ade60156038aefe0a939c6bb2dae8099107117edb9ba3f9645462
title: Status Codes and Error Responses
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/uiapi/ui_api_errors.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_errors.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2f05f795f8083a0a8087e0b0410c24c048e30bfc01ec72ce92ffc8a31010a49a
description: 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.
---
# 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.

<table class="featureTable sort_table" summary="">


          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader vertical-align-top " id="d8964e39">HTTP Status Code</th>

              <th class="featureTableHeader vertical-align-top " id="d8964e42">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d8964e39" data-title="HTTP Status Code">200</td>

              <td class="entry" headers="d8964e42" data-title="Description">Success with GET, PATCH, or HEAD request</td>

            </tr>

            <tr>
              <td class="entry" headers="d8964e39" data-title="HTTP Status Code">201</td>

              <td class="entry" headers="d8964e42" data-title="Description">Success with POST request</td>

            </tr>

            <tr>
              <td class="entry" headers="d8964e39" data-title="HTTP Status Code">204</td>

              <td class="entry" headers="d8964e42" data-title="Description">Success with DELETE</td>

            </tr>

            <tr>
              <td class="entry" headers="d8964e39" data-title="HTTP Status Code">400</td>

              <td class="entry" headers="d8964e42" data-title="Description">The 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.<ul class="ul bulletList">
                  <li class="li"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_records_batch_post.htm" title="Create multiple records. You can create, update, and delete up to 200 records in a single request.">Create a Batch of Records</a></li>

                  <li class="li"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_records_batch_update.htm" title="Update multiple records. You can create, update, and delete up to 200 records in a single request.">Update a Batch of Records</a></li>

                  <li class="li"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_records_batch_delete.htm" title="Delete multiple records. You can create, update, and delete up to 200 records in a single request.">Delete a Batch of Records</a></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d8964e39" data-title="HTTP Status Code">401</td>

              <td class="entry" headers="d8964e42" data-title="Description">The 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 <samp class="codeph nolang">message</samp> and <samp class="codeph nolang">errorCode</samp>.</td>

            </tr>

            <tr>
              <td class="entry" headers="d8964e39" data-title="HTTP Status Code">403</td>

              <td class="entry" headers="d8964e42" data-title="Description">The 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.</td>

            </tr>

            <tr>
              <td class="entry" headers="d8964e39" data-title="HTTP Status Code">404</td>

              <td class="entry" headers="d8964e42" data-title="Description">Either the specified resource was not found, or the resource has
                been deleted. </td>

            </tr>

            <tr>
              <td class="entry" headers="d8964e39" data-title="HTTP Status Code">409</td>

              <td class="entry" headers="d8964e42" data-title="Description">A 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.</td>

            </tr>

            <tr>
              <td class="entry" headers="d8964e39" data-title="HTTP Status Code">410</td>

              <td class="entry" headers="d8964e42" data-title="Description">The requested resource has been retired or removed. Delete or
                update any references to the resource.</td>

            </tr>

            <tr>
              <td class="entry" headers="d8964e39" data-title="HTTP Status Code">412</td>

              <td class="entry" headers="d8964e42" data-title="Description">A precondition has failed. For example, in a batch request, if
                <samp class="codeph nolang">haltOnError</samp> is <samp class="codeph nolang">true</samp> and a subrequest fails,
                subsequent subrequests return 412.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d8964e39" data-title="HTTP Status Code">500</td>

              <td class="entry" headers="d8964e42" data-title="Description">An error has occurred within Lightning Platform, so the request
                could not be completed. Contact Salesforce Customer Support.</td>

            </tr>

            <tr>
              <td class="entry" headers="d8964e39" data-title="HTTP Status Code">503</td>

              <td class="entry" headers="d8964e42" data-title="Description">Too many requests in an hour or the server is down for
                maintenance. </td>

            </tr>

          </tbody>

        </table>

## Example

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

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

The response body is:

HTTP/1.1 400 Bad Request
Date: Tue, 29 Nov 2016 00:16:36 GMT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy: reflected-xss block;report-uri /\_/ContentDomainCSPNoAuth?type=xss
Content-Security-Policy: referrer origin-when-cross-origin
Set-Cookie: BrowserId=q27CK9tSSCeI3klUaYMo6A;Path=/;Domain=.salesforce.com;Expires=Sat, 28-Jan-2017 00:16:36 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked


\[ {
  "errorCode" : "ILLEGAL\_QUERY\_PARAMETER\_VALUE",
  "message" : "recordId should be a valid record ID: 003R000000"
} \]