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

# Errors

> Standard error codes and handling

## Error format

All errors return a consistent JSON structure:

```json theme={null}
{
  "error": "Unauthorized",
  "message": "Invalid or missing API key",
  "status": 401
}
```

## Status codes

| Code  | Name                  | Description                |
| ----- | --------------------- | -------------------------- |
| `200` | OK                    | Request successful         |
| `400` | Bad Request           | Invalid parameters         |
| `401` | Unauthorized          | Missing or invalid API key |
| `404` | Not Found             | Resource not found         |
| `429` | Too Many Requests     | Rate limit exceeded        |
| `500` | Internal Server Error | Server-side error          |
| `503` | Service Unavailable   | Temporary maintenance      |

## Handling errors

<CodeGroup>
  ```javascript Node.js theme={null}
  try {
    const response = await fetch('https://api.fieldfunded.com/v1/events', {
      headers: { 'X-API-Key': 'YOUR_API_KEY' }
    });
    
    if (!response.ok) {
      const error = await response.json();
      console.error(`Error ${error.status}: ${error.message}`);
      return;
    }
    
    const data = await response.json();
  } catch (err) {
    console.error('Network error:', err);
  }
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.fieldfunded.com/v1/events',
      headers={'X-API-Key': 'YOUR_API_KEY'}
  )

  if response.status_code != 200:
      error = response.json()
      print(f"Error {error['status']}: {error['message']}")
  else:
      data = response.json()
  ```
</CodeGroup>

<CardGroup cols={2}>
  <Card title="Quick Start Guide" icon="play" href="/quickstart">
    Get started with error handling best practices
  </Card>

  <Card title="SDK Reference" icon="npm" href="/sdk">
    SDK handles errors and retries automatically
  </Card>

  <Card title="Authentication" icon="key" href="/authentication">
    Fix 401 errors — API key setup guide
  </Card>

  <Card title="Rate Limits" icon="gauge" href="/rate-limits">
    Fix 429 errors — understand your quota
  </Card>
</CardGroup>
