{
    "schemes": [],
    "swagger": "2.0",
    "info": {
        "description": "ClamAV-based antivirus scanning API. Authenticate with X-API-Key, then scan files (multipart) or raw streams.\nFurther reading: https://github.com/isg-global/cen-avapi-engine-app",
        "title": "AV Scan API",
        "contact": {},
        "version": "1.0.2"
    },
    "host": "",
    "basePath": "/",
    "paths": {
        "/health": {
            "get": {
                "description": "Service health: in-flight scan count and cached ClamAV status.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "System"
                ],
                "summary": "Health check",
                "responses": {
                    "200": {
                        "description": "Healthy",
                        "schema": {
                            "$ref": "#/definitions/main.HealthResponse"
                        }
                    },
                    "503": {
                        "description": "ClamAV unreachable",
                        "schema": {
                            "$ref": "#/definitions/main.HealthResponse"
                        }
                    }
                }
            }
        },
        "/v1/AVScan/ScanFile": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Scan a file (multipart). Legacy alias for ScanFile2.",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Scanning"
                ],
                "summary": "Scan file (legacy)",
                "parameters": [
                    {
                        "type": "file",
                        "description": "File to scan for malware",
                        "name": "file",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Scan completed (check clean field)",
                        "schema": {
                            "$ref": "#/definitions/main.AVScanResult"
                        }
                    },
                    "400": {
                        "description": "Invalid request",
                        "schema": {
                            "$ref": "#/definitions/main.AVScanResult"
                        }
                    },
                    "403": {
                        "description": "Missing or invalid API key",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "413": {
                        "description": "Body limit exceeded",
                        "schema": {
                            "$ref": "#/definitions/main.AVScanResult"
                        }
                    },
                    "503": {
                        "description": "ClamAV unavailable",
                        "schema": {
                            "$ref": "#/definitions/main.AVScanResult"
                        }
                    }
                }
            }
        },
        "/v1/AVScan/ScanFile2": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Scan a file uploaded as multipart/form-data.",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Scanning"
                ],
                "summary": "Scan file",
                "parameters": [
                    {
                        "type": "file",
                        "description": "File to scan for malware",
                        "name": "file",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Scan completed (check clean field)",
                        "schema": {
                            "$ref": "#/definitions/main.AVScanResult"
                        }
                    },
                    "400": {
                        "description": "Invalid multipart form data or no file provided",
                        "schema": {
                            "$ref": "#/definitions/main.AVScanResult"
                        }
                    },
                    "403": {
                        "description": "Missing or invalid API key",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "413": {
                        "description": "Body limit exceeded",
                        "schema": {
                            "$ref": "#/definitions/main.AVScanResult"
                        }
                    },
                    "503": {
                        "description": "ClamAV unavailable",
                        "schema": {
                            "$ref": "#/definitions/main.AVScanResult"
                        }
                    }
                }
            }
        },
        "/v1/AVScan/ScanStream": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Scan raw file bytes sent directly in the request body (application/octet-stream).",
                "consumes": [
                    "application/octet-stream"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Scanning"
                ],
                "summary": "Scan raw stream",
                "responses": {
                    "200": {
                        "description": "Scan completed (check clean field)",
                        "schema": {
                            "$ref": "#/definitions/main.AVScanResult"
                        }
                    },
                    "400": {
                        "description": "Empty request body",
                        "schema": {
                            "$ref": "#/definitions/main.AVScanResult"
                        }
                    },
                    "403": {
                        "description": "Missing or invalid API key",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "413": {
                        "description": "Body limit exceeded",
                        "schema": {
                            "$ref": "#/definitions/main.AVScanResult"
                        }
                    },
                    "503": {
                        "description": "ClamAV unavailable",
                        "schema": {
                            "$ref": "#/definitions/main.AVScanResult"
                        }
                    }
                }
            }
        },
        "/v1/ClamAV/Database": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns ClamAV signature database info and engine runtime stats (state, threads, queue).",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ClamAV"
                ],
                "summary": "Get ClamAV database info",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.ClamAVDatabaseResult"
                        }
                    },
                    "403": {
                        "description": "Missing or invalid API key",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "503": {
                        "description": "ClamAV unavailable",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/ClamAV/Version": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "description": "Returns the ClamAV engine version, signature count, and database date.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "ClamAV"
                ],
                "summary": "Get ClamAV version",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.ClamAVVersionResult"
                        }
                    },
                    "403": {
                        "description": "Missing or invalid API key",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "503": {
                        "description": "ClamAV unavailable",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/ver": {
            "get": {
                "description": "Current av-api service version.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "System"
                ],
                "summary": "Get API version",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.VersionResult"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "main.AVScanResult": {
            "type": "object",
            "properties": {
                "Description": {
                    "type": "string",
                    "example": "stream: OK"
                },
                "Method": {
                    "type": "string",
                    "example": "ScanFile2"
                },
                "Status": {
                    "type": "string",
                    "example": "OK"
                },
                "clean": {
                    "type": "boolean",
                    "example": true
                }
            }
        },
        "main.ClamAVDatabaseResult": {
            "type": "object",
            "properties": {
                "databaseAt": {
                    "type": "string",
                    "example": "2025-01-15"
                },
                "engine": {
                    "type": "string",
                    "example": "1.4.2"
                },
                "queue": {
                    "type": "string",
                    "example": "0 items"
                },
                "signatures": {
                    "type": "string",
                    "example": "27586"
                },
                "state": {
                    "type": "string",
                    "example": "VALID"
                },
                "threads": {
                    "type": "string",
                    "example": "live 1  idle 0 max 12 idle-timeout 30"
                }
            }
        },
        "main.ClamAVHealth": {
            "type": "object",
            "properties": {
                "queue": {
                    "type": "integer"
                },
                "reachable": {
                    "type": "boolean"
                },
                "state": {
                    "type": "string"
                },
                "threads": {
                    "$ref": "#/definitions/main.ClamAVThreads"
                }
            }
        },
        "main.ClamAVThreads": {
            "type": "object",
            "properties": {
                "idle": {
                    "type": "integer"
                },
                "live": {
                    "type": "integer"
                },
                "max": {
                    "type": "integer"
                }
            }
        },
        "main.ClamAVVersionResult": {
            "type": "object",
            "properties": {
                "clamav": {
                    "type": "string",
                    "example": "1.4.2"
                },
                "databaseAt": {
                    "type": "string",
                    "example": "2025-01-15"
                },
                "raw": {
                    "type": "string",
                    "example": "ClamAV 1.4.2/27586/2025-01-15"
                },
                "signatures": {
                    "type": "string",
                    "example": "27586"
                }
            }
        },
        "main.ErrorResponse": {
            "type": "object",
            "properties": {
                "error": {
                    "type": "string",
                    "example": "Access denied"
                }
            }
        },
        "main.HealthResponse": {
            "type": "object",
            "properties": {
                "clamav": {
                    "$ref": "#/definitions/main.ClamAVHealth"
                },
                "inflight": {
                    "type": "integer"
                },
                "status": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "main.VersionResult": {
            "type": "object",
            "properties": {
                "version": {
                    "type": "string",
                    "example": "1.0.2"
                }
            }
        }
    },
    "securityDefinitions": {
        "ApiKeyAuth": {
            "description": "API key for all /v1/* endpoints.",
            "type": "apiKey",
            "name": "X-API-Key",
            "in": "header"
        }
    }
}