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

# Errors

> Understanding SureFeedback API error responses.

All API responses follow a consistent structure. On failure, the `success` field is `false` and an error message is included.

## Error response structure

```json theme={null}
{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "email": ["The email field is required."]
  }
}
```

## HTTP status codes

| Status | Meaning                                              |
| ------ | ---------------------------------------------------- |
| `200`  | Success                                              |
| `201`  | Resource created                                     |
| `400`  | Bad request — missing or invalid parameters          |
| `401`  | Unauthenticated — missing or invalid token           |
| `403`  | Forbidden — valid token but insufficient permissions |
| `404`  | Resource not found                                   |
| `422`  | Validation error — request data failed validation    |
| `429`  | Rate limited                                         |
| `500`  | Server error                                         |

## Validation errors

When validation fails, the response includes a field-level `errors` object:

```json theme={null}
{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "email": ["The email field must be a valid email address."],
    "password": ["The password must be at least 8 characters."]
  }
}
```

## Error codes

Some endpoints return a machine-readable `error_code` for programmatic handling:

| Code                    | Meaning                                  |
| ----------------------- | ---------------------------------------- |
| `INVALID_CREDENTIALS`   | Email or password is incorrect           |
| `ACCOUNT_BLOCKED`       | Account has been suspended               |
| `INVALID_TOKEN`         | JWT or reset token is invalid or expired |
| `VALIDATION_ERROR`      | Request data failed validation           |
| `INVITATION_NOT_FOUND`  | Invitation token does not exist          |
| `INTERNAL_SERVER_ERROR` | Unexpected server error                  |
