openapi: 3.0.3 info: title: AntiGravity - AI Link Threat Sentinel API description: | AI-powered URL threat detection engine that analyzes suspicious links and returns comprehensive security risk assessments. ## Features - Real-time URL threat analysis - AI-driven risk classification (HIGH/MEDIUM/LOW) - Context-aware phishing detection - Structured JSON responses ## Authentication No authentication required for public endpoints. version: 1.0.0 contact: name: AntiGravity Support email: support@antigravity.dev license: name: MIT url: https://opensource.org/licenses/MIT servers: - url: http://localhost:3000 description: Local development server - url: https://api.antigravity.dev description: Production server tags: - name: Analysis description: URL threat analysis endpoints - name: System description: System health and information endpoints paths: /api/verify: post: tags: - Analysis summary: Verify URL threat level description: | Analyzes a URL and optional message context to determine security risk level. Returns structured threat assessment with risk classification, verdict, reasoning, and safety tips. operationId: verifyUrl requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/VerifyRequest' examples: highRisk: summary: High risk phishing URL value: url: "https://paypal-secure-verify.com/login" context: "Your account has been suspended. Click here to verify immediately." mediumRisk: summary: Medium risk shortened URL value: url: "https://bit.ly/urgent-payment" context: "Click to claim your refund" lowRisk: summary: Low risk legitimate URL value: url: "https://github.com/openai" context: "" responses: '200': description: Successfully analyzed URL content: application/json: schema: $ref: '#/components/schemas/VerifyResponse' examples: highRisk: summary: High risk result value: url: "https://paypal-secure-verify.com/login" riskLevel: "HIGH" verdict: "Likely phishing attempt targeting PayPal credentials" reasons: "Domain mimics PayPal with slight variation, urgency tactics in context, login keywords typical of phishing" tips: "Do NOT enter credentials. Contact PayPal directly through official website or app." sources: [] mediumRisk: summary: Medium risk result value: url: "https://bit.ly/urgent-payment" riskLevel: "MEDIUM" verdict: "URL shortener masks destination, proceed with caution" reasons: "Shortened URL hides true destination, payment-related keywords, urgency language" tips: "Use URL expander to reveal destination. Verify sender before clicking." sources: [] lowRisk: summary: Low risk result value: url: "https://github.com/openai" riskLevel: "LOW" verdict: "Legitimate URL from trusted platform" reasons: "Well-known technology platform, HTTPS enabled, no suspicious patterns" tips: "URL appears safe. Always verify HTTPS connection." sources: [] '400': description: Invalid request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' examples: missingUrl: summary: Missing URL value: error: "URL is required" message: "Please provide a URL to analyze" invalidUrl: summary: Invalid URL format value: error: "Invalid URL format" message: "Please provide a valid URL" '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' example: error: "Internal server error" message: "Failed to analyze URL. Please try again." /health: get: tags: - System summary: Health check description: Check if the service is running and healthy operationId: healthCheck responses: '200': description: Service is healthy content: application/json: schema: $ref: '#/components/schemas/HealthResponse' example: status: "healthy" service: "AntiGravity Backend" version: "1.0.0" timestamp: "2024-11-28T18:00:00.000Z" /: get: tags: - System summary: Service information description: Get basic information about the API service operationId: getServiceInfo responses: '200': description: Service information content: application/json: schema: $ref: '#/components/schemas/ServiceInfoResponse' example: service: "AntiGravity - AI Link Threat Sentinel" version: "1.0.0" description: "AI-powered URL threat detection engine" endpoints: verify: "POST /api/verify" health: "GET /health" documentation: "See README.md for API documentation" components: schemas: VerifyRequest: type: object required: - url properties: url: type: string description: The URL to analyze for security threats example: "https://suspicious-link.com/login" context: type: string description: Optional message context (SMS, email, etc.) for better analysis example: "Received via SMS: Your account has been locked" VerifyResponse: type: object required: - url - riskLevel - verdict - reasons - tips - sources properties: url: type: string description: Normalized URL that was analyzed example: "https://suspicious-link.com/login" riskLevel: type: string enum: [HIGH, MEDIUM, LOW] description: Risk classification level example: "HIGH" verdict: type: string description: Brief summary of the threat assessment example: "Likely phishing attempt targeting credentials" reasons: type: string description: Detailed explanation of risk factors and analysis example: "Domain mimics legitimate service, urgency tactics, login keywords" tips: type: string description: Actionable safety recommendations for the user example: "Do NOT enter credentials. Verify with official website." sources: type: array items: type: string description: Optional evidence sources (currently unused) example: [] ErrorResponse: type: object required: - error - message properties: error: type: string description: Error type example: "Invalid URL format" message: type: string description: Human-readable error message example: "Please provide a valid URL" details: type: string description: Additional error details (development only) example: "Invalid URL: missing protocol" HealthResponse: type: object required: - status - service - version - timestamp properties: status: type: string description: Service health status example: "healthy" service: type: string description: Service name example: "AntiGravity Backend" version: type: string description: API version example: "1.0.0" timestamp: type: string format: date-time description: Current server timestamp example: "2024-11-28T18:00:00.000Z" ServiceInfoResponse: type: object required: - service - version - description - endpoints - documentation properties: service: type: string description: Service name example: "AntiGravity - AI Link Threat Sentinel" version: type: string description: API version example: "1.0.0" description: type: string description: Service description example: "AI-powered URL threat detection engine" endpoints: type: object description: Available API endpoints properties: verify: type: string example: "POST /api/verify" health: type: string example: "GET /health" documentation: type: string description: Documentation reference example: "See README.md for API documentation"