> ## Documentation Index
> Fetch the complete documentation index at: https://help.mytruv.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> API error codes and handling guidance

## HTTP response codes

The MyTruv API uses conventional HTTP response codes to indicate the success or failure of a request. Codes in the `2xx` range indicate success, codes in the `4xx` range indicate an error with the information provided, and codes in the `5xx` range indicate a server error.

| Code  | Title                 | Description                         |
| ----- | --------------------- | ----------------------------------- |
| `200` | OK                    | Request successful                  |
| `401` | Unauthorized          | Invalid or missing credentials      |
| `404` | Not Found             | Resource does not exist             |
| `422` | Unprocessable Entity  | Valid JSON but invalid field values |
| `429` | Too Many Requests     | Rate limit exceeded                 |
| `500` | Internal Server Error | Something went wrong on our servers |

***

## Error response format

When an error occurs, the API returns a JSON object with a `detail` field containing a human-readable error message.

### Standard error

```json theme={null}
{
  "detail": "Link not found"
}
```

### Validation error

```json theme={null}
{
  "detail": [
    {
      "type": "missing",
      "loc": ["query", "transacted_at_from"],
      "msg": "Field required",
      "input": null
    }
  ]
}
```

***

## Retry guidance

| Status              | Retry? | Strategy                                                            |
| ------------------- | ------ | ------------------------------------------------------------------- |
| `401`, `404`, `422` | No     | Fix the request (client error)                                      |
| `429`               | Yes    | Wait for `Retry-After` seconds, then retry with exponential backoff |
| `500`               | Yes    | Retry up to 3 times with exponential backoff                        |

***

## Next steps

<div className="mytruv-card-grid">
  <a className="mytruv-card" href="/api-reference/overview">
    <span className="mytruv-card__icon">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round">
        <path d="M4 19.5A2.5 2.5 0 016.5 17H20" />

        <path d="M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z" />
      </svg>
    </span>

    <h3 className="mytruv-card__title">API Overview</h3>
    <p className="mytruv-card__body">Authentication and available endpoints</p>

    <span className="mytruv-card__arrow">
      <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
        <path d="M7 17L17 7" />

        <path d="M8 7h9v9" />
      </svg>
    </span>
  </a>

  <a className="mytruv-card" href="/api-reference/pagination">
    <span className="mytruv-card__icon">
      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.75" strokeLinecap="round" strokeLinejoin="round">
        <path d="M5 12h14" />

        <path d="M12 5l7 7-7 7" />
      </svg>
    </span>

    <h3 className="mytruv-card__title">Pagination</h3>
    <p className="mytruv-card__body">How to paginate through large result sets</p>

    <span className="mytruv-card__arrow">
      <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
        <path d="M7 17L17 7" />

        <path d="M8 7h9v9" />
      </svg>
    </span>
  </a>
</div>
