> ## Documentation Index
> Fetch the complete documentation index at: https://orwel-22af1265.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Error Handling

> Understanding and handling API errors

## Error Response Format

```json theme={null}
{
  "error": "error_code",
  "message": "Human readable message",
  "details": {}
}
```

## HTTP Status Codes

<ResponseField name="400" type="Bad Request">
  Invalid request parameters
</ResponseField>

<ResponseField name="401" type="Unauthorized">
  Invalid or missing API key
</ResponseField>

<ResponseField name="404" type="Not Found">
  Resource not found
</ResponseField>

<ResponseField name="429" type="Too Many Requests">
  Rate limit exceeded
</ResponseField>

<ResponseField name="500" type="Internal Server Error">
  Server error
</ResponseField>

## Example Error Handling

```javascript theme={null}
try {
  const response = await fetch('/api/v1/leads');
  
  if (!response.ok) {
    const error = await response.json();
    console.error(error.message);
  }
} catch (error) {
  console.error('Network error:', error);
}
```
