{"openapi":"3.0.3","info":{"title":"LicenseCM API","description":"Professional License Management System API. Manage software licenses with HWID locking, encryption, session management, and security features.","version":"2.0.0","contact":{"name":"LicenseCM Support","url":"https://github.com/licensecm"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"}},"servers":[{"url":"http://localhost:47293/api","description":"Development server"},{"url":"https://verify.licensekit.cloud/api","description":"Production server"}],"tags":[{"name":"Auth","description":"Authentication endpoints"},{"name":"Products","description":"Product management"},{"name":"Licenses","description":"License management"},{"name":"Client","description":"Client SDK endpoints for license validation"},{"name":"Security","description":"Security management (Admin only)"},{"name":"Webhooks","description":"Webhook configuration"},{"name":"Stats","description":"Statistics and analytics"},{"name":"Notifications","description":"User notifications"},{"name":"Admin","description":"Admin-only endpoints"}],"paths":{"/auth/register":{"post":{"tags":["Auth"],"summary":"Register new user","description":"Create a new user account","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"},"example":{"email":"user@example.com","password":"securepassword123","display_name":"John Doe"}}}},"responses":{"201":{"description":"User registered successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"409":{"$ref":"#/components/responses/Conflict"}}}},"/auth/login":{"post":{"tags":["Auth"],"summary":"Login","description":"Authenticate user and receive JWT token","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"},"example":{"email":"user@example.com","password":"securepassword123"}}}},"responses":{"200":{"description":"Login successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/auth/refresh":{"post":{"tags":["Auth"],"summary":"Refresh token","description":"Get a new JWT token using refresh token","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Token refreshed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/auth/me":{"get":{"tags":["Auth"],"summary":"Get current user","description":"Get authenticated user profile","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"User profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/products":{"get":{"tags":["Products"],"summary":"List products","description":"Get all products for authenticated user","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of products","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Products"],"summary":"Create product","description":"Create a new product","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductRequest"},"example":{"name":"My Application","description":"Professional software application"}}}},"responses":{"201":{"description":"Product created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"$ref":"#/components/schemas/Product"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/products/{id}":{"get":{"tags":["Products"],"summary":"Get product","description":"Get product by ID","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProductId"}],"responses":{"200":{"description":"Product details","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/Product"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Products"],"summary":"Update product","description":"Update product details","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProductId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProductRequest"}}}},"responses":{"200":{"description":"Product updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/Product"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Products"],"summary":"Delete product","description":"Delete product and all associated licenses","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProductId"}],"responses":{"200":{"description":"Product deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/products/{id}/regenerate-key":{"post":{"tags":["Products"],"summary":"Regenerate secret key","description":"Generate a new secret key for the product. Warning: This will invalidate all existing SDK integrations.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProductId"}],"responses":{"200":{"description":"New secret key generated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"secret_key":{"type":"string","example":"sk_live_abc123..."}}}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/licenses":{"get":{"tags":["Licenses"],"summary":"List licenses","description":"Get licenses with optional filters","security":[{"bearerAuth":[]}],"parameters":[{"name":"product_id","in":"query","description":"Filter by product ID","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","description":"Filter by status","schema":{"type":"string","enum":["active","expired","suspended"]}},{"name":"type","in":"query","description":"Filter by license type","schema":{"type":"string","enum":["trial","subscription","lifetime"]}},{"name":"page","in":"query","description":"Page number","schema":{"type":"integer","default":1}},{"name":"limit","in":"query","description":"Items per page","schema":{"type":"integer","default":20,"maximum":100}}],"responses":{"200":{"description":"List of licenses","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"licenses":{"type":"array","items":{"$ref":"#/components/schemas/License"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}}}},"post":{"tags":["Licenses"],"summary":"Create license","description":"Create a single license","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLicenseRequest"},"example":{"product_id":"550e8400-e29b-41d4-a716-446655440000","type":"subscription","max_uses":1,"hwid_locked":true,"expires_at":"2025-12-31T23:59:59Z","metadata":{"plan":"pro"}}}}},"responses":{"201":{"description":"License created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/License"}}}}}}}}},"/licenses/bulk":{"post":{"tags":["Licenses"],"summary":"Bulk create licenses","description":"Create multiple licenses at once","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateLicenseRequest"},"example":{"product_id":"550e8400-e29b-41d4-a716-446655440000","count":10,"type":"subscription","expires_at":"2025-12-31T23:59:59Z"}}}},"responses":{"201":{"description":"Licenses created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"created":{"type":"integer"},"licenses":{"type":"array","items":{"$ref":"#/components/schemas/License"}}}}}}}}}}}},"/licenses/{id}":{"get":{"tags":["Licenses"],"summary":"Get license","description":"Get license by ID","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/LicenseId"}],"responses":{"200":{"description":"License details","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/License"}}}}}},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Licenses"],"summary":"Update license","description":"Update license details","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/LicenseId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLicenseRequest"}}}},"responses":{"200":{"description":"License updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/License"}}}}}}}},"delete":{"tags":["Licenses"],"summary":"Delete license","description":"Delete a license","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/LicenseId"}],"responses":{"200":{"description":"License deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}}}}},"/licenses/{id}/reset-hwid":{"post":{"tags":["Licenses"],"summary":"Reset HWID","description":"Reset the hardware ID lock for a license","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/LicenseId"}],"responses":{"200":{"description":"HWID reset successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}}}}},"/licenses/{id}/logs":{"get":{"tags":["Licenses"],"summary":"Get license logs","description":"Get activation and usage logs for a license","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/LicenseId"},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"limit","in":"query","schema":{"type":"integer","default":50}}],"responses":{"200":{"description":"License logs","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"logs":{"type":"array","items":{"$ref":"#/components/schemas/LicenseLog"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}}}}},"/client/validate":{"post":{"tags":["Client"],"summary":"Validate license","description":"Validate a license key without activating. Used for checking license status.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateLicenseRequest"},"example":{"license_key":"XXXX-XXXX-XXXX-XXXX","hwid":"abc123def456...","product_id":"550e8400-e29b-41d4-a716-446655440000"}}}},"responses":{"200":{"description":"Validation result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateLicenseResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/SecurityBlocked"}}}},"/client/activate":{"post":{"tags":["Client"],"summary":"Activate license","description":"Activate a license and create a session. Returns session token for heartbeat.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateLicenseRequest"},"example":{"license_key":"XXXX-XXXX-XXXX-XXXX","hwid":"abc123def456...","product_id":"550e8400-e29b-41d4-a716-446655440000","client_data":{"platform":"win32","os_version":"10.0.19041","vm_indicators":[],"debug_indicators":[]}}}}},"responses":{"200":{"description":"Activation successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateLicenseResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/SecurityBlocked"}}}},"/client/deactivate":{"post":{"tags":["Client"],"summary":"Deactivate license","description":"Deactivate a license and end the session","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeactivateLicenseRequest"}}}},"responses":{"200":{"description":"Deactivation successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}}}}},"/client/heartbeat":{"post":{"tags":["Client"],"summary":"Session heartbeat","description":"Send heartbeat to keep session alive. Should be called every 5 minutes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatRequest"},"example":{"license_key":"XXXX-XXXX-XXXX-XXXX","hwid":"abc123def456...","product_id":"550e8400-e29b-41d4-a716-446655440000","session_token":"session_token_here"}}}},"responses":{"200":{"description":"Heartbeat successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatResponse"}}}},"401":{"description":"Session expired or invalid"}}}},"/client/verify-challenge":{"post":{"tags":["Client"],"summary":"Verify challenge","description":"Verify a challenge-response for additional security","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyChallengeRequest"}}}},"responses":{"200":{"description":"Challenge verified","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"verified":{"type":"boolean"}}}}}}}}}}},"/client/public-key":{"get":{"tags":["Client"],"summary":"Get public key","description":"Get RSA public key for signature verification","responses":{"200":{"description":"Public key","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"public_key":{"type":"string","example":"-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A...\n-----END PUBLIC KEY-----"}}}}}}}}}}},"/security/blacklist":{"get":{"tags":["Security"],"summary":"List blacklist","description":"Get all blacklist entries","security":[{"bearerAuth":[]}],"parameters":[{"name":"type","in":"query","schema":{"type":"string","enum":["ip","hwid","license","fingerprint"]}},{"name":"severity","in":"query","schema":{"type":"string","enum":["low","medium","high","critical"]}},{"name":"is_active","in":"query","schema":{"type":"boolean"}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"limit","in":"query","schema":{"type":"integer","default":20}}],"responses":{"200":{"description":"Blacklist entries","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/BlacklistEntry"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}}}},"post":{"tags":["Security"],"summary":"Add to blacklist","description":"Add a new entry to the blacklist","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBlacklistRequest"},"example":{"type":"ip","value":"192.168.1.100","reason":"Brute force attack detected","severity":"high","expires_at":"2025-02-01T00:00:00Z"}}}},"responses":{"201":{"description":"Entry added","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/BlacklistEntry"}}}}}}}}},"/security/blacklist/{id}/disable":{"put":{"tags":["Security"],"summary":"Disable blacklist entry","description":"Disable a blacklist entry without deleting","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Entry disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}}}}},"/security/blacklist/{id}":{"delete":{"tags":["Security"],"summary":"Delete blacklist entry","description":"Permanently delete a blacklist entry","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Entry deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}}}}},"/security/events":{"get":{"tags":["Security"],"summary":"List security events","description":"Get security event logs","security":[{"bearerAuth":[]}],"parameters":[{"name":"event_type","in":"query","schema":{"type":"string"}},{"name":"severity","in":"query","schema":{"type":"string","enum":["info","low","medium","high","critical"]}},{"name":"license_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"ip_address","in":"query","schema":{"type":"string"}},{"name":"hwid","in":"query","schema":{"type":"string"}},{"name":"is_blocked","in":"query","schema":{"type":"boolean"}},{"name":"start_date","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"end_date","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"limit","in":"query","schema":{"type":"integer","default":50}}],"responses":{"200":{"description":"Security events","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/SecurityEvent"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}}}}},"/security/stats":{"get":{"tags":["Security"],"summary":"Security statistics","description":"Get security overview statistics","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Security stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityStatsResponse"}}}}}}},"/security/sessions":{"get":{"tags":["Security"],"summary":"List sessions","description":"Get all active sessions","security":[{"bearerAuth":[]}],"parameters":[{"name":"license_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"is_active","in":"query","schema":{"type":"boolean"}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"limit","in":"query","schema":{"type":"integer","default":20}}],"responses":{"200":{"description":"Sessions list","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"sessions":{"type":"array","items":{"$ref":"#/components/schemas/Session"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}}}}},"/security/sessions/{id}/revoke":{"post":{"tags":["Security"],"summary":"Revoke session","description":"Revoke a specific session","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"Session revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}}}}},"/security/sessions/license/{license_id}/revoke-all":{"post":{"tags":["Security"],"summary":"Revoke all license sessions","description":"Revoke all sessions for a specific license","security":[{"bearerAuth":[]}],"parameters":[{"name":"license_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"All sessions revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}}}}},"/security/block-ip":{"post":{"tags":["Security"],"summary":"Block IP","description":"Quick action to block an IP address","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ip","reason"],"properties":{"ip":{"type":"string","example":"192.168.1.100"},"reason":{"type":"string"},"duration_hours":{"type":"integer","default":24}}}}}},"responses":{"201":{"description":"IP blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}}}}},"/security/block-hwid":{"post":{"tags":["Security"],"summary":"Block HWID","description":"Quick action to block a hardware ID","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hwid","reason"],"properties":{"hwid":{"type":"string"},"reason":{"type":"string"},"duration_hours":{"type":"integer","default":720}}}}}},"responses":{"201":{"description":"HWID blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}}}}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhooks","description":"Get all configured webhooks","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Webhooks list","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}}}}},"post":{"tags":["Webhooks"],"summary":"Create webhook","description":"Create a new webhook","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"},"example":{"url":"https://your-server.com/webhook","events":["license.created","license.activated","license.expired"],"secret":"your_webhook_secret"}}}},"responses":{"201":{"description":"Webhook created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/Webhook"}}}}}}}}},"/webhooks/{id}":{"put":{"tags":["Webhooks"],"summary":"Update webhook","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookRequest"}}}},"responses":{"200":{"description":"Webhook updated"}}},"delete":{"tags":["Webhooks"],"summary":"Delete webhook","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Webhook deleted"}}}},"/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Test webhook","description":"Send a test event to the webhook","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Test sent","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"status_code":{"type":"integer"},"response_time_ms":{"type":"integer"}}}}}}}}}}},"/stats/dashboard":{"get":{"tags":["Stats"],"summary":"Dashboard statistics","description":"Get overview statistics for dashboard","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Dashboard stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardStatsResponse"}}}}}}},"/stats/products/{id}":{"get":{"tags":["Stats"],"summary":"Product statistics","description":"Get statistics for a specific product","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/ProductId"}],"responses":{"200":{"description":"Product stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductStatsResponse"}}}}}}},"/notifications":{"get":{"tags":["Notifications"],"summary":"List notifications","description":"Get user notifications","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Notifications list","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}}}}}}}}}},"/notifications/unread-count":{"get":{"tags":["Notifications"],"summary":"Unread count","description":"Get count of unread notifications","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Unread count","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"count":{"type":"integer"}}}}}}}}}}},"/notifications/{id}/read":{"put":{"tags":["Notifications"],"summary":"Mark as read","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Marked as read"}}}},"/notifications/read-all":{"put":{"tags":["Notifications"],"summary":"Mark all as read","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"All marked as read"}}}},"/admin/users":{"get":{"tags":["Admin"],"summary":"List users","description":"Get all users (Admin only)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Users list","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}}}}}}},"/admin/users/{id}":{"put":{"tags":["Admin"],"summary":"Update user","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["user","admin"]},"is_active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"User updated"}}},"delete":{"tags":["Admin"],"summary":"Delete user","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"User deleted"}}}},"/admin/settings":{"get":{"tags":["Admin"],"summary":"Get settings","description":"Get system settings (Admin only)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"System settings"}}},"put":{"tags":["Admin"],"summary":"Update settings","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"Settings updated"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token obtained from /auth/login"}},"parameters":{"ProductId":{"name":"id","in":"path","required":true,"description":"Product UUID","schema":{"type":"string","format":"uuid"}},"LicenseId":{"name":"id","in":"path","required":true,"description":"License UUID","schema":{"type":"string","format":"uuid"}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Authentication required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Conflict":{"description":"Resource already exists","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"SecurityBlocked":{"description":"Security blocked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityBlockResponse"}}}}},"schemas":{"RegisterRequest":{"type":"object","required":["email","password","display_name"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":6},"display_name":{"type":"string","minLength":2}}},"LoginRequest":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string"}}},"AuthResponse":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"token":{"type":"string"},"user":{"$ref":"#/components/schemas/User"}}}}},"UserResponse":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/User"}}},"User":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"display_name":{"type":"string"},"role":{"type":"string","enum":["user","admin"]},"created_at":{"type":"string","format":"date-time"}}},"Product":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"secret_key":{"type":"string"},"is_active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"CreateProductRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":2},"description":{"type":"string"}}},"UpdateProductRequest":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"is_active":{"type":"boolean"}}},"License":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"license_key":{"type":"string","example":"XXXX-XXXX-XXXX-XXXX"},"product_id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["trial","subscription","lifetime"]},"status":{"type":"string","enum":["active","expired","suspended"]},"hwid":{"type":"string","nullable":true},"hwid_locked":{"type":"boolean"},"max_uses":{"type":"integer"},"current_uses":{"type":"integer"},"expires_at":{"type":"string","format":"date-time","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"CreateLicenseRequest":{"type":"object","required":["product_id","type"],"properties":{"product_id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["trial","subscription","lifetime"]},"max_uses":{"type":"integer","default":1},"hwid_locked":{"type":"boolean","default":true},"expires_at":{"type":"string","format":"date-time"},"metadata":{"type":"object"}}},"BulkCreateLicenseRequest":{"type":"object","required":["product_id","count","type"],"properties":{"product_id":{"type":"string","format":"uuid"},"count":{"type":"integer","minimum":1,"maximum":100},"type":{"type":"string","enum":["trial","subscription","lifetime"]},"max_uses":{"type":"integer","default":1},"hwid_locked":{"type":"boolean","default":true},"expires_at":{"type":"string","format":"date-time"}}},"UpdateLicenseRequest":{"type":"object","properties":{"status":{"type":"string","enum":["active","expired","suspended"]},"max_uses":{"type":"integer"},"hwid_locked":{"type":"boolean"},"expires_at":{"type":"string","format":"date-time"},"metadata":{"type":"object"}}},"LicenseLog":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"license_id":{"type":"string","format":"uuid"},"action":{"type":"string"},"ip_address":{"type":"string"},"hwid":{"type":"string"},"user_agent":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"ValidateLicenseRequest":{"type":"object","required":["license_key","hwid","product_id"],"properties":{"license_key":{"type":"string"},"hwid":{"type":"string"},"product_id":{"type":"string","format":"uuid"}}},"ValidateLicenseResponse":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"valid":{"type":"boolean"},"license":{"type":"object","properties":{"type":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"metadata":{"type":"object"}}},"signature":{"type":"string"},"watermark":{"type":"string"}}}}},"ActivateLicenseRequest":{"type":"object","required":["license_key","hwid","product_id"],"properties":{"license_key":{"type":"string"},"hwid":{"type":"string"},"product_id":{"type":"string","format":"uuid"},"client_data":{"type":"object","properties":{"platform":{"type":"string"},"os_version":{"type":"string"},"vm_indicators":{"type":"array","items":{"type":"string"}},"debug_indicators":{"type":"array","items":{"type":"string"}}}}}},"ActivateLicenseResponse":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"activated":{"type":"boolean"},"session":{"type":"object","properties":{"token":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}}},"license":{"type":"object","properties":{"type":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"metadata":{"type":"object"}}},"signature":{"type":"string"}}}}},"DeactivateLicenseRequest":{"type":"object","required":["license_key","hwid","product_id"],"properties":{"license_key":{"type":"string"},"hwid":{"type":"string"},"product_id":{"type":"string","format":"uuid"}}},"HeartbeatRequest":{"type":"object","required":["license_key","hwid","product_id","session_token"],"properties":{"license_key":{"type":"string"},"hwid":{"type":"string"},"product_id":{"type":"string","format":"uuid"},"session_token":{"type":"string"}}},"HeartbeatResponse":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"valid":{"type":"boolean"},"new_token":{"type":"string","nullable":true}}}}},"VerifyChallengeRequest":{"type":"object","required":["license_key","hwid","challenge","response"],"properties":{"license_key":{"type":"string"},"hwid":{"type":"string"},"challenge":{"type":"string"},"response":{"type":"string"}}},"BlacklistEntry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["ip","hwid","license","fingerprint"]},"value":{"type":"string"},"reason":{"type":"string"},"severity":{"type":"string","enum":["low","medium","high","critical"]},"is_active":{"type":"boolean"},"expires_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"}}},"CreateBlacklistRequest":{"type":"object","required":["type","value","reason","severity"],"properties":{"type":{"type":"string","enum":["ip","hwid","license","fingerprint"]},"value":{"type":"string"},"reason":{"type":"string"},"severity":{"type":"string","enum":["low","medium","high","critical"]},"expires_at":{"type":"string","format":"date-time"}}},"SecurityEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"event_type":{"type":"string"},"severity":{"type":"string","enum":["info","low","medium","high","critical"]},"license_id":{"type":"string","format":"uuid","nullable":true},"ip_address":{"type":"string"},"hwid":{"type":"string","nullable":true},"details":{"type":"object"},"is_blocked":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}},"SecurityStatsResponse":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"overview":{"type":"object","properties":{"today_events":{"type":"integer"},"critical_events":{"type":"integer"},"blocked_attempts":{"type":"integer"},"active_blacklist":{"type":"integer"},"active_sessions":{"type":"integer"}}},"events_by_type":{"type":"array","items":{"type":"object"}},"events_by_severity":{"type":"array","items":{"type":"object"}},"daily_trend":{"type":"array","items":{"type":"object"}}}}}},"Session":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"license_id":{"type":"string","format":"uuid"},"hwid":{"type":"string"},"ip_address":{"type":"string"},"user_agent":{"type":"string"},"is_active":{"type":"boolean"},"last_heartbeat":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}}},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"is_active":{"type":"boolean"},"last_triggered_at":{"type":"string","format":"date-time","nullable":true},"created_at":{"type":"string","format":"date-time"}}},"CreateWebhookRequest":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"example":["license.created","license.activated","license.expired"]},"secret":{"type":"string"}}},"UpdateWebhookRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"secret":{"type":"string"},"is_active":{"type":"boolean"}}},"DashboardStatsResponse":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"total_products":{"type":"integer"},"total_licenses":{"type":"integer"},"active_licenses":{"type":"integer"},"total_activations":{"type":"integer"},"recent_activity":{"type":"array","items":{"type":"object"}}}}}},"ProductStatsResponse":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"total_licenses":{"type":"integer"},"active_licenses":{"type":"integer"},"expired_licenses":{"type":"integer"},"suspended_licenses":{"type":"integer"},"activations_today":{"type":"integer"},"activations_this_week":{"type":"integer"},"activations_this_month":{"type":"integer"}}}}},"Notification":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"title":{"type":"string"},"message":{"type":"string"},"is_read":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}},"Pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"total_pages":{"type":"integer"}}},"SuccessResponse":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"success":{"type":"boolean","example":false},"message":{"type":"string"},"error_code":{"type":"string"}}},"SecurityBlockResponse":{"type":"object","properties":{"success":{"type":"boolean","example":false},"message":{"type":"string","example":"Access denied"},"security_blocked":{"type":"boolean","example":true},"security_details":{"type":"object","properties":{"reason":{"type":"string"},"type":{"type":"string"}}}}}}}}