{"openapi":"3.1.0","info":{"title":"AI Outreach Public API","version":"1.0.0","description":"REST API for forms, leads, workflows, and credits. This document includes detailed schemas for core v1 endpoints and an index of all public routes under `x-publicRoutes`."},"servers":[{"url":"https://aioutreach.io","description":"Production"},{"url":"http://localhost:3000","description":"Local"}],"x-publicRoutesGeneratedAt":"2026-03-11T01:58:25.301Z","x-publicRoutes":[{"path":"/api/appsumo/webhook","methods":["GET","POST"],"auth":"public","sourceFile":"src/app/api/appsumo/webhook/route.ts"},{"path":"/api/auth/appsumo/callback","methods":["GET","POST"],"auth":"public","sourceFile":"src/app/api/auth/appsumo/callback/route.ts"},{"path":"/api/auth/appsumo/complete-signup","methods":["POST"],"auth":"public","sourceFile":"src/app/api/auth/appsumo/complete-signup/route.ts"},{"path":"/api/auth/error","methods":["GET"],"auth":"public","sourceFile":"src/app/api/auth/error/route.ts"},{"path":"/api/auth/forgot-password","methods":["DELETE","GET","POST","PUT"],"auth":"public","sourceFile":"src/app/api/auth/forgot-password/route.ts"},{"path":"/api/auth/register","methods":["POST"],"auth":"public","sourceFile":"src/app/api/auth/register/route.ts"},{"path":"/api/auth/reset-password","methods":["DELETE","GET","POST","PUT"],"auth":"public","sourceFile":"src/app/api/auth/reset-password/route.ts"},{"path":"/api/images/profile/{id}","methods":["GET","OPTIONS"],"auth":"public","sourceFile":"src/app/api/images/profile/[id]/route.ts"},{"path":"/api/lgj/visit","methods":["POST"],"auth":"public","sourceFile":"src/app/api/lgj/visit/route.ts"},{"path":"/api/meta/events","methods":["POST"],"auth":"public","sourceFile":"src/app/api/meta/events/route.ts"},{"path":"/api/monitoring/health","methods":["GET"],"auth":"public","sourceFile":"src/app/api/monitoring/health/route.ts"},{"path":"/api/openapi","methods":["GET"],"auth":"public","sourceFile":"src/app/api/openapi/route.ts"},{"path":"/api/public/example","methods":["DELETE","GET","POST","PUT"],"auth":"public","sourceFile":"src/app/api/public/example/route.ts"},{"path":"/api/public/message-showcase","methods":["GET"],"auth":"public","sourceFile":"src/app/api/public/message-showcase/route.ts"},{"path":"/api/public/pitch-demo-test","methods":["POST"],"auth":"public","sourceFile":"src/app/api/public/pitch-demo-test/route.ts"},{"path":"/api/public/pitch-demo/status/{id}","methods":["GET"],"auth":"public","sourceFile":"src/app/api/public/pitch-demo/status/[id]/route.ts"},{"path":"/api/public/pitch-demo","methods":["GET","POST"],"auth":"public","sourceFile":"src/app/api/public/pitch-demo/route.ts"},{"path":"/api/referral/track-lgj","methods":["POST"],"auth":"public","sourceFile":"src/app/api/referral/track-lgj/route.ts"},{"path":"/api/stats/prospects","methods":["GET"],"auth":"public","sourceFile":"src/app/api/stats/prospects/route.ts"},{"path":"/api/stripe/webhook","methods":["POST"],"auth":"public","sourceFile":"src/app/api/stripe/webhook/route.ts"},{"path":"/api/teams/invite/{token}","methods":["GET","POST"],"auth":"public","sourceFile":"src/app/api/teams/invite/[token]/route.ts"},{"path":"/api/v1/credits","methods":["GET","OPTIONS"],"auth":"apiKey","sourceFile":"src/app/api/v1/credits/route.ts"},{"path":"/api/v1/form","methods":["GET","POST"],"auth":"apiKey","sourceFile":"src/app/api/v1/form/route.ts"},{"path":"/api/v1/forms/{id}","methods":["DELETE","GET","OPTIONS","PATCH"],"auth":"apiKey","sourceFile":"src/app/api/v1/forms/[id]/route.ts"},{"path":"/api/v1/forms","methods":["GET","OPTIONS","POST"],"auth":"apiKey","sourceFile":"src/app/api/v1/forms/route.ts"},{"path":"/api/v1/leads","methods":["GET","POST"],"auth":"apiKey","sourceFile":"src/app/api/v1/leads/route.ts"},{"path":"/api/v1/pitch-demo","methods":["GET","POST"],"auth":"apiKey","sourceFile":"src/app/api/v1/pitch-demo/route.ts"},{"path":"/api/v1/research","methods":["GET","POST"],"auth":"apiKey","sourceFile":"src/app/api/v1/research/route.ts"},{"path":"/api/v1/workflows/{id}/results","methods":["GET","OPTIONS"],"auth":"apiKey","sourceFile":"src/app/api/v1/workflows/[id]/results/route.ts"},{"path":"/api/v1/workflows/{id}/status","methods":["GET","OPTIONS"],"auth":"apiKey","sourceFile":"src/app/api/v1/workflows/[id]/status/route.ts"},{"path":"/api/v1/workflows/{id}","methods":["GET","OPTIONS"],"auth":"apiKey","sourceFile":"src/app/api/v1/workflows/[id]/route.ts"},{"path":"/api/v1/workflows","methods":["GET","OPTIONS"],"auth":"apiKey","sourceFile":"src/app/api/v1/workflows/route.ts"},{"path":"/mcp/http","methods":["OPTIONS","POST"],"auth":"public","sourceFile":"src/app/mcp/http/route.ts"},{"path":"/mcp/messages","methods":["OPTIONS","POST"],"auth":"public","sourceFile":"src/app/mcp/messages/route.ts"},{"path":"/mcp/sse","methods":["GET"],"auth":"public","sourceFile":"src/app/mcp/sse/route.ts"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"Form":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"companyName":{"type":"string"},"companyDescription":{"type":"string"},"valueProposition":{"type":"string"},"exampleMessage":{"type":"string"},"signatureName":{"type":"string"},"personalLinkedInUrl":{"type":"string","format":"uri"},"expectedIndustry":{"type":"string"},"supportingDocs":{"type":"string"},"outreachChannel":{"type":"string","enum":["linkedin","email","sms","whatsapp"]},"sequenceCount":{"type":"integer","minimum":1,"maximum":5,"default":1},"idealCustomerProfile":{"type":"string"},"painPoints":{"type":"string"},"isPublic":{"type":"boolean","default":false},"lightResearch":{"type":"boolean","default":false},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","companyName","valueProposition","exampleMessage","signatureName","personalLinkedInUrl","outreachChannel","sequenceCount","isPublic","createdAt","updatedAt"]},"CreateFormRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500},"companyName":{"type":"string","minLength":1,"maxLength":100},"companyDescription":{"type":"string","maxLength":1000},"valueProposition":{"type":"string","minLength":10,"maxLength":1000},"exampleMessage":{"type":"string","minLength":20,"maxLength":2000},"signatureName":{"type":"string","minLength":1,"maxLength":100},"personalLinkedInUrl":{"type":"string","format":"uri"},"expectedIndustry":{"type":"string"},"supportingDocs":{"type":"string","maxLength":2000},"outreachChannel":{"type":"string","enum":["linkedin","email","sms","whatsapp"],"default":"linkedin"},"sequenceCount":{"type":"integer","minimum":1,"maximum":5,"default":1},"idealCustomerProfile":{"type":"string","maxLength":1000},"painPoints":{"type":"string","maxLength":1000},"isPublic":{"type":"boolean","default":false},"lightResearch":{"type":"boolean","default":false}},"required":["name","companyName","valueProposition","exampleMessage","signatureName","personalLinkedInUrl"]},"ProspectsUpload":{"type":"object","properties":{"data":{"type":"string","description":"Base64-encoded file data"},"filename":{"type":"string"},"mimeType":{"type":"string"}},"required":["data","filename","mimeType"]},"ApiError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"]},"requestId":{"type":"string"}},"required":["error"]},"CreateLeadWithFormRequest":{"type":"object","properties":{"formId":{"type":"string","minLength":1},"linkedinUrl":{"type":"string","format":"uri"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","format":"email"},"company":{"type":"string"},"title":{"type":"string"},"phone":{"type":"string"},"location":{"type":"string"},"industry":{"type":"string"},"companySize":{"type":"string"},"outreachChannel":{"type":"string","enum":["linkedin","email","sms","whatsapp"]},"sequenceCount":{"type":"integer","minimum":1,"maximum":5},"lightResearch":{"type":"boolean"},"researchLevel":{"type":"string","enum":["none","light","medium","deep"]},"clientWebsite":{"type":"string","format":"uri"}},"required":["formId","linkedinUrl"]},"CreateLeadWithContextRequest":{"type":"object","properties":{"companyName":{"type":"string","minLength":1},"companyDescription":{"type":"string","minLength":1},"valueProposition":{"type":"string","minLength":1},"clientLinkedinUrl":{"type":"string","format":"uri"},"idealCustomerProfile":{"type":"string","minLength":1},"painPoints":{"type":"string","minLength":1},"clientWebsite":{"type":"string","format":"uri"},"lead":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","format":"email"},"company":{"type":"string"},"title":{"type":"string"},"linkedinUrl":{"type":"string","format":"uri"},"phone":{"type":"string"},"location":{"type":"string"},"industry":{"type":"string"},"companySize":{"type":"string"}},"required":["linkedinUrl"]},"outreachChannel":{"type":"string","enum":["linkedin","email","sms","whatsapp"]},"sequenceCount":{"type":"integer","minimum":1,"maximum":5},"lightResearch":{"type":"boolean"},"researchLevel":{"type":"string","enum":["none","light","medium","deep"]},"websiteCrawl":{"type":"boolean"},"websiteColumnName":{"type":"string"}},"required":["companyName","companyDescription","valueProposition","clientLinkedinUrl","idealCustomerProfile","painPoints","lead"]},"CreateLeadRequest":{"oneOf":[{"$ref":"#/components/schemas/CreateLeadWithFormRequest"},{"$ref":"#/components/schemas/CreateLeadWithContextRequest"}]},"ResearchRequest":{"oneOf":[{"type":"object","properties":{"formId":{"type":"string","minLength":1},"linkedinUrl":{"type":"string","format":"uri"},"researchLevel":{"type":"string","enum":["none","light","medium","deep"]},"lightResearch":{"type":"boolean"},"researchPromptOverride":{"type":"string"},"messagePromptOverride":{"type":"string"},"clientWebsite":{"type":"string","format":"uri"}},"required":["formId","linkedinUrl"]},{"type":"object","properties":{"linkedinUrl":{"type":"string","format":"uri"},"companyName":{"type":"string","minLength":1},"companyDescription":{"type":"string","minLength":1},"valueProposition":{"type":"string","minLength":1},"personalLinkedInUrl":{"type":"string","format":"uri"},"clientLinkedinUrl":{"type":"string","format":"uri","description":"Deprecated; use personalLinkedInUrl"},"idealCustomerProfile":{"type":"string","minLength":1},"painPoints":{"type":"string","minLength":1},"exampleMessage":{"type":"string"},"signatureName":{"type":"string"},"expectedIndustry":{"type":"string"},"supportingDocs":{"type":"string"},"researchLevel":{"type":"string","enum":["none","light","medium","deep"]},"lightResearch":{"type":"boolean"},"researchPromptOverride":{"type":"string"},"messagePromptOverride":{"type":"string"},"clientWebsite":{"type":"string","format":"uri"}},"required":["linkedinUrl","companyName","companyDescription","valueProposition","idealCustomerProfile","painPoints"],"anyOf":[{"required":["personalLinkedInUrl"]},{"required":["clientLinkedinUrl"]}]},{"$ref":"#/components/schemas/ApiWorkflowSubmissionRequest"}]},"ApiWorkflowSubmissionRequest":{"type":"object","properties":{"companyName":{"type":"string","minLength":1},"companyDescription":{"type":"string","minLength":1},"valueProposition":{"type":"string","minLength":1},"personalLinkedInUrl":{"type":"string","format":"uri"},"clientLinkedinUrl":{"type":"string","format":"uri","description":"Deprecated; use personalLinkedInUrl"},"idealCustomerProfile":{"type":"string","minLength":1},"painPoints":{"type":"string","minLength":1},"clientWebsite":{"type":"string","format":"uri"},"listType":{"type":"string","enum":["LH","Apollo","Expandi","Instantly","CrunchBase"]},"prospects":{"$ref":"#/components/schemas/ProspectsUpload"},"outreachChannel":{"type":"string","enum":["linkedin","email","sms","whatsapp"]},"sequenceCount":{"type":"integer","minimum":1,"maximum":5},"dryRun":{"type":"boolean"},"sliceEnabled":{"type":"boolean"},"sliceStart":{"type":"integer","minimum":1},"sliceEnd":{"type":"integer","minimum":1},"selectedRows":{"type":"array","items":{"type":"integer","minimum":1}},"lightResearch":{"type":"boolean"},"websiteCrawl":{"type":"boolean"},"websiteColumnName":{"type":"string"},"researchLevel":{"type":"string","enum":["none","light","medium","deep"]}},"required":["companyName","companyDescription","valueProposition","idealCustomerProfile","painPoints","prospects"],"anyOf":[{"required":["personalLinkedInUrl"]},{"required":["clientLinkedinUrl"]}]}}},"security":[{"ApiKeyAuth":[]}],"paths":{"/api/v1/forms":{"post":{"summary":"Create form template","tags":["Forms"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFormRequest"}}}},"responses":{"200":{"description":"Form created","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"form":{"$ref":"#/components/schemas/Form"}},"required":["success","form"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"summary":"List forms","tags":["Forms"],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"limit","in":"query","schema":{"type":"integer","default":20,"maximum":100}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"channel","in":"query","schema":{"type":"string","enum":["linkedin","email","sms","whatsapp"]}},{"name":"includePublic","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"List of forms","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"forms":{"type":"array","items":{"$ref":"#/components/schemas/Form"}}},"required":["success","forms"]}}}}}}},"/api/v1/forms/{id}":{"get":{"summary":"Get form","tags":["Forms"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Form","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"form":{"$ref":"#/components/schemas/Form"},"_links":{"type":"object"}},"required":["success","form"]}}}},"404":{"description":"Not found"}}},"patch":{"summary":"Update form","tags":["Forms"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFormRequest"}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"form":{"$ref":"#/components/schemas/Form"},"_links":{"type":"object"}},"required":["success","form"]}}}},"404":{"description":"Not found"}}},"delete":{"summary":"Delete form","tags":["Forms"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted"},"404":{"description":"Not found"}}}},"/api/v1/leads":{"post":{"summary":"Process single lead","tags":["Leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLeadRequest"}}}},"responses":{"200":{"description":"Queued"},"400":{"description":"Invalid"},"402":{"description":"Insufficient credits"}}}},"/api/v1/research":{"post":{"summary":"Research only (no qualification/messages)","tags":["Workflows"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchRequest"}}}},"responses":{"200":{"description":"Workflow started"},"400":{"description":"Invalid"},"402":{"description":"Insufficient credits"},"429":{"description":"Rate limited"}}}},"/api/v1/form":{"post":{"summary":"Submit batch form with prospects file","tags":["Workflows"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiWorkflowSubmissionRequest"}}}},"responses":{"200":{"description":"Workflow started"},"400":{"description":"Invalid"},"429":{"description":"Rate limited"}}}},"/api/v1/workflows":{"get":{"summary":"List workflows","tags":["Workflows"],"responses":{"200":{"description":"OK"}}}},"/api/v1/workflows/{id}":{"get":{"summary":"Get workflow","tags":["Workflows"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}}},"/api/v1/workflows/{id}/results":{"get":{"summary":"Get workflow results","tags":["Workflows"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"limit","in":"query","schema":{"type":"integer","default":20,"maximum":100}},{"name":"qualified","in":"query","schema":{"type":"string","enum":["true","false","all"],"default":"all"}},{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv","all"],"default":"json"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}}},"/api/v1/workflows/{id}/status":{"get":{"summary":"Get workflow status (lightweight)","tags":["Workflows"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}}},"/api/v1/credits":{"get":{"summary":"Get credit balance and usage","tags":["Credits"],"parameters":[{"name":"days","in":"query","schema":{"type":"integer","default":30,"minimum":1,"maximum":90}},{"name":"includeHistory","in":"query","schema":{"type":"string","enum":["true","false"],"default":"false"}}],"responses":{"200":{"description":"OK"}}}}},"tags":[{"name":"Forms"},{"name":"Leads"},{"name":"Workflows"},{"name":"Credits"}]}