# Error handling

All errors reported by the [REST API](/developer-resources/rest-api.md) have an [HTTP status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) and follow the standard format.&#x20;

When an error occurs, the response body usually contains a JSON object with the following fields:

{% code lineNumbers="true" %}

```json
{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "Bad Request",
  "status": 400,
  "detail": "One or more validation errors occurred.",
  "traceId": "00-9e02a91b64ac56904703a3a69ea9101d-56be90a29d0b0b25-00",
  "errors": {
    "mistake": [
      "Unknown expression group."
    ]
  }
}
```

{% endcode %}

* **type** - \[string] A URI reference that identifies the error type, providing a consistent way to categorize errors across different API implementations.
* **title** - \[string] A human-readable title or summary of the error.
* **status** - \[number] The HTTP status code associated with the error.
* **detail** - (Optional) \[string] A detailed human-readable description of the error, providing additional information to help clients understand the issue.
* **instance** - (Optional) \[string] A URI reference that identifies the specific occurrence of the error, useful for debugging or tracing purposes.
* **traceId** - (Optional) \[string] A unique identifier to trace requests in logs.
* **errors** - (Optional) \[key-value] A collection of errors detected by validation logic.

### Common errors

The following table lists some of the common errors:

<table><thead><tr><th width="219">HTTP status</th><th>Description</th></tr></thead><tbody><tr><td><strong>401</strong> Unauthorized</td><td>This means the request lacks valid authentication credentials for the target resource. Check if the Authorization header is present and contains a valid token value.</td></tr><tr><td><strong>403</strong> Forbidden</td><td>The server understands the request but refuses to authorize it.</td></tr><tr><td><strong>404</strong> Not Found</td><td>The requested resource couldn't be found on the server.</td></tr><tr><td><strong>409</strong> Conflict</td><td>The request couldn't be completed due to a conflict with the current state of the resource.</td></tr><tr><td><strong>415</strong> Unsupported Media Type</td><td>The server refuses the request because the payload format isn't supported.</td></tr><tr><td><strong>500</strong> Internal Server Error</td><td>The server encountered an unexpected condition that prevented it from fulfilling the request.</td></tr><tr><td><strong>501</strong> Not Implemented</td><td>The server doesn't support the functionality required to fulfill the request.</td></tr><tr><td><strong>504</strong> Gateway Timeout</td><td>The server, while acting as a gateway or proxy, didn't receive a timely response from an upstream server.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.platform.softwareone.com/developer-resources/rest-api/errors-handling.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
