# Errors

Swish uses conventional [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) to indicate the success or failure of an API request. As a general rule:

* Status codes in the **`2xx`** range indicate success.
* Status codes in the **`4xx`** range indicate incorrect or incomplete parameters (e.g. a required parameter was omitted).
* Status codes in the **`5xx`** range indicate an error with Swish's servers.

Swish also outputs an error response formatted in JSON:

```json
{
  "error": {
    "message": "Item with ID 123 not found.",​
    "error": "Not Found",
    "statusCode": 404,​
    "requestId": "123e4567-e89b-12d3-a456-426614174000"
  }
}
```


---

# 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://developers.swish.app/swish-api/errors.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.
