# Error Handling

Actionable failure conditions, covered in detail in their relevant sections, are reported as part of 4xx responses in a JSON response body. One or more errors will be returned in the following format:

```json
{
  "errors": [
    {
      "code": "<error identifier>",
      "message": "<message describing condition>",
      "detail": "<unstructured>"
    }
  ]
}
```

* The code field will be a unique identifier, all caps with underscores by convention.
* The message field will be a human-readable string.
* The optional detail field may contain arbitrary JSON data providing information the client can use to resolve the issue. While the client can take action on certain error codes, the registry may add new error codes over time. All client implementations should treat unknown error codes as `UNKNOWN`, allowing future error codes to be added without breaking API compatibility. For the purposes of the specification, error codes will only be added and never removed.

#### Errors

The error codes encountered via the API are enumerated in the following table:

| Code             | Message                 | Description                                                               |
| ---------------- | ----------------------- | ------------------------------------------------------------------------- |
| UNKNOWN          | unknown error           | Generic error returned when the error does not have an API classification |
| VALIDATE\_FAILED | field validation failed | This error code may be returned if a field validation fails.              |


---

# 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://support.portsip.com/development-portsip/rest-apis/version-22.3/get-started/error-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.
