{"openapi":"3.0.0","info":{"title":"SSLWebsites.com API","version":"1.0.0","description":"SSL Certificate Management Platform API","contact":{"name":"SSLWebsites.com Support","email":"support@sslwebsites.com","url":"https://sslwebsites.com/contact"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"}},"servers":[{"url":"http://localhost:5000","description":"Development API Server"},{"url":"https://api.sslwebsites.com","description":"Production API Server"}],"tags":[{"name":"Health","description":"Service health checks"},{"name":"Auth","description":"Authentication and user registration"},{"name":"Certificates","description":"SSL certificate management"},{"name":"Validation","description":"Domain validation (coming soon)"},{"name":"Monitoring","description":"Certificate monitoring (coming soon)"},{"name":"Users","description":"User management (coming soon)"},{"name":"System","description":"System information (coming soon)"},{"name":"Webhooks","description":"Webhook management (coming soon)"},{"name":"ACME","description":"ACME protocol endpoints (coming soon)"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"Error":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"string"}}},"Tokens":{"type":"object","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"}}},"UserSummary":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"plan":{"type":"string","enum":["free","basic","premium","business","platinum"]},"role":{"type":"string","enum":["customer","admin","support"]}}},"UserProfile":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"plan":{"type":"string","enum":["free","basic","premium","business","platinum"]},"planLimits":{"$ref":"#/components/schemas/PlanLimits"},"role":{"type":"string","enum":["customer","admin","support"]},"usage":{"$ref":"#/components/schemas/Usage"},"preferences":{"$ref":"#/components/schemas/Preferences"},"security":{"type":"object","properties":{"emailVerified":{"type":"boolean"},"twoFactorEnabled":{"type":"boolean"},"lastLogin":{"type":"string","format":"date-time","nullable":true}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"PlanLimits":{"type":"object","properties":{"ninetyDayCerts":{"type":"integer","description":"-1 = unlimited"},"oneYearCerts":{"type":"integer"},"ninetyDayWildcards":{"type":"integer"},"oneYearWildcards":{"type":"integer"},"multiDomainCerts":{"type":"integer"},"maxDomainsPerCert":{"type":"integer"},"totalActiveCerts":{"type":"integer"},"supportLevel":{"type":"string","enum":["self_service","basic","technical","preferred","priority"]},"apiCallsPerMonth":{"type":"integer"},"restApiAccess":{"type":"boolean"},"sslMonitoring":{"type":"boolean"},"autoRenewal":{"type":"boolean"}}},"Usage":{"type":"object","properties":{"totalCertificates":{"type":"integer"},"activeCertificates":{"type":"integer"},"apiCallsThisMonth":{"type":"integer"},"lastApiCall":{"type":"string","format":"date-time","nullable":true},"lastUpdated":{"type":"string","format":"date-time"}}},"Preferences":{"type":"object","properties":{"notifications":{"type":"object","properties":{"email":{"type":"boolean"},"expiration":{"type":"boolean"},"renewal":{"type":"boolean"},"security":{"type":"boolean"}}},"timezone":{"type":"string"},"language":{"type":"string"},"autoRenew":{"type":"boolean"}}},"Certificate":{"type":"object","properties":{"_id":{"type":"string"},"certificateId":{"type":"string"},"userId":{"type":"string"},"domains":{"type":"array","items":{"type":"string"}},"type":{"type":"string","enum":["single","wildcard","multi-domain"]},"status":{"type":"string","enum":["pending","validating","active","expired","revoked","failed"]},"validationMethod":{"type":"string","enum":["dns","http","email"]},"keyType":{"type":"string","enum":["rsa","ecdsa"]},"keySize":{"type":"integer","enum":[256,384,2048,4096]},"certificate":{"type":"object","properties":{"pem":{"type":"string","nullable":true},"chain":{"type":"string","nullable":true},"fullchain":{"type":"string","nullable":true}}},"csr":{"type":"string","nullable":true},"serialNumber":{"type":"string","nullable":true},"fingerprint":{"type":"object","properties":{"sha1":{"type":"string","nullable":true},"sha256":{"type":"string","nullable":true}}},"issuer":{"type":"object","properties":{"commonName":{"type":"string"},"organization":{"type":"string"},"country":{"type":"string"}}},"subject":{"type":"object","properties":{"commonName":{"type":"string"},"organization":{"type":"string","nullable":true},"organizationalUnit":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"state":{"type":"string","nullable":true},"locality":{"type":"string","nullable":true}}},"validFrom":{"type":"string","format":"date-time","nullable":true},"validTo":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time"},"autoRenew":{"type":"boolean"},"renewalAttempts":{"type":"integer"},"lastRenewalAttempt":{"type":"string","format":"date-time","nullable":true},"nextRenewalDate":{"type":"string","format":"date-time"},"validation":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"method":{"type":"string","enum":["dns","http","email"]},"status":{"type":"string","enum":["pending","valid","invalid","expired"]},"token":{"type":"string"},"keyAuthorization":{"type":"string"},"validatedAt":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time"}}}},"completedAt":{"type":"string","format":"date-time","nullable":true}}},"monitoring":{"type":"object","properties":{"enabled":{"type":"boolean"},"lastCheck":{"type":"string","format":"date-time","nullable":true},"nextCheck":{"type":"string","format":"date-time"}}},"metadata":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"}},"notes":{"type":"string","nullable":true},"environment":{"type":"string","enum":["development","staging","production"]}}},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"pages":{"type":"integer"}}},"HealthCheck":{"type":"object","properties":{"status":{"type":"string","example":"ok"},"timestamp":{"type":"string","format":"date-time"},"uptime":{"type":"number"},"environment":{"type":"string"},"version":{"type":"string"},"services":{"type":"object","properties":{"database":{"type":"string","enum":["connected","disconnected"]},"redis":{"type":"string","enum":["connected","disconnected"]}}},"memory":{"type":"object"},"cpu":{"type":"object"}}}}},"paths":{"/health":{"get":{"tags":["Health"],"summary":"Service health check","description":"Returns the health status of the API, database, and Redis connections.","responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthCheck"}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"error"},"message":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}}}}}}}}},"/api":{"get":{"tags":["System"],"summary":"API root information","description":"Returns API metadata, version, and available endpoint groups.","responses":{"200":{"description":"API information","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"},"documentation":{"type":"string","nullable":true},"endpoints":{"type":"object"},"support":{"type":"object"}}}}}}}}},"/api/v1/auth":{"get":{"tags":["Auth"],"summary":"Auth route information","description":"Lists available authentication endpoints.","responses":{"200":{"description":"Auth endpoint list","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"endpoints":{"type":"array","items":{"type":"string"}}}}}}}}}},"/api/v1/auth/signup":{"post":{"tags":["Auth"],"summary":"Register a new user","description":"Creates a new user account and returns JWT tokens.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","password","firstName","lastName"],"properties":{"email":{"type":"string","format":"email","example":"user@example.com"},"password":{"type":"string","minLength":8,"example":"SecurePass123!"},"firstName":{"type":"string","example":"John"},"lastName":{"type":"string","example":"Doe"},"company":{"type":"string","example":"Acme Inc"},"plan":{"type":"string","enum":["free","basic","premium","business","platinum"],"default":"free"}}}}}},"responses":{"201":{"description":"User created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"tokens":{"$ref":"#/components/schemas/Tokens"},"user":{"$ref":"#/components/schemas/UserSummary"}}}}}},"400":{"description":"Missing required fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Email already registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/signin":{"post":{"tags":["Auth"],"summary":"Sign in with credentials","description":"Authenticates a user and returns JWT tokens. Account is locked after 5 failed attempts.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email","example":"user@example.com"},"password":{"type":"string","example":"SecurePass123!"}}}}}},"responses":{"200":{"description":"Authentication successful","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"tokens":{"$ref":"#/components/schemas/Tokens"},"user":{"$ref":"#/components/schemas/UserSummary"}}}}}},"400":{"description":"Missing email or password","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account is disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"description":"Account is locked due to too many failed attempts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/login":{"post":{"tags":["Auth"],"summary":"Login (alias for signin)","description":"Alternative login endpoint. Returns the same result as /signin plus a top-level token field for convenience.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string"}}}}}},"responses":{"200":{"description":"Authentication successful","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"token":{"type":"string","description":"Access token (convenience alias)"},"tokens":{"$ref":"#/components/schemas/Tokens"},"user":{"$ref":"#/components/schemas/UserSummary"}}}}}},"400":{"description":"Missing email or password","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account is disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/profile":{"get":{"tags":["Auth"],"summary":"Get current user profile","description":"Returns the full profile of the authenticated user including plan limits, usage, and preferences.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"User profile","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"user":{"$ref":"#/components/schemas/UserProfile"}}}}}},"401":{"description":"Unauthorized - invalid or missing token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/logout":{"post":{"tags":["Auth"],"summary":"Logout","description":"Logs out the current user. Client should discard tokens.","responses":{"200":{"description":"Logged out successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Logged out successfully"}}}}}}}}},"/api/v1/certificates":{"get":{"tags":["Certificates"],"summary":"List certificates","description":"Returns a paginated list of certificates belonging to the authenticated user. Supports filtering by status and domain.","security":[{"BearerAuth":[]}],"parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["pending","validating","active","expired","revoked","failed"]},"description":"Filter by certificate status"},{"name":"domain","in":"query","schema":{"type":"string"},"description":"Filter by domain (case-insensitive substring match)"},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"limit","in":"query","schema":{"type":"integer","default":20,"minimum":1},"description":"Results per page"}],"responses":{"200":{"description":"Certificate list with pagination","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"certificates":{"type":"array","items":{"$ref":"#/components/schemas/Certificate"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Certificates"],"summary":"Request a new certificate","description":"Creates a new SSL certificate request. The certificate type is auto-detected from the domains if not specified. Checks plan limits before creation.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domains"],"properties":{"domains":{"type":"array","items":{"type":"string"},"minItems":1,"example":["example.com","www.example.com"]},"type":{"type":"string","enum":["single","wildcard","multi-domain"],"description":"Auto-detected if omitted"},"validationType":{"type":"string","enum":["dns","http","email"],"default":"http"},"autoRenew":{"type":"boolean","default":true},"keyType":{"type":"string","enum":["rsa","ecdsa"],"default":"rsa"},"keySize":{"type":"integer","enum":[256,384,2048,4096],"default":2048}}}}}},"responses":{"201":{"description":"Certificate request created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"certificate":{"$ref":"#/components/schemas/Certificate"}}}}}}}},"400":{"description":"Invalid request (e.g. missing domains)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Certificate limit reached for current plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/certificates/{id}":{"get":{"tags":["Certificates"],"summary":"Get certificate details","description":"Returns full details of a specific certificate owned by the authenticated user.","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Certificate MongoDB ObjectId"}],"responses":{"200":{"description":"Certificate details","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"certificate":{"$ref":"#/components/schemas/Certificate"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Certificate not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Certificates"],"summary":"Delete a certificate","description":"Permanently deletes a certificate owned by the authenticated user.","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Certificate MongoDB ObjectId"}],"responses":{"200":{"description":"Certificate deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Certificate deleted successfully"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Certificate not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/certificates/{id}/renew":{"post":{"tags":["Certificates"],"summary":"Renew a certificate","description":"Initiates renewal for an active or expired certificate. Sets status back to pending and extends expiry by 90 days.","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Certificate MongoDB ObjectId"}],"responses":{"200":{"description":"Renewal initiated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"certificate":{"$ref":"#/components/schemas/Certificate"}}},"message":{"type":"string","example":"Certificate renewal initiated"}}}}}},"400":{"description":"Certificate cannot be renewed in its current status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Certificate not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/certificates/{id}/revoke":{"post":{"tags":["Certificates"],"summary":"Revoke a certificate","description":"Revokes a certificate. Cannot revoke an already revoked certificate.","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Certificate MongoDB ObjectId"}],"responses":{"200":{"description":"Certificate revoked","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"certificate":{"$ref":"#/components/schemas/Certificate"}}},"message":{"type":"string","example":"Certificate revoked successfully"}}}}}},"400":{"description":"Certificate is already revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Certificate not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/validation":{"get":{"tags":["Validation"],"summary":"Validation service status","description":"Placeholder endpoint. Domain validation features are coming soon.","responses":{"200":{"description":"Status message","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/api/v1/monitoring":{"get":{"tags":["Monitoring"],"summary":"Monitoring service status","description":"Placeholder endpoint. Certificate monitoring features are coming soon.","responses":{"200":{"description":"Status message","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/api/v1/users":{"get":{"tags":["Users"],"summary":"User management status","description":"Placeholder endpoint. User management features are coming soon.","responses":{"200":{"description":"Status message","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/api/v1/system":{"get":{"tags":["System"],"summary":"System information status","description":"Placeholder endpoint. System information features are coming soon.","responses":{"200":{"description":"Status message","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/api/v1/webhooks":{"get":{"tags":["Webhooks"],"summary":"Webhook service status","description":"Placeholder endpoint. Webhook management features are coming soon.","responses":{"200":{"description":"Status message","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/acme":{"get":{"tags":["ACME"],"summary":"ACME protocol status","description":"Placeholder endpoint. ACME protocol endpoints are coming soon.","responses":{"200":{"description":"Status message","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}}}}