Home · Developers · Guides · API Error Codes

APIs

API Error Codes

Error shapes and status codes

This document provides a comprehensive reference for all error codes used in the Nova Coder API.

Error Response Format

All error responses follow a standardized format:

{
  "success": false,
  "error": "Error message description",
  "error_code": "ERROR_CODE",
  "details": {}
}

Error Codes by Category

Application Errors

Error Code HTTP Status Description
APP_NOT_RUNNING 503 The Nova Coder application is not running. Start the application before making API requests.
SERVICE_UNAVAILABLE 503 A required service is not available.

Authentication & Authorization Errors

Error Code HTTP Status Description
UNAUTHORIZED 401 Authentication required or invalid credentials.
FORBIDDEN 403 User does not have permission to perform this action.
INVALID_TOKEN 401 The provided authentication token is invalid.
TOKEN_EXPIRED 401 The authentication token has expired.

Request Validation Errors

Error Code HTTP Status Description
INVALID_REQUEST 400 The request is invalid or missing required parameters.
INVALID_PAGINATION 400 Pagination parameters are invalid.
INVALID_RATING 400 Rating must be between 1 and 5.
INVALID_FIELDS 400 Invalid field names in field selection.

Resource Not Found Errors

Error Code HTTP Status Description
AGENT_NOT_FOUND 404 The specified agent does not exist.
JOB_NOT_FOUND 404 The specified job does not exist.
DATASET_NOT_FOUND 404 The specified dataset does not exist.
DASHBOARD_NOT_FOUND 404 The specified dashboard does not exist.
THREAT_NOT_FOUND 404 The specified security threat does not exist.
RULE_NOT_FOUND 404 The specified alert rule does not exist.
ALERT_NOT_FOUND 404 The specified alert does not exist.
WEBHOOK_NOT_FOUND 404 The specified webhook does not exist.

AI Service Errors

Error Code HTTP Status Description
AI_SERVICE_NOT_AVAILABLE 503 The AI service is not available.
MULTIMODAL_ERROR 500 Error processing multimodal request.
BATCH_ERROR 500 Error processing batch request.
ERROR_HANDLING_ERROR 500 Error in error handling system.
FINE_TUNING_ERROR 500 Error in fine-tuning operation.

Security Errors

Error Code HTTP Status Description
SECURITY_NOT_AVAILABLE 503 Security service is not available.
SECURITY_ERROR 500 Error in security operation.

Monitoring Errors

Error Code HTTP Status Description
MONITORING_ERROR 500 Error in monitoring operation.
MONITORING_NOT_AVAILABLE 503 Monitoring service is not available.

Agent Marketplace Errors

Error Code HTTP Status Description
MARKETPLACE_ERROR 500 Error in agent marketplace operation.
INSTALLATION_ERROR 500 Error installing agent from marketplace.
RATING_ERROR 500 Error submitting agent rating.

Gateway Errors

Error Code HTTP Status Description
GATEWAY_STATUS_ERROR 500 Error retrieving gateway status.
GATEWAY_METRICS_ERROR 500 Error retrieving gateway metrics.
GATEWAY_SERVICE_ERROR 500 Error retrieving gateway service status.
GATEWAY_CONFIG_ERROR 500 Error configuring gateway.
GATEWAY_ROUTE_ERROR 500 Error adding gateway route.
GATEWAY_SERVICE_REGISTER_ERROR 500 Error registering gateway service.

Tools Errors

Error Code HTTP Status Description
TOOLS_ERROR 500 Error in tools operation.

Dashboard Errors

Error Code HTTP Status Description
DASHBOARD_ERROR 500 Error in dashboard operation.

Rate Limiting Errors

Error Code HTTP Status Description
RATE_LIMIT_EXCEEDED 429 Rate limit has been exceeded.

CSRF Errors

Error Code HTTP Status Description
CSRF_TOKEN_MISSING 403 CSRF token is missing from request.
CSRF_TOKEN_INVALID 403 CSRF token is invalid.

HTTP Status Codes

Status Code Description
200 Success
400 Bad Request - Invalid request parameters
401 Unauthorized - Authentication required
403 Forbidden - Permission denied
404 Not Found - Resource not found
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error - Server error
503 Service Unavailable - Service not running

Error Handling Best Practices

  1. Always Check success Field: The success boolean field indicates whether the request succeeded.
  2. Handle Error Codes: Use the error_code field to programmatically handle specific error conditions.
  3. Log Error Details: The details field may contain additional debugging information.
  4. Implement Retry Logic: For 5xx errors, implement exponential backoff retry logic.
  5. Validate Input: Check request parameters before sending to avoid 400 errors.
  6. Handle Rate Limits: Implement proper handling for 429 errors with appropriate backoff.

Example Error Handling

import requests

response = requests.get("http://localhost:8000/api/agents")
data = response.json()

if not data.get("success"):
    error_code = data.get("error_code")
    error_message = data.get("error")
    
    if error_code == "APP_NOT_RUNNING":
        print("Application not running. Please start the application.")
    elif error_code == "RATE_LIMIT_EXCEEDED":
        print("Rate limit exceeded. Please wait before retrying.")
    elif error_code == "AGENT_NOT_FOUND":
        print("Agent not found. Please check the agent name.")
    else:
        print(f"Error: {error_message} (Code: {error_code})")
else:
    print("Request successful!")

Source: wiki/api-error-codes.md · rendered 2026-11-10