Skip to Content
APIErrors

Error Codes

Reference for API error responses.

Error Response Format

All errors return JSON with the following structure:

{ "success": false, "error": { "code": "ERROR_CODE", "message": "Human-readable description" } }

HTTP Status Codes

StatusCodeDescription
400BAD_REQUESTInvalid request format or missing required fields
401UNAUTHORIZEDMissing or invalid API key
403FORBIDDENAPI key doesn’t have permission for this operation
413PAYLOAD_TOO_LARGEFile exceeds maximum size limit (10MB)
415UNSUPPORTED_TYPEFile type not supported for scanning
429RATE_LIMITEDToo many requests, check Retry-After header
500INTERNAL_ERRORServer error, please retry or contact support

Example Error Responses

Invalid API Key

{ "success": false, "error": { "code": "UNAUTHORIZED", "message": "Invalid or expired API key" } }

Rate Limited

{ "success": false, "error": { "code": "RATE_LIMITED", "message": "Rate limit exceeded. Please retry later." } }

Response headers include:

HeaderDescription
Retry-AfterSeconds until you can retry
X-RateLimit-LimitRequests allowed per minute
X-RateLimit-RemainingRequests remaining in window

File Too Large

{ "success": false, "error": { "code": "PAYLOAD_TOO_LARGE", "message": "File exceeds 10MB limit" } }

Unsupported File Type

{ "success": false, "error": { "code": "UNSUPPORTED_TYPE", "message": "File type '.exe' is not supported" } }

Handling Errors

Best practices for error handling:

import requests response = requests.post( "https://api.inkog.io/api/v1/scan", headers={"Authorization": "Bearer YOUR_API_KEY"}, files={"file": open("agent.py", "rb")} ) if response.status_code == 429: retry_after = int(response.headers.get("Retry-After", 60)) print(f"Rate limited. Retry in {retry_after} seconds") elif response.status_code == 401: print("Check your API key") elif not response.ok: error = response.json().get("error", {}) print(f"Error: {error.get('message')}") else: result = response.json() print(f"Found {result['findings_count']} issues")
Last updated on