{"openapi":"3.1.0","info":{"title":"FreshView ML Prediction API","version":"0.1.0"},"paths":{"/predict":{"post":{"summary":"Predict","operationId":"predict_predict_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/score-email":{"post":{"summary":"Score Email","operationId":"score_email_score_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoreEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PredictionRequest":{"properties":{"word_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Word Count","default":0},"paragraph_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Paragraph Count","default":0},"image_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Image Count","default":0},"button_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Button Count","default":0},"link_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Link Count","default":0},"primary_cta_position":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Primary Cta Position","default":0.0},"fk_reading_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fk Reading Score","default":0.0},"sl_character_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sl Character Count","default":0},"sl_word_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sl Word Count","default":0},"sl_include_emoji":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sl Include Emoji","default":0},"prev_character_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prev Character Count","default":0},"prev_word_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prev Word Count","default":0},"copy_density":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Copy Density","default":0.0},"cta_density":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cta Density","default":0.0},"urgency_language_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Urgency Language Ratio","default":0.0},"sentiment_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sentiment Score","default":0.0},"casual_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Casual Score","default":0.0},"urgent_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Urgent Score","default":0.0},"formal_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Formal Score","default":0.0},"persuasive_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Persuasive Score","default":0.0},"informative_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Informative Score","default":0.0},"sl_sentiment_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sl Sentiment Score","default":0.0},"emotion_primary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Emotion Primary","default":"unknown"},"sl_top_emotion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sl Top Emotion","default":"unknown"},"narrative_person":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Narrative Person","default":"unknown"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","default":"unknown"},"cta_primary_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cta Primary Type","default":"unknown"},"cta_primary_strength":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cta Primary Strength","default":0.0},"match_offer_present":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Match Offer Present","default":0},"sent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sent At"},"year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"},"month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Month"},"day":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Day"},"daynum":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Daynum"},"weeknum":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Weeknum"},"time":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Time"},"monthly_emails":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Emails","default":5},"sender_is_person":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sender Is Person","default":0},"sender_urgency":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sender Urgency","default":0.0},"sender_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Type","default":"unknown"}},"type":"object","title":"PredictionRequest"},"PredictionResponse":{"properties":{"open_pred":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Open Pred"},"ctr_pred":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ctr Pred"},"click_to_open_pred":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Click To Open Pred"},"donate_pred":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Donate Pred"},"unsubscribe_pred":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unsubscribe Pred"},"spam_pred":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spam Pred"},"freshview_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Freshview Score"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"PredictionResponse"},"ScoreEmailRequest":{"properties":{"email_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Type","default":"fundraising"},"subject":{"type":"string","title":"Subject"},"body":{"type":"string","title":"Body"},"audience":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audience"},"goal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goal"}},"type":"object","required":["subject","body"],"title":"ScoreEmailRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}