{"openapi":"3.0.4","info":{"title":"Public Newsletters API","version":"1.0.0"},"servers":[{"url":"https://newsletters.dialogapi.no"}],"paths":{"/api/public/v1/newsletters/{id}/send":{"parameters":[{"name":"id","in":"path","description":"newsletter ID","required":true,"schema":{"type":"integer"}}],"post":{"summary":"Creates sending","tags":["Newsletters"],"parameters":[],"responses":{"200":{"description":"Return stats","content":{"application/json":{"examples":{"example":{"value":{"id":32,"clicks":0,"unique_clicks":0,"opens":0,"bounce":0,"unsubscribes":0,"tracking_mode":"count","sent":0,"created_at":"2026-01-01T12:00:00.000+01:00","sent_at":null,"openrate":0,"newsletter_screenshot_url":"http://localhost:3000/v4/d013455e-f392-46d5-851e-08f5fe4735c7/1767265200","mailbody":"https://example.com/v/d013455e-f392-46d5-851e-08f5fe4735c7","delivered":0,"subject":"Subject","from_email":"personal@email.com","tags":[],"sending_id":null,"segment":{"id":"1","title":null}}}}}}},"422":{"description":"Return error","content":{"application/json":{"examples":{"example":{"value":{"error":"Sender has not verified an email"}}}}}},"401":{"description":"Unathorized","content":{"application/json":{"examples":{"example":{"value":{"status":"401 Unauthorized"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/newsletter_settings_params"}}},"required":true,"description":"Newsletter settings"}}},"/api/public/v1/newsletters/stats":{"get":{"summary":"Show newsletters stats","tags":["Newsletters"],"parameters":[{"name":"from_date","in":"query","required":false,"schema":{"type":"string"}},{"name":"to_date","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return stats","content":{"application/json":{"examples":{"example":{"value":[{"id":37,"clicks":30,"unique_clicks":10,"opens":90,"bounce":5,"unsubscribes":3,"tracking_mode":"standard","sent":100,"created_at":"2020-11-20T12:30:00.000+01:00","sent_at":"2020-11-20T12:30:00.000+01:00","openrate":94.7,"newsletter_screenshot_url":"http://localhost:3000/v4/8ccdcc45-3a39-4962-8142-487ae67daeca/1767265200","mailbody":"https://example.com/v/8ccdcc45-3a39-4962-8142-487ae67daeca","delivered":95,"subject":"SendingSubject","from_email":"testmail@mail.sndr.nb","tags":[],"sending_id":0,"lists":[{"id":"1","title":"ListTitle1"},{"id":"2","title":"ListTitle2"}]}]}}}}},"400":{"description":"Return error","content":{"application/json":{"examples":{"example":{"value":{"error":"The date is not in the correct format. Correct format is year-month-day, e.g. 2021-06-19"}}}}}},"401":{"description":"Unathorized","content":{"application/json":{"examples":{"example":{"value":{"status":"401 Unauthorized"}}}}}}}}},"/api/public/v1/newsletters/{id}/stats":{"parameters":[{"name":"id","in":"path","description":"sending ID","required":true,"schema":{"type":"integer"}}],"get":{"summary":"Show newsletter stats","tags":["Newsletters"],"responses":{"200":{"description":"Return stats","content":{"application/json":{"examples":{"example":{"value":{"id":43,"clicks":30,"unique_clicks":10,"opens":90,"bounce":5,"unsubscribes":3,"tracking_mode":"standard","sent":100,"created_at":"2020-11-20T12:30:00.000+01:00","sent_at":"2020-11-20T12:30:00.000+01:00","openrate":94.7,"newsletter_screenshot_url":"http://localhost:3000/v4/8ccdcc45-3a39-4962-8142-487ae67daeca/1767265200","mailbody":"https://example.com/v/8ccdcc45-3a39-4962-8142-487ae67daeca","delivered":95,"subject":"SendingSubject","from_email":"testmail@mail.sndr.nb","tags":["tagtitle"],"sending_id":0,"lists":[{"id":"1","title":"ListTitle1"},{"id":"2","title":"ListTitle2"}]}}}}}},"404":{"description":"Not Found","content":{"application/json":{"examples":{"example":{"value":{"status":"404 Not Found"}}}}}},"401":{"description":"Unathorized","content":{"application/json":{"examples":{"example":{"value":{"status":"401 Unauthorized"}}}}}}}}},"/api/public/v1/newsletters/{id}/stats_by_external_guid":{"parameters":[{"name":"id","in":"path","description":"sending external ID","required":true,"schema":{"type":"integer"}}],"get":{"summary":"Show newsletter stats","tags":["Newsletters"],"responses":{"200":{"description":"Return stats","content":{"application/json":{"examples":{"example":{"value":{"id":47,"clicks":30,"unique_clicks":10,"opens":90,"bounce":5,"unsubscribes":3,"tracking_mode":"standard","sent":100,"created_at":"2020-11-20T12:30:00.000+01:00","sent_at":"2020-11-20T12:30:00.000+01:00","openrate":94.7,"newsletter_screenshot_url":"http://localhost:3000/v4/8ccdcc45-3a39-4962-8142-487ae67daeca/1767265200","mailbody":"https://example.com/v/8ccdcc45-3a39-4962-8142-487ae67daeca","delivered":95,"subject":"SendingSubject","from_email":"testmail@mail.sndr.nb","tags":["tagtitle"],"sending_id":0,"lists":[{"id":"1","title":"ListTitle1"},{"id":"2","title":"ListTitle2"}]}}}}}},"404":{"description":"Not Found","content":{"application/json":{"examples":{"example":{"value":{"status":"404 Not Found"}}}}}},"401":{"description":"Unathorized","content":{"application/json":{"examples":{"example":{"value":{"status":"401 Unauthorized"}}}}}}}}},"/api/public/v1/recurring_actions":{"get":{"summary":"Return list of existing recurring actions","tags":["Recurring actions"],"responses":{"200":{"description":"Return recurring actions","content":{"application/json":{"examples":{"example":{"value":[{"id":1,"name":"Action #1","action":"send_email"}]}}}}},"401":{"description":"Unathorized","content":{"application/json":{"examples":{"example":{"value":{"status":"401 Unauthorized"}}}}}}}}},"/api/public/v1/recurring_actions/{id}/trigger":{"parameters":[{"name":"id","in":"path","description":"ID of recurring action","required":true,"schema":{"type":"integer"}}],"post":{"summary":"Trigger recurring action by ID","tags":["Recurring actions"],"parameters":[],"responses":{"200":{"description":"Recurring action started"},"401":{"description":"Unathorized","content":{"application/json":{"examples":{"example":{"value":{"status":"401 Unauthorized"}}}}}},"404":{"description":"Not Found","content":{"application/json":{"examples":{"example":{"value":{"status":"404 Not Found"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/recurring_action_trigger_params"}}},"description":"Trigger options"}}}},"security":[{"basic":[]}],"components":{"securitySchemes":{"basic":{"type":"http","scheme":"basic"}},"schemas":{"errors_object":{"type":"object","required":["status"],"properties":{"status":{"type":"string"}}},"newsletter_settings_params":{"type":"object","properties":{"segment_id":{"type":"integer"},"list_ids":{"type":"array","items":{"type":"integer"}},"sender_id":{"type":"integer"},"scheduled_at":{"type":"string","format":"date-time"}}},"newsletter_stats_single":{"type":"object","properties":{"id":{"type":"integer"},"sending_id":{"type":"integer","nullable":true},"clicks":{"type":"integer"},"unique_clicks":{"type":"integer"},"opens":{"type":"integer"},"bounce":{"type":"integer"},"unsubscribes":{"type":"integer"},"tracking_mode":{"type":"string"},"sent":{"type":"integer"},"created_at":{"type":"string","format":"datetime"},"sent_at":{"type":"string","format":"datetime","nullable":true},"openrate":{"type":"number","format":"float","nullable":true},"mailbody":{"type":"string"},"newsletter_screenshot_url":{"type":"string"},"delivered":{"type":"integer"},"subject":{"type":"string"},"from_email":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"lists":{"type":"array","items":{"type":"object"}},"segment":{"type":"object"}}},"newsletter_stats":{"type":"array","items":{"$ref":"#/components/schemas/newsletter_stats_single"}},"recurring_action":{"type":"object","required":["id","name","action"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"action":{"type":"string"}}},"recurring_action_trigger_params":{"type":"object","properties":{"guids":{"type":"array","nullable":true,"items":{"type":"string"}}}},"sending":{"type":"object","properties":{"id":{"type":"integer"},"subject":{"type":"string"},"openrate":{"type":"integer","nullable":true},"subscriber_list_ids":{"type":"array","items":{"type":"string"}},"send_at":{"type":"string","format":"date"},"sent_at":{"type":"string","format":"date","nullable":true},"unique_clicks":{"type":"integer"},"clicks":{"type":"integer"},"complaints":{"type":"integer"},"opens":{"type":"integer"},"bounce":{"type":"integer"},"unsubscribes":{"type":"integer"},"scheduled":{"type":"integer"},"sent":{"type":"integer"},"created_at":{"type":"string","format":"date"},"updated_at":{"type":"string","format":"date"}}}}}}