{"openapi":"3.1.0","info":{"title":"AutoLead API","version":"1.0.0","description":"Lead generation, CRM and outreach. Authenticate with an API key created in Settings → API keys. Each key only has the permissions chosen when it was created."},"servers":[{"url":"https://autolead.kairosholdings.xyz/api/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"alk_… API key"}}},"paths":{"/me":{"get":{"summary":"Key info and scopes","responses":{"200":{"description":"Key","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/kpis":{"get":{"summary":"KPI dashboard","parameters":[{"name":"days","in":"query","schema":{"type":"integer","default":30}}],"responses":{"200":{"description":"KPIs","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/leads":{"get":{"summary":"List leads (scope lead:read)","parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"stage","in":"query","schema":{"type":"string"}},{"name":"tier","in":"query","schema":{"type":"string"}},{"name":"source","in":"query","schema":{"type":"string"}},{"name":"searchId","in":"query","schema":{"type":"string"}},{"name":"ownerUserId","in":"query","schema":{"type":"string"}},{"name":"hasEmail","in":"query","schema":{"type":"string"}},{"name":"sort","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"string"}},{"name":"pageSize","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"{ items, total, page, pageSize }","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"summary":"Create lead (lead:create)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"website":{"type":"string"},"contactName":{"type":"string"},"location":{"type":"string"},"sector":{"type":"string"},"notes":{"type":"string"}},"required":["name"]}}}},"responses":{"201":{"description":"Lead","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/leads/{id}":{"get":{"summary":"Lead with timeline","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Lead","content":{"application/json":{"schema":{"type":"object"}}}}}},"patch":{"summary":"Update lead (lead:update)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stage":{"type":"string"},"notes":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"doNotContact":{"type":"boolean"}},"required":[]}}}},"responses":{"200":{"description":"Lead","content":{"application/json":{"schema":{"type":"object"}}}}}},"delete":{"summary":"Delete lead (lead:delete)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ deleted }","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/leads/export":{"get":{"summary":"CSV export (lead:export)","responses":{"200":{"description":"text/csv"}}}},"/searches":{"get":{"summary":"Recent searches","responses":{"200":{"description":"Search[]","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"summary":"Start a lead search (search:run). Returns 202; poll /searches/{id}","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keywords":{"type":"string"},"location":{"type":"string"},"sources":{"type":"array","items":{"enum":["google_maps","bing","linkedin","indeed","net_empregos","wellfound"]}},"maxResults":{"type":"integer","maximum":50}},"required":["keywords"]}}}},"responses":{"202":{"description":"Search","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/searches/{id}":{"get":{"summary":"Search progress and stats","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Search","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/scoring":{"post":{"summary":"Queue AI scoring (lead:update)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadIds":{"type":"array","items":{"type":"string"}}},"required":[]}}}},"responses":{"202":{"description":"{ queued, jobIds }","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/campaigns":{"get":{"summary":"Campaigns with stats","responses":{"200":{"description":"Campaign[]","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"summary":"Create campaign (campaign:manage)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"mailboxIds":{"type":"array","items":{"type":"string"}},"offerId":{"type":"string"},"icpProfileId":{"type":"string"},"timezone":{"type":"string"},"aiPersonalize":{"type":"boolean"}},"required":["name"]}}}},"responses":{"201":{"description":"Campaign","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/campaigns/{id}":{"get":{"summary":"Campaign with steps and enrollments","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Campaign","content":{"application/json":{"schema":{"type":"object"}}}}}},"patch":{"summary":"Update campaign","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Campaign","content":{"application/json":{"schema":{"type":"object"}}}}}},"delete":{"summary":"Delete campaign","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ deleted }","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/campaigns/{id}/steps":{"put":{"summary":"Replace the sequence (email = sent automatically, task = to-do for the team)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"kind":{"enum":["email","task"]},"delayDays":{"type":"integer"},"subject":{"type":"string"},"body":{"type":"string"}}}}},"required":["steps"]}}}},"responses":{"200":{"description":"Steps","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/tasks":{"get":{"summary":"Tasks (lead:read)","parameters":[{"name":"status","in":"query","schema":{"type":"string"}},{"name":"leadId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Task[]","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"summary":"Create task or meeting (lead:update)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadId":{"type":"string"},"type":{"enum":["follow_up","call","meeting","linkedin","other"]},"title":{"type":"string"},"notes":{"type":"string"},"dueAt":{"type":"string"},"endsAt":{"type":"string"},"meetingUrl":{"type":"string"}},"required":["title"]}}}},"responses":{"201":{"description":"Task","content":{"application/json":{"schema":{"type":"object"}}}}}},"patch":{"summary":"Change status of tasks","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}},"status":{"enum":["open","done","cancelled"]}},"required":["ids","status"]}}}},"responses":{"200":{"description":"{ updated }","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/leads/import":{"post":{"summary":"Import leads from rows or a CSV/XLSX file (lead:create)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object"}}},"required":["rows"]}}}},"responses":{"201":{"description":"{ created, duplicates, invalid }","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/leads/{id}/contacts":{"post":{"summary":"Add a person to a lead (lead:update)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"linkedinUrl":{"type":"string"}},"required":[]}}}},"responses":{"201":{"description":"Contact","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/offers":{"get":{"summary":"Offers","responses":{"200":{"description":"Offer[]","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/icps":{"get":{"summary":"Ideal customer profiles","responses":{"200":{"description":"ICP[]","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/campaigns/{id}/enroll":{"post":{"summary":"Enroll leads (campaign:launch)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadIds":{"type":"array","items":{"type":"string"}}},"required":["leadIds"]}}}},"responses":{"200":{"description":"{ enrolled, skipped }","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/campaigns/{id}/status":{"post":{"summary":"Activate / pause (campaign:launch)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"enum":["active","paused","completed"]}},"required":["status"]}}}},"responses":{"200":{"description":"Campaign","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}