openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: College Finder for AI - API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: diagnostics description: Read-only application readiness diagnostics - name: colleges description: College search and details - name: subjects description: Subject-based college search - name: proposals description: Proposal generation and management - name: dashboard description: Dashboard summary data - name: businesses description: Apollo-powered business prospecting paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /diagnostics: get: operationId: getDiagnostics tags: [diagnostics] summary: Run read-only application readiness diagnostics responses: "200": description: Diagnostic report content: application/json: schema: $ref: "#/components/schemas/DiagnosticReport" /businesses/status: get: operationId: getBusinessSearchStatus tags: [businesses] summary: Check whether Apollo business search is configured responses: "200": description: Apollo configuration status content: application/json: schema: $ref: "#/components/schemas/BusinessStatus" /businesses/search: get: operationId: searchBusinesses tags: [businesses] summary: Search Apollo for companies parameters: - name: query in: query schema: { type: string } - name: industry in: query schema: { type: string } - name: location in: query schema: { type: string } - name: employeeRange in: query schema: { type: string } - name: page in: query schema: { type: number, default: 1 } - name: perPage in: query schema: { type: number, default: 20 } responses: "200": description: Apollo company search results content: application/json: schema: $ref: "#/components/schemas/BusinessSearchResult" "400": description: Invalid search filters "503": description: Apollo is not configured /businesses/contacts: get: operationId: getBusinessContacts tags: [businesses] summary: Find and enrich decision-makers at a company parameters: - name: domain in: query required: true schema: { type: string } - name: titles in: query schema: { type: string } - name: limit in: query schema: { type: number, default: 8 } responses: "200": description: Enriched Apollo contacts content: application/json: schema: $ref: "#/components/schemas/BusinessContactsResult" "400": description: Invalid company domain "503": description: Apollo is not configured /businesses/letter: post: operationId: generateBusinessOutreachLetter tags: [businesses] summary: Generate an onboarding-savings outreach letter for a company requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/BusinessLetterInput" responses: "200": description: Generated business outreach letter and reference model content: application/json: schema: $ref: "#/components/schemas/BusinessLetterResult" "400": description: Invalid business letter input "500": description: Letter generation failed /businesses/email: post: operationId: sendBusinessEmail tags: [businesses] summary: Send an edited business outreach letter requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/BusinessEmailInput" responses: "200": description: Business outreach letter sent content: application/json: schema: $ref: "#/components/schemas/BusinessEmailResult" "400": description: Invalid business email input "401": description: Google sign-in required "403": description: Sender is not authorized "502": description: Email provider rejected the message /outreach/email: post: operationId: sendAppOutreachEmail tags: [outreach] summary: Send an edited app-introduction email to a verified recipient requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AppOutreachEmailInput" responses: "200": description: App-introduction email sent content: application/json: schema: $ref: "#/components/schemas/AppOutreachEmailResult" "400": description: Invalid app-introduction email input "401": description: Google sign-in required "403": description: Sender is not authorized "502": description: Email provider rejected the message /colleges/search: get: operationId: searchColleges tags: [colleges] summary: Search colleges by filters parameters: - name: query in: query schema: { type: string } - name: type in: query description: "community_college, lower_tier, technical, vocational, specialty, for_profit, four_year, university" schema: { type: string } - name: state in: query schema: { type: string } - name: maxDropoutRate in: query schema: { type: number } - name: minDropoutRate in: query schema: { type: number } - name: minOpportunityScore in: query description: "Only return colleges with an opportunity score at or above this value (0-100)" schema: { type: number, minimum: 0, maximum: 100 } - name: maxGraduationYears in: query schema: { type: number } - name: maxDebtPayoffYears in: query schema: { type: number } - name: page in: query schema: { type: number, default: 1 } - name: limit in: query schema: { type: number, default: 20 } responses: "200": description: List of colleges content: application/json: schema: $ref: "#/components/schemas/CollegeSearchResult" /colleges/upload: post: operationId: uploadCollegeList tags: [colleges] summary: Upload a CSV list of colleges to create a custom segment requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CollegeUploadInput" responses: "200": description: Upload result content: application/json: schema: $ref: "#/components/schemas/CollegeUploadResult" "400": description: Bad request /colleges/custom: get: operationId: listCustomColleges tags: [colleges] summary: List all custom uploaded college segments responses: "200": description: List of custom colleges content: application/json: schema: $ref: "#/components/schemas/CollegeSearchResult" /colleges/{collegeId}: get: operationId: getCollege tags: [colleges] summary: Get college details parameters: - name: collegeId in: path required: true schema: { type: string } responses: "200": description: College details content: application/json: schema: $ref: "#/components/schemas/College" "404": description: College not found /colleges/{collegeId}/courses: get: operationId: getCollegeCourses tags: [colleges] summary: Get high-enrollment or AI-candidate courses at a college parameters: - name: collegeId in: path required: true schema: { type: string } - name: subject in: query schema: { type: string } description: Optional subject filter (broad match) responses: "200": description: List of courses content: application/json: schema: type: array items: $ref: "#/components/schemas/Course" /colleges/{collegeId}/contacts: get: operationId: getCollegeContacts tags: [colleges] summary: Get decision-maker contacts at a college, optionally by discipline parameters: - name: collegeId in: path required: true schema: { type: string } - name: discipline in: query description: "Optional outreach discipline: math, english_composition, or psychology" schema: $ref: "#/components/schemas/Discipline" responses: "200": description: List of contacts content: application/json: schema: type: array items: $ref: "#/components/schemas/Contact" /colleges/{collegeId}/cost-analysis: get: operationId: getCollegeCostAnalysis tags: [colleges] summary: Get cost analysis comparing current vs AI course delivery parameters: - name: collegeId in: path required: true schema: { type: string } - name: courseCount in: query schema: { type: number, default: 5 } responses: "200": description: Cost analysis content: application/json: schema: $ref: "#/components/schemas/CostAnalysis" /colleges/{collegeId}/stats: get: operationId: getCollegeStats tags: [colleges] summary: Get college statistics (enrollments, popular majors, fail rates) parameters: - name: collegeId in: path required: true schema: { type: string } responses: "200": description: College stats content: application/json: schema: $ref: "#/components/schemas/CollegeStats" /subjects/search: get: operationId: searchBySubject tags: [subjects] summary: Find colleges that likely want AI courses for a given subject parameters: - name: subject in: query required: true schema: { type: string } - name: institutionType in: query schema: { type: string } - name: state in: query schema: { type: string } - name: limit in: query schema: { type: number, default: 10 } responses: "200": description: Colleges ranked by likelihood of wanting AI course content: application/json: schema: type: array items: $ref: "#/components/schemas/SubjectSearchResult" /proposals: get: operationId: listProposals tags: [proposals] summary: List all saved proposals responses: "200": description: List of proposals content: application/json: schema: type: array items: $ref: "#/components/schemas/ProposalSummary" post: operationId: createProposal tags: [proposals] summary: Save a generated proposal requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ProposalInput" responses: "201": description: Created proposal content: application/json: schema: $ref: "#/components/schemas/Proposal" /proposals/{proposalId}: get: operationId: getProposal tags: [proposals] summary: Get a saved proposal by ID parameters: - name: proposalId in: path required: true schema: { type: number } responses: "200": description: Proposal content: application/json: schema: $ref: "#/components/schemas/Proposal" "404": description: Proposal not found delete: operationId: deleteProposal tags: [proposals] summary: Delete a saved proposal parameters: - name: proposalId in: path required: true schema: { type: number } responses: "204": description: Deleted /proposals/{proposalId}/framewise: post: operationId: framewiseProposalReview tags: [proposals] summary: Review or revise a proposal outreach letter with Framewise parameters: - name: proposalId in: path required: true schema: { type: number } requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/FramewiseReviewInput" responses: "200": description: Framewise critique or proposed revision content: application/json: schema: $ref: "#/components/schemas/FramewiseReviewResult" "404": description: Proposal not found "503": description: Framewise is not configured or unavailable /proposals/generate: post: operationId: generateProposal tags: [proposals] summary: Generate outreach letter and cost graphs for a college requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/GenerateProposalInput" responses: "200": description: Generated proposal content content: application/json: schema: $ref: "#/components/schemas/GeneratedProposal" /dashboard/summary: get: operationId: getDashboardSummary tags: [dashboard] summary: Get summary stats for the dashboard responses: "200": description: Dashboard summary content: application/json: schema: $ref: "#/components/schemas/DashboardSummary" components: schemas: FramewiseReviewInput: type: object required: [action] properties: action: type: string enum: [review, revise] outreachLetter: type: string critique: type: string FramewiseReviewResult: type: object required: [critique] properties: critique: type: string revisedLetter: type: ["string", "null"] DiagnosticReport: type: object required: [overall, checkedAt, durationMs, checks] properties: overall: type: string enum: [ready, attention, blocked] checkedAt: type: string format: date-time durationMs: type: number checks: type: array items: $ref: "#/components/schemas/DiagnosticCheck" DiagnosticCheck: type: object required: [id, label, status, summary, detail] properties: id: type: string label: type: string status: type: string enum: [pass, warn, fail] summary: type: string detail: type: string action: type: string BusinessStatus: type: object required: [configured, provider] properties: configured: type: boolean provider: type: string BusinessSearchResult: type: object required: [companies, total, page, perPage] properties: companies: type: array items: $ref: "#/components/schemas/Business" total: type: number page: type: number perPage: type: number Business: type: object required: [id, name] properties: id: type: string name: type: string domain: type: ["string", "null"] websiteUrl: type: ["string", "null"] linkedinUrl: type: ["string", "null"] logoUrl: type: ["string", "null"] phone: type: ["string", "null"] foundedYear: type: ["number", "null"] revenue: type: ["number", "null"] revenuePrinted: type: ["string", "null"] employeeCount: type: ["number", "null"] employeeGrowth6m: type: ["number", "null"] employeeGrowth12m: type: ["number", "null"] employeeGrowth24m: type: ["number", "null"] BusinessContactsResult: type: object required: [domain, contacts] properties: domain: type: string contacts: type: array items: $ref: "#/components/schemas/BusinessContact" BusinessLetterInput: type: object required: [companyName] properties: companyName: type: string domain: type: ["string", "null"] employeeCount: type: ["number", "null"] revenuePrinted: type: ["string", "null"] employeeGrowth12m: type: ["number", "null"] contact: oneOf: - $ref: "#/components/schemas/BusinessLetterContact" - type: "null" BusinessLetterContact: type: object required: [name, title] properties: name: type: string title: type: string email: type: ["string", "null"] BusinessLetterResult: type: object required: [outreachLetter, referenceModel] properties: outreachLetter: type: string referenceModel: $ref: "#/components/schemas/BusinessReferenceModel" BusinessEmailInput: type: object required: [to, companyName, subject, outreachLetter] properties: to: type: string companyName: type: string subject: type: string outreachLetter: type: string BusinessEmailResult: type: object required: [success, sentAt] properties: success: type: boolean sentAt: type: string AppOutreachEmailInput: type: object required: [to, organizationName, subject, outreachLetter] properties: to: type: string organizationName: type: string subject: type: string outreachLetter: type: string AppOutreachEmailResult: type: object required: [success, sentAt] properties: success: type: boolean sentAt: type: string BusinessReferenceModel: type: object required: - fullyLoadedReductionPercent - conventionalCostPerRetainedHire - zhiCostPerRetainedHire - sizeBand - validationNote properties: fullyLoadedReductionPercent: type: number conventionalCostPerRetainedHire: type: number zhiCostPerRetainedHire: type: number sizeBand: type: string validationNote: type: string BusinessContact: type: object required: [id, name, title] properties: id: type: string name: type: string title: type: string email: type: ["string", "null"] emailStatus: type: ["string", "null"] phone: type: ["string", "null"] linkedinUrl: type: ["string", "null"] organizationName: type: ["string", "null"] Discipline: type: string enum: [math, english_composition, psychology] description: Academic discipline used to target contacts, courses, charts, and outreach HealthStatus: type: object required: [status] properties: status: type: string College: type: object required: [id, name, city, state, type, enrollmentSize] properties: id: type: string name: type: string city: type: string state: type: string type: type: string description: "community_college, lower_tier, technical, vocational, specialty, for_profit, four_year, university" enrollmentSize: type: number dropoutRate: type: ["number", "null"] description: Percentage (0-100) graduationRate: type: ["number", "null"] description: Percentage (0-100) avgGraduationYears: type: ["number", "null"] debtPayoffYears: type: ["number", "null"] description: Median years to pay off student debt, null if unlikely tuitionInState: type: ["number", "null"] tuitionOutOfState: type: ["number", "null"] accreditation: type: ["string", "null"] url: type: ["string", "null"] description: type: ["string", "null"] popularMajors: type: array items: type: string aiOpportunityScore: type: ["number", "null"] description: Score 0-100 indicating how likely this college wants AI courses CollegeSearchResult: type: object required: [colleges, total, page, limit] properties: colleges: type: array items: $ref: "#/components/schemas/College" total: type: number page: type: number limit: type: number Course: type: object required: [name, subject] properties: name: type: string subject: type: string description: type: ["string", "null"] estimatedEnrollment: type: ["number", "null"] sections: type: ["number", "null"] failRate: type: ["number", "null"] description: Percentage (0-100) estimatedAnnualCost: type: ["number", "null"] description: Current annual cost to the institution in USD aiInstallCost: type: ["number", "null"] aiAnnualCost: type: ["number", "null"] isHighPriority: type: boolean default: false Contact: type: object required: [name, title, institution] properties: name: type: string title: type: string institution: type: string department: type: ["string", "null"] email: type: ["string", "null"] phone: type: ["string", "null"] linkedinUrl: type: ["string", "null"] decisionPower: type: string description: "curriculum, budget, ai_strategy, provost" discipline: $ref: "#/components/schemas/Discipline" CostAnalysis: type: object required: [collegeName, courses, totalCurrentAnnualCost, totalAiInstallCost, totalAiAnnualCost, savingsYear1, savingsAnnual, attritionCost, benchmarkingCost, totalCostWithoutAI, totalCostWithAI] properties: collegeName: type: string courses: type: array items: $ref: "#/components/schemas/Course" totalCurrentAnnualCost: type: number totalAiInstallCost: type: number totalAiAnnualCost: type: number attritionCost: type: number description: Annual cost of student attrition and equity-gap exposure benchmarkingCost: type: number description: Annual cost of internal benchmarking and outcomes verification totalCostWithoutAI: type: number description: Total annual burden without AI courses totalCostWithAI: type: number description: Total annual cost with AI courses (first year) savingsYear1: type: number savingsAnnual: type: number description: Recurring annual savings after year 1 CollegeStats: type: object required: [collegeName] properties: collegeName: type: string totalEnrollment: type: ["number", "null"] dropoutRate: type: ["number", "null"] graduationRate: type: ["number", "null"] avgTimeToGraduate: type: ["number", "null"] popularMajors: type: array items: type: string highEnrollmentCourses: type: array items: $ref: "#/components/schemas/Course" highFailRateCourses: type: array items: $ref: "#/components/schemas/Course" SubjectSearchResult: type: object required: [college, subject, opportunityScore, reason] properties: college: $ref: "#/components/schemas/College" subject: type: string opportunityScore: type: number description: Score 0-100 indicating how much this college wants AI courses for this subject reason: type: string description: Explanation of why this college is a good target estimatedEnrollment: type: ["number", "null"] estimatedAnnualCost: type: ["number", "null"] ProposalSummary: type: object required: [id, collegeId, collegeName, collegeState, createdAt] properties: id: type: number collegeId: type: ["string", "null"] collegeName: type: string collegeState: type: string courseCount: type: number createdAt: type: string format: date-time updatedAt: type: string format: date-time Proposal: type: object required: [id, collegeName, collegeState, outreachLetter, costAnalysis, createdAt] properties: id: type: number collegeId: type: ["string", "null"] collegeName: type: string collegeState: type: string discipline: $ref: "#/components/schemas/Discipline" courses: type: array items: $ref: "#/components/schemas/Course" contacts: type: array items: $ref: "#/components/schemas/Contact" aiVirtues: type: array items: type: string outreachLetter: type: string costAnalysis: $ref: "#/components/schemas/CostAnalysis" createdAt: type: string format: date-time updatedAt: type: string format: date-time ProposalInput: type: object required: [collegeName, collegeState, outreachLetter, costAnalysis] properties: collegeId: oneOf: - type: string - type: number collegeName: type: string collegeState: type: string discipline: $ref: "#/components/schemas/Discipline" courses: type: array items: $ref: "#/components/schemas/Course" contacts: type: array items: $ref: "#/components/schemas/Contact" aiVirtues: type: array items: type: string outreachLetter: type: string costAnalysis: $ref: "#/components/schemas/CostAnalysis" GenerateProposalInput: type: object required: [collegeName, collegeState] properties: collegeId: oneOf: - type: string - type: number collegeName: type: string collegeState: type: string discipline: $ref: "#/components/schemas/Discipline" collegeType: type: string enrollmentSize: type: number dropoutRate: type: number courses: type: array items: $ref: "#/components/schemas/Course" contacts: type: array items: $ref: "#/components/schemas/Contact" aiVirtues: type: array items: type: string description: "Features of the AI course (e.g. internal benchmarking, built-in tutor, adaptive pacing)" tone: type: string enum: [formal, supplemental, replacement, certifications, direct, provocative, consultative, urgency] description: "Outreach message mode" costAnalysis: $ref: "#/components/schemas/CostAnalysis" GeneratedProposal: type: object required: [outreachLetter, costAnalysis, prioritizedCourses] properties: outreachLetter: type: string discipline: $ref: "#/components/schemas/Discipline" contacts: type: array items: $ref: "#/components/schemas/Contact" costAnalysis: $ref: "#/components/schemas/CostAnalysis" prioritizedCourses: type: array items: $ref: "#/components/schemas/Course" executiveSummary: type: string CollegeUploadInput: type: object required: [csvContent] properties: csvContent: type: string description: Raw CSV text with columns name, state (optional), type (optional), city (optional) filename: type: string description: Original filename, used as a segment label CollegeUploadResult: type: object required: [inserted, skipped, total, sourceFile] properties: inserted: type: number description: Number of new colleges added skipped: type: number description: Number of rows skipped (duplicates or invalid) total: type: number description: Total rows processed sourceFile: type: string DashboardSummary: type: object required: [totalProposals, totalCollegesResearched, topOpportunityStates, recentProposals] properties: totalProposals: type: number totalCollegesResearched: type: number avgSavingsPerCollege: type: ["number", "null"] topOpportunityStates: type: array items: type: object required: [state, count] properties: state: type: string count: type: number recentProposals: type: array items: $ref: "#/components/schemas/ProposalSummary" totalPotentialSavings: type: ["number", "null"]