{"openapi":"3.0.0","servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/unsw-3e1/AMASS/1.0.0"},{"description":"Live AWS API Gateway","url":"https://2r5sbcl74l.execute-api.ap-southeast-2.amazonaws.com/"}],"info":{"description":"Data Breach API","version":"1.0.0","title":"Amass Event Intelligence","contact":{"email":"dearryllan@gmail.com"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"paths":{"/auth/signup":{"post":{"tags":["Authorisation"],"summary":"Create/Signs up a new user.","operationId":"create_user","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}}},"responses":{"200":{"description":"Sucessful signup","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"User created successfully"},"email":{"type":"string","example":"user@example.com"},"id":{"type":"integer","example":1}}}}}},"400":{"description":"Email already registered"},"404":{"description":"Password must be a minimum of 8 characters"}}}},"/auth/login":{"post":{"tags":["Authorisation"],"summary":"Logs user into the system.","operationId":"login_user","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLogin"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string"}}}}}},"401":{"description":"Invalid credentials"}}}},"/auth/logout":{"post":{"tags":["Authorisation"],"summary":"Logs out current logged in user session.","operationId":"logout_user","security":[{"OAuth2PasswordBearer":[]}],"responses":{"200":{"description":"Successfully logged out","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"401":{"description":"Invalid or missing token"}}}},"/v1/companies/{company_name}":{"get":{"tags":["Retrieval"],"summary":"Get company summary","description":"Returns aggregated vulnerability metrics for a specific company, including average scores and overall risk ratings.","operationId":"get_company_summary","parameters":[{"name":"company_name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanySummary"}}}},"400":{"description":"Invalid company name format"},"401":{"description":"Unauthorised user"},"404":{"description":"Company not found"}}}},"/v1/companies/{company_name}/vulnerabilities":{"get":{"tags":["Retrieval"],"summary":"Get vulnerabilities for a specific company","operationId":"get_company_vulnerabilities","parameters":[{"name":"company_name","in":"path","required":true,"schema":{"type":"string"}},{"name":"min_cvss","in":"query","schema":{"type":"number","format":"float"}},{"name":"min_epss","in":"query","schema":{"type":"number","format":"float"}}],"responses":{"200":{"description":"A list of vulnerabilities for a company","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VulnerabilityList"}}}},"401":{"description":"Unauthorised user"},"404":{"description":"Company not found"}}}},"/v1/vulnerabilities/{cve_id}":{"get":{"tags":["Retrieval"],"summary":"Get deatails for a specific vulnerability.","operationId":"get_vulnerability_by_id","parameters":[{"name":"cve_id","in":"path","required":true,"schema":{"type":"string","pattern":"^CVE-\\d{4}-\\d{4,}$","example":"CVE-2021-44228"}}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vulnerability"}}}},"400":{"description":"Invalid CVE ID format"},"401":{"description":"Unauthorised user"},"404":{"description":"CVE ID not found"}}}},"/v1/growth/{company_name}":{"get":{"tags":["Visualisation"],"summary":"Get a company's vulnerability growth over specified amount of days (30 days default)","operationId":"get_company_cve_growth","parameters":[{"name":"company_name","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","schema":{"type":"number","format":"int"}}],"responses":{"200":{"description":"A company's vulnerability growth","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CVEGrowth"}}}},"401":{"description":"Unauthorised user"},"404":{"description":"Company {company_name} not found"}}}},"/v1/heatmap/{company_name}":{"get":{"tags":["Visualisation"],"summary":"Get a company's heatmap data of their vulnerabilities (based on levels of cvss and epss)","operationId":"get_company_heatmap","parameters":[{"name":"company_name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"A company's heatmap","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Heatmap"}}}},"401":{"description":"Unauthorised user"},"404":{"description":"Company {company_name} not found"}}}},"/v1/visualise":{"post":{"tags":["Visualisation"],"summary":"Generate a visualisation of the data given (either growth or heatmap data)","operationId":"visualiser","requestBody":{"description":"Created user object","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/CVEGrowth"},{"$ref":"#/components/schemas/Heatmap"}]}}}},"responses":{"200":{"description":"A company's vulnerability growth","content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Unauthorised user"},"400":{"description":"Unknown data format: missing required keys"}}}},"/v1/integration/{company_symbol}":{"get":{"tags":["Integration (with W1A_CHARLIE)"],"summary":"Get a company's heatmap data of their vulnerabilities vs stock price","description":"Returns a merged dataset of stock price differences and CVE growth for a specified company.","operationId":"stocks_cve_growth","parameters":[{"name":"company_symbol","in":"path","required":true,"description":"The ticker symbol (e.g., GOOGL, AAPL)","schema":{"type":"string","enum":["GOOGL","AAPL","MSFT","AVGO","META","CSCO","INTC"]}},{"name":"from","in":"query","required":false,"description":"Start date (YYYY-MM-DD). Defaults to 2025-01-01.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"End date (YYYY-MM-DD). Defaults to current date.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"A company's merged stock and CVE growth data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergedResults"}}}},"400":{"description":"Invalid date range (from > to)"},"401":{"description":"Unauthorised"},"404":{"description":"Company symbol not found or unsupported"},"500":{"description":"Internal Server Error (e.g., Auth failure with W1A_CHARLIE)"}}}},"/v1/news/{company_symbol}":{"get":{"tags":["Integration (with W1A_CHARLIE)"],"summary":"Fetch news articles for a specific company with sentiment filtering","operationId":"get_news","parameters":[{"name":"company_symbol","in":"path","required":true,"description":"The ticker symbol (e.g., GOOGL, AAPL)","schema":{"type":"string","enum":["GOOGL","AAPL","MSFT","AVGO","META","CSCO","INTC"]}},{"name":"start_date","in":"query","required":false,"description":"Start date (YYYY-MM-DD). Defaults to 2025-01-01.","schema":{"type":"string","format":"date"}},{"name":"end_date","in":"query","required":false,"description":"End date (YYYY-MM-DD). Defaults to today.","schema":{"type":"string","format":"date"}},{"name":"sentiment","in":"query","required":false,"description":"Filter by sentiment.","schema":{"type":"string","enum":["positive","negative","neutral"]}},{"name":"limit","in":"query","required":false,"description":"Max articles to return (1-200). Defaults to 50.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Successful news retrieval","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewsResponse"}}}},"400":{"description":"Invalid date range or sentiment"},"401":{"description":"Unauthorised"},"404":{"description":"Company symbol not found"},"500":{"description":"Internal Server Error"}}}},"/v2/watchlist":{"post":{"tags":["App services"],"summary":"Create a new watchlist","operationId":"create_watchlist","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","name"],"properties":{"email":{"type":"string","format":"email","example":"user@example.com"},"name":{"type":"string","minLength":2,"example":"My Tech Watchlist"}}}}}},"responses":{"200":{"description":"Watchlist created","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Watchlist created successfully"},"id":{"type":"integer","example":42}}}}}},"400":{"description":"Invalid input or watchlist already exists"},"500":{"description":"Internal server error"}}},"get":{"tags":["App services"],"summary":"List all watchlists for an email","operationId":"list_watchlists","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","format":"email"},"example":"user@example.com"}],"responses":{"200":{"description":"List of watchlists","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"watchlists":{"type":"array","items":{"$ref":"#/components/schemas/WatchlistSummary"}}}}}}},"400":{"description":"Invalid or missing email"},"500":{"description":"Internal server error"}}}},"/v2/watchlist/{id}":{"get":{"tags":["App services"],"summary":"Get a watchlist with its companies and their risk data","operationId":"get_watchlist","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"},"example":42},{"name":"email","in":"query","required":true,"schema":{"type":"string","format":"email"},"example":"user@example.com"}],"responses":{"200":{"description":"Watchlist detail with enriched company data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WatchlistDetail"}}}},"400":{"description":"Invalid or missing parameters"},"404":{"description":"Watchlist not found or email mismatch"},"500":{"description":"Internal server error"}}},"delete":{"tags":["App services"],"summary":"Delete a watchlist","operationId":"delete_watchlist","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"},"example":42}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","example":"user@example.com"}}}}}},"responses":{"200":{"description":"Watchlist deleted","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Watchlist deleted successfully"},"id":{"type":"integer","example":42}}}}}},"404":{"description":"Watchlist not found or email mismatch"},"500":{"description":"Internal server error"}}}},"/v2/watchlist/{id}/companies":{"post":{"tags":["App services"],"summary":"Add a company to a watchlist","operationId":"add_company","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"},"example":42}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","company_name"],"properties":{"email":{"type":"string","format":"email","example":"user@example.com"},"company_name":{"type":"string","example":"Microsoft"}}}}}},"responses":{"200":{"description":"Company added to watchlist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Company added to watchlist"},"id":{"type":"integer","example":7},"watchlist_id":{"type":"integer","example":42},"company_name":{"type":"string","example":"Microsoft"},"added_at":{"type":"string","format":"date-time"}}}}}},"400":{"description":"Company already in watchlist, watchlist not found, or invalid input"},"500":{"description":"Internal server error"}}}},"/v2/watchlist/{id}/companies/{company_name}":{"delete":{"tags":["App services"],"summary":"Remove a company from a watchlist","operationId":"remove_company","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"},"example":42},{"name":"company_name","in":"path","required":true,"description":"URL-encoded company name (use + or %20 for spaces)","schema":{"type":"string"},"example":"Microsoft"},{"name":"email","in":"query","required":true,"schema":{"type":"string","format":"email"},"example":"user@example.com"}],"responses":{"200":{"description":"Company removed from watchlist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Company removed from watchlist"},"watchlist_id":{"type":"integer","example":42},"company_name":{"type":"string","example":"Microsoft"}}}}}},"404":{"description":"Watchlist or company not found"},"500":{"description":"Internal server error"}}}},"/clear":{"delete":{"tags":["Admin"],"summary":"Clear all data","operationId":"clear_data","parameters":[{"name":"admin_password","in":"header","required":true,"description":"Admin authorisation password","schema":{"type":"string"}}],"responses":{"200":{"description":"All data cleared."},"401":{"description":"Unauthorised - Password missing or incorrect."},"403":{"description":"Forbidden - You do not have permission to access this resource."}}}}},"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"apiKey","in":"header","name":"Authorization","description":"Enter: Bearer {token}"}},"schemas":{"UserCreate":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","format":"password"}}},"UserLogin":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string"},"password":{"type":"string"}}},"CompanySummary":{"type":"object","properties":{"company":{"type":"string","example":"Microsoft"},"cve_count":{"type":"integer","example":154},"avg_epss":{"type":"number","format":"float","example":0.125},"avg_cvss":{"type":"number","format":"float","example":7.2},"risk_index":{"type":"number","format":"float","description":"A calculated score representing overall exposure.","example":8.5},"risk_rating":{"type":"string","description":"Qualitative risk level based on the index.","example":"Severe"},"time":{"$ref":"#/components/schemas/TimeObject"}}},"Vulnerability":{"type":"object","properties":{"cve_id":{"type":"string","example":"CVE-2021-44228"},"name":{"type":"string","example":"Microsoft Windows NULL Pointer Dereference Vulnerability"},"description":{"type":"string","example":"Microsoft Windows Remote Access Connection Manager contains a NULL pointer dereference that could allow an unauthorized attacker to deny service locally"},"dateAdded":{"type":"string","format":"date-time"},"dueDate":{"type":"string","format":"date-time"},"cvss":{"type":"number","example":4.32},"epss":{"type":"number","example":0.33291},"risk_index":{"type":"number","example":6.7},"risk_rating":{"type":"string","example":"Moderate"},"time":{"$ref":"#/components/schemas/TimeObject"}}},"VulnerabilityList":{"type":"object","properties":{"company":{"type":"string","example":"Microsoft"},"cve_count":{"type":"integer","example":1},"vulnerabilities":{"type":"array","items":{"$ref":"#/components/schemas/Vulnerability"}},"time":{"$ref":"#/components/schemas/TimeObject"}}},"CVEGrowth":{"type":"object","properties":{"company_name":{"type":"string","example":"Microsoft"},"data_points":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","example":"2026-03-03"},"new_cves":{"type":"integer","example":3}}}},"summary":{"type":"object","properties":{"total_period_increase":{"type":"integer","example":13},"peak_growth_day":{"type":"string","example":"2026-03-03"}}}}},"Heatmap":{"type":"object","properties":{"company_name":{"type":"string","example":"Microsoft"},"heatmap_grid":{"type":"array","items":{"type":"object","properties":{"cvss_range":{"type":"string","example":"0-2"},"epss_range":{"type":"string","example":"0.4-0.6"},"cve_count":{"type":"integer","example":3}}}}}},"MergedResults":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"price_diff":{"type":"number","format":"float"},"cve_growth":{"type":"integer"}}}},"NewsResponse":{"type":"object","properties":{"company":{"type":"string","example":"Google"},"symbol":{"type":"string","example":"GOOGL"},"count":{"type":"integer","example":50},"news_data":{"type":"array","items":{"$ref":"#/components/schemas/NewsArticle"}}}},"NewsArticle":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string"},"url":{"type":"string"},"source":{"type":"string"},"source_domain":{"type":"string"},"banner_image":{"type":"string","format":"uri"},"published_at":{"type":"string"},"collected_at":{"type":"string","format":"date-time"},"category_within_source":{"type":"string"},"ticker":{"type":"string"},"relevance_score":{"type":"number"},"overall_sentiment_score":{"type":"number"},"overall_sentiment_label":{"type":"string"},"ticker_sentiment_score":{"type":"number"},"ticker_sentiment_label":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"topic":{"type":"string"},"relevance_score":{"type":"string"}}}},"authors":{"type":"array","items":{"type":"string"}}}},"WatchlistSummary":{"type":"object","properties":{"id":{"type":"integer","example":42},"name":{"type":"string","example":"My Tech Watchlist"},"created_at":{"type":"string","format":"date-time"},"company_count":{"type":"integer","example":5}}},"WatchlistDetail":{"type":"object","properties":{"id":{"type":"integer","example":42},"email":{"type":"string","format":"email","example":"user@example.com"},"name":{"type":"string","example":"My Tech Watchlist"},"created_at":{"type":"string","format":"date-time"},"companies":{"type":"array","items":{"$ref":"#/components/schemas/WatchlistCompany"}}}},"WatchlistCompany":{"type":"object","properties":{"company_name":{"type":"string","example":"Microsoft"},"added_at":{"type":"string","format":"date-time"},"num_vulnerabilities":{"type":"integer","example":12},"avg_cvss":{"type":"number","format":"float","example":7.8},"avg_epss":{"type":"number","format":"float","example":0.032},"risk_index":{"type":"number","format":"float","example":0.68},"risk_rating":{"type":"string","enum":["CRITICAL","HIGH","MEDIUM","LOW","UNKNOWN"],"example":"HIGH"}}},"TimeObject":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"timezone":{"type":"string","example":"GMT+11"}},"description":"timestamp from when response was retrieved"}}}}