This page lists the possible error codes returned by the Unwanted Traffic API, along with their meanings and example responses. All error responses are in JSON format with a status of "error" and a message describing the issue.
The API uses standard HTTP status codes to indicate errors. The table below summarizes the possible error codes:
| HTTP Status Code | Meaning | Description |
|---|---|---|
| 400 | Bad Request | The request is malformed or contains invalid parameters. |
| 401 | Unauthorized | The API key is missing or invalid. |
| 403 | Forbidden | The API key does not have permission to access the requested resource. |
| 404 | Not Found | The requested resource (e.g., session, attempt, or malware record) does not exist. |
| 429 | Too Many Requests | The rate limit has been exceeded (100 requests/minute for most endpoints, 50 requests/minute for /sessions, /attempts, /malware). |
| 500 | Internal Server Error | An unexpected server error occurred. |
Below are example error responses for each error code.
Returned when the request contains invalid parameters, such as an incorrectly formatted filter or missing required fields.
Example Response:
{
"status": "error",
"message": "Invalid filter format: JSON parsing error"
}
Returned when the X-API-Key header is missing or the provided API key is invalid.
Example Response:
{
"status": "error",
"message": "Invalid or missing API key"
}
Returned when the API key does not have permission to access the requested endpoint or resource.
Example Response:
{
"status": "error",
"message": "Access forbidden: Insufficient permissions"
}
Returned when the requested resource (e.g., a specific session, attempt, or malware record) does not exist.
Example Response:
{
"status": "error",
"message": "Session not found"
}
Returned when the rate limit is exceeded. The response may include a Retry-After header indicating when to retry.
Example Response:
{
"status": "error",
"message": "Rate limit exceeded. Please try again later."
}
Returned when an unexpected server error occurs. Contact the API administrator if this persists.
Example Response:
{
"status": "error",
"message": "Internal server error. Please try again later."
}
To handle errors effectively:
status field in the response. If it is "error", inspect the message for details.429 errors, implement exponential backoff or respect the Retry-After header.X-API-Key header is included and valid to avoid 401 errors.400 errors.500 errors, contact the API administrator.