Handle Errors in REST API
Description | Resolution | HTTP Error | Custom |
---|---|---|---|
Generic Exception | Verify that you included the proper endpoint and resource. | 400 | 10000 |
Invalid Data Type | Confirm that the parameters of your request include the required data types. | 400 | 10001 |
Missing Required Field | Confirm that the request includes all required fields. | 400 | 10002 |
Incorrect Format | Verify that the request is formatted correctly. | 400 | 10003 |
Invalid Message Format | Make sure that the request body has balanced braces and brackets. | 400 | 10004 |
Invalid Value | Make sure that all values in the request are of the correct data types. | 400 | 10005 |
Aggregate Error | Check additionalErrors for detailed error messages. | 400 | 10006 |
Unsupported Media Type | Make sure that all media formats in the request are valid and allowed. | 415 |
Description | Resolution | HTTP Error | Custom |
---|---|---|---|
General Exception | Ensure you provide the correct resource. | 403 | 20000 |
Business Rule Not Set | Review the associated permissions and ensure you provide the proper configuration. | 403 | 20001 |
Insufficient Privileges | Your account lacks the privileges necessary to perform the request. | 403 | 20002 |
Description | Resolution | HTTP Error | Custom |
---|---|---|---|
Not Authorized | The access token in the request is missing, invalid, or expired. | 401 | 0 |
Authorization token invalid on URL or request body | Verify that the request header contains a valid access token. | 401 | 40004 |
General | Ensure the request specifies the correct resource. | 403 | 40000 |
Not Authenticated | Verify that the request header contains a valid access token. | 403 | 40001 |
Authorization token invalid on this endpoint | Use the stack-level endpoint that matches your token. | 403 | 40002 |
Authorization token invalid on URL | Verify that the request header contains a valid access token. | 403 | 40003 |
Internal Server Error | See the response returned by the HTTP routing assertion. | 500 | |
Service Not Found | The resource you’re trying to access doesn’t exist. Verify that the request specifies the correct resource. | 596 |
Description | Resolution | HTTP Error | Custom |
---|---|---|---|
Generic | Verify that your request specifies the correct resource. | 400 | 30000 |
Invalid Operation | Your request uses an invalid HTTP operation for the resource. Modify the request to use a valid operation. | 400 | 30001 |
Invalid State Transition | This operation requests an invalid state transition for the resource. Ensure you request a valid state transition. | 409 | 30002 |
Object Not Found | Your request can’t find any available data. Ensure you properly created your request. | 404 | 30003 |
Execution Timeout Expired | Retry the API call using Exponential Backoff. | 408 | — |
Object Already Exists | An existing object has the same ID, key, or name as the object specified in the request. Provide a unique value and try again. | 409 | 30004 |
Too many requests | Retry the API call after number of seconds specified in “Retry-After” header field. | 429 | 50100 |
Too many requests | Your API requests are temporarily blocked due to too many concurrent requests. Contact Salesforce Customer Support for more information about the issue. | 429 | 50200 |
Service Unavailable | Retry the API call after number of seconds specified in “Retry-After” header field. | 503 | 50300 |