success: false- an error message describing the issue
Error Response Format
Common Error Scenarios
Unauthorized Request
Occurs when the API key is missing or invalid.- verify that
x-api-keyheader is included - ensure the API key is correct and active
Invalid Request
Occurs when the request body is incorrect or missing required fields.- ensure the request body contains a valid
urlfield - validate input before sending the request
Scan Failure
Occurs when the system is unable to complete the scan.- retry the request after a short delay
Timeout or Delayed Response
In some cases, complex pages may take longer to process. How to handle:- implement request timeout handling in your application
- allow retries if needed
HTTP Status Codes
| Status Code | Meaning |
|---|---|
| 200 | Request processed (success or scan result returned) |
| 400 | Bad request (invalid input) |
| 401 | Unauthorized (invalid or missing API key) |
| 500 | Internal server error |
Best Practices for Handling Errors
- always check the
successfield before using response data - handle authentication errors separately
- retry failed or timed-out requests when appropriate
- avoid assuming a failed request means the URL is safe

