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

# Errors

> The status codes the ReferRush API returns and what to do about each one.

The API uses standard HTTP status codes. A `2xx` code means the request worked, a `4xx` code means something in the request needs fixing, and a `5xx` code means something went wrong on our side.

Every error response has the same shape:

```json theme={null}
{
  "success": false,
  "message": "Customer not found",
  "data": null
}
```

## Status codes

| Code | Message | What it means |
| - | - | - |
| `200` | `Customer fetched successfully` | The request worked. |
| `400` | `Phone number or email is required` | Neither a valid phone number nor an email was passed. |
| `401` | `Auth API Key is missing or invalid` | The `Authorization` header is missing, or the key is wrong or revoked. |
| `404` | `Customer not found` | No customer in your store matches the phone number or email. |
| `405` | `Method not allowed` | The request used a method other than `GET`. |
| `429` | `Too many requests` | You've hit the rate limit. Wait for the seconds in the `Retry-After` header, then try again. |
| `500` | Varies | Something went wrong on our side. Try again in a moment. |

## Handling errors

> [accordion] 401 Unauthorized
>
> Check that the header is exactly `Authorization: Bearer <your key>`, with a single space after `Bearer`. Then open **Settings → API Keys** in your dashboard and check that the key is still **Active**. If you can't find the full key, create a new one and revoke the old one. A key can't be shown again after it's created.

> [accordion] 429 Too Many Requests
>
> Each key can make up to 60 requests a minute. Read the `Retry-After` header and wait that many seconds before you retry. Many requests with invalid keys from the same IP address are also blocked until the minute ends.

> [accordion] 500 Internal Server Error
>
> Retry after a short wait. If it keeps failing, contact ReferRush support with the time of the request.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.