# Errors

Requests made to our APIs can result in several different error responses. The following document describes error values.

## Properties

The `Error` has the following properties:

| Property  | Type     | Description                                                      |
| --------- | -------- | ---------------------------------------------------------------- |
| `code`    | `string` | Error code constant represented as a string                      |
| `message` | `string` | Error message depending on the type of error and an API resource |

## Error Types

| Code               | Name                 | HTTP Status Code | Description                              |
| ------------------ | -------------------- | ---------------- | ---------------------------------------- |
| `invalid_input`    | InvalidParamError    | `400`            | Invalid client input parameters          |
| `unauthorized`     | UnauthorizedError    | `401`            | Client is not authorized                 |
| `access_denied`    | AccessDeniedError    | `403`            | `Entity` or resource access is forbidden |
| `not_found`        | NotFoundError        | `404`            | `Entity` not found                       |
| `duplicate_entity` | DuplicateEntityError | `409`            | `Entity` already exist                   |

## Example

```bash
curl -X 'GET' \
  'https://api.testnet.cspr.cloud/accounts/invalid_identifier' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
```

```json
{
  "error": {
    "code": "invalid_input",
    "message": "AccountHash identifier is not a valid account hash or public key"
  }
}
```

## Rate limiting errors

Visit the [Rate limits and quotas](https://docs.cspr.cloud/1.2.x/documentation/overview/rate-limits-and-quotas) for more information regarding Rate limiting errors.


---

# 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.cspr.cloud/1.2.x/documentation/overview/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.
