# List error codes

> Every public error code with its type, HTTP status, meaning and fix.

`GET https://api.refabric.com/v1/errors`

**Authentication.** No key: the reference is the same for every reader and shows nothing of an account.

**Common use cases**

- Map each error `code` to what your integration does next.

**See also**

- `GET /v1/account/metrics`

Authentication: none — this operation needs no key.

## Header parameters

- `Refabric-Version` (string, _optional_, format: date) — The contract version you wrote against (a date). Absent: the current version.
- `X-Request-ID` (string, _optional_, max length 128) — Your own id for this request; we answer it back under X-Client-Request-ID.

## Response 200

Done: the answer is in the body.

- `items` (array<object>, _required_) — The codes.
  - `code` (string, _required_) — The code.
    Example: `invalid_request`
  - `type` (string, _required_) — What kind of failure an error is — each code belongs to one.
    Values: `invalid_request` (The request cannot be used as sent; fix it and send again.); `authentication` (No valid API key was sent.); `permission` (Your key or your plan does not allow this.); `not_found` (Nothing of yours has this address, or it was removed.); `conflict` (The request conflicts with the current state of what it names.); `insufficient_credits` (Your balance does not cover this request.); `rate_limited` (Too many requests; wait and retry.); `content_refused` (The inputs were refused.); `processing_failed` (The job ran and failed.); `internal` (Something went wrong on our side.); `warning` (Not an error: a note on a job that succeeded.)
    Example: `invalid_request`
  - `http_status` (integer, _required_) — The status it is answered with.
    Example: `422`
  - `message` (string, _required_) — What it means.
    Example: `A field is missing.`
  - `fix` (string, _required_) — How to fix it.
    Example: `Correct the field and send again.`
  - `retryable` (boolean, _required_) — Whether the same request may succeed later.
    Example: `false`
  - `docs` (string | null, _optional_) — The code's page in the docs. Every error answered with this code carries the same link in its `docs`; absent when the code has no docs page.
  - `ctx` (array<object> | null, _optional_) — The facts its `ctx` may carry.
    - `name` (string, _required_) — The key in `ctx`.
      Example: `required`
    - `type` (string, _required_) — Its JSON type.
      Example: `integer`
    - `description` (string, _required_) — What it says.
      Example: `The credits needed.`

```json
{
  "items": []
}
```

## Response 401

No valid API key was sent.

```json
{
  "error": {
    "code": "string",
    "type": "invalid_request",
    "message": "string",
    "field": "string",
    "retryable": true,
    "docs": "string",
    "request_id": "string",
    "ctx": {
      "required": 0,
      "balance": 0,
      "retry_after": 0
    },
    "input": null,
    "job_id": "string",
    "required": 0,
    "balance": 0
  }
}
```

## Response 403

Your key or your plan does not allow this.

```json
{
  "error": {
    "code": "string",
    "type": "invalid_request",
    "message": "string",
    "field": "string",
    "retryable": true,
    "docs": "string",
    "request_id": "string",
    "ctx": {
      "required": 0,
      "balance": 0,
      "retry_after": 0
    },
    "input": null,
    "job_id": "string",
    "required": 0,
    "balance": 0
  }
}
```

## Response 429

Too many requests: wait for the number of seconds in the Retry-After header.

```json
{
  "error": {
    "code": "string",
    "type": "invalid_request",
    "message": "string",
    "field": "string",
    "retryable": true,
    "docs": "string",
    "request_id": "string",
    "ctx": {
      "required": 0,
      "balance": 0,
      "retry_after": 0
    },
    "input": null,
    "job_id": "string",
    "required": 0,
    "balance": 0
  }
}
```

## Response 500

Something went wrong on our side; retry, and quote the request id if it keeps happening.

```json
{
  "error": {
    "code": "string",
    "type": "invalid_request",
    "message": "string",
    "field": "string",
    "retryable": true,
    "docs": "string",
    "request_id": "string",
    "ctx": {
      "required": 0,
      "balance": 0,
      "retry_after": 0
    },
    "input": null,
    "job_id": "string",
    "required": 0,
    "balance": 0
  }
}
```

## Request

```python
import requests

url = "https://api.refabric.com/v1/errors"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.refabric.com/v1/errors';
const options = {method: 'GET'};

try {
    const response = await fetch(url, options);
    const data = await response.json();
    console.log(data);
} catch (error) {
    console.error(error);
}
```

```bash
curl --request GET \
    --url https://api.refabric.com/v1/errors
```
