# OCAPI Global Exceptions

The following table lists all OCAPI global exceptions:

<table><col /><col /><col /><col /><thead><tr><th>Status</th><th>Type</th><th>Arguments</th><th>Description</th></tr></thead><tbody><tr><td>400</td><td><code>BodyDecodingException</code></td><td><p>body (String)</p></td><td>The request document (body) couldn’t be decoded.</td></tr><tr><td>400</td><td><code>EnumConstraintViolationException</code></td><td><p>document (String)</p><p>enumValue (String)</p></td><td>Invalid enum value provided.</td></tr><tr><td>400</td><td><code>FieldNotSortableException</code></td><td><p>field (String)</p></td><td>The specified field isn’t sortable.</td></tr><tr><td>400</td><td><code>HookStatusException</code></td><td><p>extensionPoint (String)</p><p>statusCode (String)</p><p>statusMsg (String)</p><p>statusDetails (Map)</p></td><td>An OCAPI server-side extension point returned a status of type error. The exception contains details like extension point name, status code, status message, and custom status details.</td></tr><tr><td>400</td><td><code>IllegalEnumerationValueException</code></td><td><p>value (String)</p><p>type (String)</p></td><td>Illegal enum value provided for field type.</td></tr><tr><td>400</td><td><code>IllegalHttpMethodOverrideException</code></td><td><p>method (String)</p></td><td>The HTTP method provided via <emph>x-dw-http-method-override</emph> header or <emph>method</emph> query parameter isn’t allowed. HTTP methods 'PUT', 'PATCH', 'DELETE', 'HEAD' and 'OPTIONS' are supported as override method.</td></tr><tr><td>400</td><td><code>InvalidClientIdException</code></td><td><p>clientId (String)</p></td><td>The provided client id isn’t the expected one for this token request.</td></tr><tr><td>400</td><td><code>InvalidCustomPropertyException</code></td><td></td><td>Can’t write custom property. Value is either invalid or type doesn't support modification.</td></tr><tr><td>400</td><td><code>InvalidExpandValueException</code></td><td><p>expandValue (String)</p></td><td>The specified expand value isn’t allowed.</td></tr><tr><td>400</td><td><code>InvalidHostHeaderException</code></td><td><p>host (String)</p></td><td>The host name is invalid. Not contained in the server allow list.</td></tr><tr><td>400</td><td><code>InvalidSearchFieldTypeException</code></td><td><p>field (String)</p><p>value (String)</p><p>type (String)</p></td><td>The type of the search value doesn’t match the expected field type.</td></tr><tr><td>400</td><td><code>InvalidVersionException</code></td><td></td><td>Version is missing or malformed in request URL.</td></tr><tr><td>400</td><td><code>MalformedLocaleException</code></td><td><p>locale (String)</p></td><td>The specified locale is malformed.</td></tr><tr><td>400</td><td><code>MalformedMediaTypeException</code></td><td><p>mediaType (String)</p></td><td>The media type in <emph>Content-Type</emph> header is malformed.</td></tr><tr><td>400</td><td><code>MalformedParameterException</code></td><td><p>parameter (String)</p><p>value (String)</p></td><td>A query, header, or path parameter value is malformed.</td></tr><tr><td>400</td><td><code>MalformedSelectorException</code></td><td><p>selector (String)</p></td><td>The syntax of the specified selector is malformed.</td></tr><tr><td>400</td><td><code>MissingClientIdException</code></td><td></td><td>No client id was provided, neither as query nor as header parameter.</td></tr><tr><td>400</td><td><code>NullConstraintViolationException</code></td><td><p>parameter (String)</p></td><td>The query or path parameter value is required, but value was null.</td></tr><tr><td>400</td><td><code>PropertyConstraintViolationException</code></td><td><p>document (String)</p><p>path (String)</p></td><td>The value constraint of a document property is violated.</td></tr><tr><td>400</td><td><code>PropertyNotPermittedException</code></td><td><p>property (String)</p><p>document (String)</p></td><td>A property in the given request document isn’t permitted to be modified.</td></tr><tr><td>400</td><td><code>QuerySearchTypesNomatchException</code></td><td><p>field1 (String)</p><p>field2 (String)</p><p>type1 (String)</p><p>type2 (String)</p></td><td>The fields in the specified query don't have the same type.</td></tr><tr><td>400</td><td><code>QuotaExceededException</code></td><td><p>msg (String)</p></td><td>A platform quota constraint is violated.</td></tr><tr><td>400</td><td><code>RangeFilterTypeException</code></td><td><p>field (String)</p><p>type (String)</p></td><td>The specified field type isn’t comparable in a range expression.</td></tr><tr><td>400</td><td><code>RangeFilterValueException</code></td><td><p>field (String)</p><p>value (String)</p></td><td>The specified value isn’t comparable in a range expression.</td></tr><tr><td>400</td><td><code>ResourcePathException</code></td><td><p>message (String)</p></td><td>The resource path was incorrect.</td></tr><tr><td>400</td><td><code>SearchOperatorNotApplicableException</code></td><td><p>operator (String)</p><p>field (String)</p></td><td>The specified search operator isn’t applicable for the search field.</td></tr><tr><td>400</td><td><code>StartAfterEndException</code></td><td><p>document (String)</p><p>resourceId (String)</p><p>startDate (DateTime)</p><p>endDate (DateTime)</p></td><td>The specified start date is greater than the end date.</td></tr><tr><td>400</td><td><code>StringConstraintViolationException</code></td><td><p>parameter (String)</p><p>expected (String)</p></td><td>The value constraint of a String query or path parameter is violated.</td></tr><tr><td>400</td><td><code>TermOperatorMismatchValuesException</code></td><td><p>field (String)</p><p>operator (String)</p></td><td>The search operator doesn't match the specified values.</td></tr><tr><td>400</td><td><code>TypeDecodingException</code></td><td><p>path (String)</p><p>expectedTypes (String)</p><p>actualType (String)</p></td><td>The type of a document property is invalid.</td></tr><tr><td>400</td><td><code>UnexpectedVersionException</code></td><td><p>version (String)</p></td><td>The version of the request document is invalid. It has to be the URL version.</td></tr><tr><td>400</td><td><code>UnknownLocaleException</code></td><td><p>locale (String)</p></td><td>The specified locale is unknown.</td></tr><tr><td>400</td><td><code>UnknownPropertyException</code></td><td><p>property (String)</p><p>document (String)</p></td><td>A property in the given request document is unknown.</td></tr><tr><td>400</td><td><code>UnknownSearchFieldException</code></td><td><p>field (String)</p></td><td>The search field is unknown.</td></tr><tr><td>400</td><td><code>UnknownSearchOperatorException</code></td><td><p>operator (String)</p></td><td>The specified search operator is unknown.</td></tr><tr><td>400</td><td><code>UnknownSiteIdException</code></td><td><p>siteId (String)</p></td><td>The site id provided for a site-specific property is unknown.</td></tr><tr><td>400</td><td><code>UnqueryableFieldException</code></td><td><p>field (String)</p></td><td>The specified search field in not queryable.</td></tr><tr><td>400</td><td><code>UnsupportedCurrencyException</code></td><td><p>currency (String)</p></td><td>The specified currency is invalid (must be ISO 4217) or not supported.</td></tr><tr><td>400</td><td><code>UnsupportedLocaleException</code></td><td><p>locale (String)</p></td><td>The specified locale isn’t supported/activated.</td></tr><tr><td>400</td><td><code>ValueConstraintViolationException</code></td><td><p>parameter (String)</p><p>expected (String)</p></td><td>The value constraint of a Non-String query or path parameter is violated.</td></tr><tr><td>401</td><td><code>AuthorizationHeaderMissingException</code></td><td></td><td><emph>Authorization</emph> header is missing.</td></tr><tr><td>401</td><td><code>DemoClientIdException</code></td><td><p>clientId (String)</p></td><td>Demo client ids aren’t allowed to be used on development, staging, or production instances. Demo client ids are permitted on sandbox instances only.</td></tr><tr><td>401</td><td><code>InvalidAccessTokenException</code></td><td><p>accessToken (String)</p></td><td>The OAuth access token sent via <emph>Authorization: Bearer</emph> header is invalid.</td></tr><tr><td>401</td><td><code>InvalidAuthorizationHeaderException</code></td><td></td><td>Invalid <emph>Authorization</emph> header. Value should be something like 'Bearer {access_token}'.</td></tr><tr><td>401</td><td><code>InvalidSecureTokenException</code></td><td></td><td>The session secure token is invalid. Session may have been hijacked.</td></tr><tr><td>401</td><td><code>UnauthorizedOriginException</code></td><td><p>origin (String)</p></td><td>The request origin isn’t authorized to perform the request.</td></tr><tr><td>401</td><td><code>UnauthorizedReadAccessException</code></td><td><p>method (String)</p><p>path (String)</p></td><td>The client application has no READ privileges for the resource.</td></tr><tr><td>401</td><td><code>UnauthorizedWriteAccessException</code></td><td><p>method (String)</p><p>path (String)</p></td><td>The client application has no WRITE privileges for the resource.</td></tr><tr><td>401</td><td><code>UnknownClientIdException</code></td><td><p>clientId (String)</p></td><td>No client application found for specified client id.</td></tr><tr><td>403</td><td><code>AccessWithoutUserForbiddenException</code></td><td></td><td>To access the resource an authenticated user is required.</td></tr><tr><td>403</td><td><code>ClientAccessForbiddenException</code></td><td><p>method (String)</p><p>path (String)</p></td><td>The current client isn’t authorized to access the resource.</td></tr><tr><td>403</td><td><code>OrganizationAccessForbiddenException</code></td><td></td><td>Global access via "/s/-/" is forbidden. Expected site-specific access via "/s/{site-id}/".</td></tr><tr><td>403</td><td><code>SecureCommunicationRequiredException</code></td><td></td><td>The request requires a secure connection (HTTPS).</td></tr><tr><td>403</td><td><code>SiteAccessForbiddenException</code></td><td><p>siteId (String)</p></td><td>Site-specific access via "/s/{site-id}/" is forbidden. Expected global access via "/s/-/".</td></tr><tr><td>403</td><td><code>SiteOfflineException</code></td><td><p>siteId (String)</p></td><td>Access to the offline site is forbidden.</td></tr><tr><td>403</td><td><code>UserAccessForbiddenException</code></td><td><p>method (String)</p><p>path (String)</p></td><td>The current user isn’t authorized to access the resource.</td></tr><tr><td>404</td><td><code>CurrencyNotFoundException</code></td><td><p>currencyId (String)</p></td><td>No currency found for specified mnemonic. Expected ISO 4217 mnemonic code.</td></tr><tr><td>404</td><td><code>ResourcePathNotFoundException</code></td><td><p>path (String)</p></td><td>The resource couldn’t be found in specified API and version.</td></tr><tr><td>404</td><td><code>UnknownSiteException</code></td><td><p>siteId (String)</p></td><td>No site found for specified site id.</td></tr><tr><td>404</td><td><code>VersionNotFoundException</code></td><td><p>version (String)</p></td><td>Version specified in URL is either unknown.</td></tr><tr><td>405</td><td><code>MethodNotAllowedException</code></td><td><p>method (String)</p></td><td>The HTTP method isn’t allowed.</td></tr><tr><td>406</td><td><code>CharsetNotAcceptableException</code></td><td><p>charset (String)</p></td><td>Unsupported charset in <emph>Accept-Charset</emph> header. Only UTF-8 is allowed.</td></tr><tr><td>409</td><td><code>IfMatchRequiredException</code></td><td></td><td><emph>If-Match</emph> header is required, but no one was provided.</td></tr><tr><td>409</td><td><code>ObjectInDeletionConflictException</code></td><td><p>objectId (String)</p></td><td>Object is already in (asynchronous) deletion.</td></tr><tr><td>409</td><td><code>ResourceStateConflictException</code></td><td><p>client (String)</p><p>server (String)</p></td><td>A state token was sent with the request and doesn’t match the object's state on server side.</td></tr><tr><td>412</td><td><code>InvalidIfMatchException</code></td><td><p>ifMatch (String)</p></td><td>The If-Match header entity tag is invalid or out-dated.</td></tr><tr><td>413</td><td><code>RequestEntityTooLargeException</code></td><td></td><td>Request body size limit of 5 MB has been exceeded.</td></tr><tr><td>415</td><td><code>UnsupportedContentTypeException</code></td><td><p>contentType (String)</p></td><td>Unsupported media type in <emph>Content-Type</emph> header. Only 'application/json', 'application/xml' and 'text/xml' are allowed.</td></tr><tr><td>415</td><td><code>UnsupportedFormatException</code></td><td><p>format (String)</p></td><td>Unsupported format in <emph>format</emph> query parameter. Only 'json' and 'xml' are allowed.</td></tr></tbody></table></sfdocstbl>
