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

# Error Handling

> Learn how to handle API errors

The GoSentrix API uses standard HTTP status codes and returns detailed error information.

## HTTP Status Codes

| Code  | Meaning               |
| ----- | --------------------- |
| `200` | Success               |
| `201` | Created               |
| `204` | No Content            |
| `400` | Bad Request           |
| `401` | Unauthorized          |
| `403` | Forbidden             |
| `404` | Not Found             |
| `409` | Conflict              |
| `422` | Unprocessable Entity  |
| `429` | Too Many Requests     |
| `500` | Internal Server Error |

## Error Response Format

All errors follow this format:

<ResponseExample>
  ```json theme={null}
  {
    "error": {
      "code": "invalid_request",
      "message": "The request is invalid",
      "details": {
        "field": "email",
        "reason": "Invalid email format"
      }
    }
  }
  ```
</ResponseExample>

## Common Error Codes

See [Error Codes Reference](/reference/error-codes) for a complete list.

## Rate Limiting Errors

When rate limited, the response includes retry information:

<ResponseExample>
  ```json theme={null}
  {
    "error": {
      "code": "rate_limit_exceeded",
      "message": "Too many requests",
      "retry_after": 60
    }
  }
  ```
</ResponseExample>

## Best Practices

* Always check HTTP status codes
* Parse error responses for user-friendly messages
* Implement exponential backoff for retries
* Log errors for debugging
* Handle rate limits gracefully
