{"openapi":"3.0.3","info":{"title":"Outreach Leads API","version":"1.0.0","description":"Push leads in and read back what is already known, so an external lead-generation agent never sends the same contact twice."},"servers":[{"url":"https:\/\/outreach.palus.sk"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Lead":{"type":"object","required":["email","category"],"properties":{"email":{"type":"string","format":"email"},"name":{"type":"string"},"company":{"type":"string"},"category":{"type":"string","description":"Required for leads the brand does not know yet; a new lead without it is rejected with missing_category."},"city":{"type":"string"},"country":{"type":"string"},"language":{"type":"string"},"website":{"type":"string"},"instagram":{"type":"string"},"phone":{"type":"string"},"source":{"type":"string"},"custom":{"type":"object","additionalProperties":true}},"additionalProperties":true}}},"security":[{"bearerAuth":[]}],"paths":{"\/api\/handleLeads":{"post":{"summary":"Push a batch of leads","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Retrying with the same key returns the original response instead of creating duplicates."}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["brand_id","leads"],"properties":{"brand_id":{"type":"integer"},"leads":{"type":"array","maxItems":500,"items":{"$ref":"#\/components\/schemas\/Lead"}}}}}}},"responses":{"202":{"description":"Accepted and queued"},"401":{"description":"Missing or invalid token"},"403":{"description":"brand_id does not match the token"},"409":{"description":"The same Idempotency-Key is still being processed"},"422":{"description":"Validation failed"},"429":{"description":"Rate limited"}}}},"\/api\/existingLeads":{"get":{"summary":"List leads already known for this brand","parameters":[{"name":"brand_id","in":"query","required":true,"schema":{"type":"integer"}},{"name":"cursor","in":"query","schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer","maximum":2000}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"mode","in":"query","schema":{"type":"string","enum":["full","light"]}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"category","in":"query","schema":{"type":"string"}},{"name":"include_suppressed","in":"query","schema":{"type":"boolean"}},{"name":"If-None-Match","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of leads"},"304":{"description":"Not modified \u2014 the ETag matched"}}}},"\/api\/leadBatches\/{batch}":{"get":{"summary":"Final per-lead results of a batch","parameters":[{"name":"batch","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Batch status and results"}}}}}}