API Error Codes
This reference documents all error codes returned by the IronWiFi REST API, their meanings, and how to resolve them. Use this guide when your API integration encounters an error response.
Error Response Format
All API errors return a JSON response with a consistent structure:
| Field | Type | Description |
|---|---|---|
| boolean | Always |
| string | Description of what went wrong |
| integer | HTTP status code matching the response status |
Some error responses include additional fields for more context:
HTTP Status Codes
2xx Success
| Code | Meaning | When Returned |
|---|---|---|
| Request succeeded | GET, PUT, DELETE operations |
| Resource created | POST operations that create new resources |
| Request succeeded, no response body | DELETE operations |
4xx Client Errors
| Code | Meaning | Common Cause |
|---|---|---|
| Invalid request data | Missing required fields, invalid format |
| Authentication failed | Missing, invalid, or expired API key |
| Insufficient permissions | API key lacks access to the requested resource |
| Resource does not exist | Incorrect resource ID or endpoint URL |
| HTTP method not supported | Using POST on a GET-only endpoint |
| Resource conflict | Duplicate username, conflicting update |
| Valid JSON but invalid content | Business logic validation failure |
| Rate limit exceeded | Too many requests in the current window |
5xx Server Errors
| Code | Meaning | Action |
|---|---|---|
| Unexpected server error | Retry after a delay; contact support if persistent |
| Upstream service unavailable | Retry after a delay |
| Service temporarily down | Retry after a delay; check status.ironwifi.com |
| Request timed out | Retry with a simpler query or smaller payload |
Detailed Error Reference
400 Bad Request
The request body is malformed or missing required fields.
Examples:
How to fix:
- Verify all required fields are included in the request body
- Check that field values match the expected format
- Validate your JSON syntax before sending
- Ensure header is set
Content-Type: application/json
401 Unauthorized
Authentication failed. The API key is missing, invalid, or expired.
How to fix:
- Verify the header is present
Authorization: Bearer YOUR_API_KEY - Check that the API key is correct (no extra spaces or truncated characters)
- Generate a new API key if the current one may be compromised
- See API Authentication for key management
403 Forbidden
The API key is valid but does not have permission to access the requested resource.
How to fix:
- Verify the API key has the required permissions
- Check that you are accessing resources within your account scope
- Contact your account administrator if you need elevated permissions
404 Not Found
The requested resource does not exist.
How to fix:
- Verify the resource ID is correct
- Check the endpoint URL for typos
- Confirm the resource has not been deleted
- List resources first to find the correct ID:
409 Conflict
The request conflicts with the current state of a resource.
How to fix:
- For duplicate usernames: use a different username or update the existing user
- For concurrent updates: fetch the current state and retry with the latest data
- Check for existing resources before creating new ones
422 Unprocessable Entity
The request is syntactically valid JSON but fails business logic validation.
How to fix:
- Review the array for specific field-level errors
details - Check value ranges and constraints in the API Endpoints documentation
- Ensure numerical values are positive integers where required
- Verify RADIUS attribute names and operators are valid
429 Too Many Requests
You have exceeded the API rate limit.
The response includes a
Retry-After
Retry-After: 45
How to fix:
- Wait for the duration specified in the header
Retry-After - Implement exponential backoff in your client
- Reduce request frequency
- Use bulk operations where available
- See Rate Limiting for limits and best practices
500 Internal Server Error
An unexpected error occurred on the server.
How to fix:
- Retry the request after a short delay (30-60 seconds)
- If the error persists, check status.ironwifi.com for incidents
- Contact support@ironwifi.com with the request details and timestamp
Error Handling Best Practices
Implement retry logic
For transient errors (429, 500, 502, 503, 504), implement automatic retries with exponential backoff:
Validate before sending
Reduce errors by validating data before making API calls:
Log errors for debugging
Always log API errors with enough context to diagnose issues:
RADIUS-Specific Error Codes
When working with RADIUS authentication via the API, you may encounter these RADIUS-specific reject reasons in reports and webhook payloads:
| Reject Reason | Meaning | Resolution |
|---|---|---|
| Username or password incorrect | Verify user credentials in the Console |
| Account is deactivated | Enable the user account |
| Valid-To date has passed | Update the user's validity dates |
| Outside allowed login hours | Check Login-Time attribute |
| Simultaneous-Use limit reached | Wait for existing session to end or increase limit |
| Username not found | Create the user or check for typos |
Related Topics
- REST API -- API overview and base URLs
- API Authentication -- API key management
- API Endpoints -- Complete endpoint reference
- Rate Limiting -- Rate limits and quotas
- Webhooks -- Webhook event reference
- Troubleshooting -- General troubleshooting guide
Was this page helpful?