{"openapi":"3.0.3","info":{"title":"A8CMail API","version":"1.0.0"},"paths":{"/emails":{"get":{"tags":["Emails"],"summary":"List all emails","responses":{"200":{"description":"A list of emails","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Email"}}}}}}},"post":{"tags":["Emails"],"summary":"Create a new email","responses":{"201":{"description":"Email created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Email"}}}}}}},"/emails/{id}":{"get":{"tags":["Emails"],"summary":"Get email by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Email retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Email"}}}}}},"put":{"tags":["Emails"],"summary":"Update an email","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Email updated"}}},"delete":{"tags":["Emails"],"summary":"Delete an email","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Email deleted"}}}},"/email-props":{"get":{"tags":["Email Properties"],"summary":"List all email properties","responses":{"200":{"description":"A list of email properties","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmailProps"}}}}}}},"post":{"tags":["Email Properties"],"summary":"Create new email properties","responses":{"201":{"description":"Email properties created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailProps"}}}}}}},"/email-props/{id}":{"get":{"tags":["Email Properties"],"summary":"Get email properties by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Email properties retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailProps"}}}}}},"put":{"tags":["Email Properties"],"summary":"Update email properties","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Email properties updated"}}},"delete":{"tags":["Email Properties"],"summary":"Delete email properties","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Email properties deleted"}}}},"/campaigns":{"get":{"tags":["Campaigns"],"summary":"List all campaigns","responses":{"200":{"description":"A list of campaigns","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}}}}}}},"post":{"tags":["Campaigns"],"summary":"Create a new campaign","responses":{"201":{"description":"Campaign created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}}}}},"/campaigns/{id}":{"get":{"tags":["Campaigns"],"summary":"Get campaign by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Campaign retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}}}},"put":{"tags":["Campaigns"],"summary":"Update a campaign","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Campaign updated"}}},"delete":{"tags":["Campaigns"],"summary":"Delete a campaign","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Campaign deleted"}}}},"/tags":{"get":{"tags":["Personalization Tags"],"summary":"List all personalization tags","responses":{"200":{"description":"A list of tags","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}}}}}}},"post":{"tags":["Personalization Tags"],"summary":"Create a new personalization tag","responses":{"201":{"description":"Tag created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}}}}},"/tags/{id}":{"get":{"tags":["Personalization Tags"],"summary":"Get personalization tag by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Tag retrieved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}}}},"put":{"tags":["Personalization Tags"],"summary":"Update a personalization tag","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Tag updated"}}},"delete":{"tags":["Personalization Tags"],"summary":"Delete a personalization tag","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Tag deleted"}}}},"/metrics":{"get":{"tags":["Metrics"],"summary":"List all metrics","responses":{"200":{"description":"A list of metrics","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Metric"}}}}}}},"post":{"tags":["Metrics"],"summary":"Create a new metric","responses":{"201":{"description":"Metric created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}}}}},"/metrics/{id}":{"get":{"tags":["Metrics"],"summary":"Get metric by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Metric details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Metric"}}}}}},"put":{"tags":["Metrics"],"summary":"Update a metric","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Metric updated"}}},"delete":{"tags":["Metrics"],"summary":"Delete a metric","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Metric deleted"}}}},"/campaign-metrics":{"get":{"tags":["Campaign Metrics"],"summary":"List all campaign metrics","responses":{"200":{"description":"A list of campaign metrics","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CampaignMetric"}}}}}}},"post":{"tags":["Campaign Metrics"],"summary":"Create a new campaign metric","responses":{"201":{"description":"Campaign metric created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignMetric"}}}}}}},"/campaign-metrics/{id}":{"get":{"tags":["Campaign Metrics"],"summary":"Get campaign metric by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Campaign metric details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignMetric"}}}}}},"put":{"tags":["Campaign Metrics"],"summary":"Update a campaign metric","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Campaign metric updated"}}},"delete":{"tags":["Campaign Metrics"],"summary":"Delete a campaign metric","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Campaign metric deleted"}}}},"/email-metrics":{"get":{"tags":["Email Metrics"],"summary":"List all email metrics","responses":{"200":{"description":"A list of email metrics","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmailMetric"}}}}}}},"post":{"tags":["Email Metrics"],"summary":"Create a new email metric","responses":{"201":{"description":"Email metric created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailMetric"}}}}}}},"/email-metrics/{id}":{"get":{"tags":["Email Metrics"],"summary":"Get email metric by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Email metric details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailMetric"}}}}}},"put":{"tags":["Email Metrics"],"summary":"Update an email metric","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Email metric updated"}}},"delete":{"tags":["Email Metrics"],"summary":"Delete an email metric","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Email metric deleted"}}}},"/business-units":{"get":{"tags":["Business Units"],"summary":"List all business units","responses":{"200":{"description":"A list of business units","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BusinessUnit"}}}}}}},"post":{"tags":["Business Units"],"summary":"Create a new business unit","responses":{"201":{"description":"Business unit created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessUnit"}}}}}}},"/business-units/{id}":{"get":{"tags":["Business Units"],"summary":"Get business unit by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Business unit details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessUnit"}}}}}},"put":{"tags":["Business Units"],"summary":"Update a business unit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Business unit updated"}}},"delete":{"tags":["Business Units"],"summary":"Delete a business unit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Business unit deleted"}}}},"/opt-out-categories":{"get":{"tags":["Opt-Out Categories"],"summary":"List all opt-out categories","responses":{"200":{"description":"A list of opt-out categories","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OptOutCategory"}}}}}}},"post":{"tags":["Opt-Out Categories"],"summary":"Create a new opt-out category","responses":{"201":{"description":"Opt-out category created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptOutCategory"}}}}}}},"/opt-out-categories/{id}":{"get":{"tags":["Opt-Out Categories"],"summary":"Get opt-out category by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Opt-out category details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptOutCategory"}}}}}},"put":{"tags":["Opt-Out Categories"],"summary":"Update an opt-out category","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Opt-out category updated"}}},"delete":{"tags":["Opt-Out Categories"],"summary":"Delete an opt-out category","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Opt-out category deleted"}}}},"/email-appointments":{"get":{"tags":["Email Appointments"],"summary":"List all email appointments","responses":{"200":{"description":"A list of email appointments","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmailAppointment"}}}}}}},"post":{"tags":["Email Appointments"],"summary":"Create a new email appointment","responses":{"201":{"description":"Email appointment created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailAppointment"}}}}}}},"/email-appointments/{id}":{"get":{"tags":["Email Appointments"],"summary":"Get email appointment by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Email appointment details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailAppointment"}}}}}},"put":{"tags":["Email Appointments"],"summary":"Update an email appointment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Email appointment updated"}}},"delete":{"tags":["Email Appointments"],"summary":"Delete an email appointment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Email appointment deleted"}}}},"/email-sends":{"get":{"tags":["Email Sends"],"summary":"List all email sends","responses":{"200":{"description":"A list of email sends","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmailSend"}}}}}}},"post":{"tags":["Email Sends"],"summary":"Create a new email send","responses":{"201":{"description":"Email send created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSend"}}}}}}},"/email-sends/{id}":{"get":{"tags":["Email Sends"],"summary":"Get email send by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Email send details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSend"}}}}}},"put":{"tags":["Email Sends"],"summary":"Update an email send","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Email send updated"}}},"delete":{"tags":["Email Sends"],"summary":"Delete an email send","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Email send deleted"}}}},"/brand-kits":{"get":{"tags":["Brand Kits"],"summary":"List all brand kits","responses":{"200":{"description":"A list of brand kits","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BrandKit"}}}}}}},"post":{"tags":["Brand Kits"],"summary":"Create a new brand kit","responses":{"201":{"description":"Brand kit created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandKit"}}}}}}},"/brand-kits/{id}":{"get":{"tags":["Brand Kits"],"summary":"Get brand kit by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Brand kit details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandKit"}}}}}},"put":{"tags":["Brand Kits"],"summary":"Update a brand kit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Brand kit updated"}}},"delete":{"tags":["Brand Kits"],"summary":"Delete a brand kit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Brand kit deleted"}}}},"/alert-thresholds":{"get":{"tags":["Alert Thresholds"],"summary":"List all alert thresholds","responses":{"200":{"description":"A list of alert thresholds","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AlertThreshold"}}}}}}},"post":{"tags":["Alert Thresholds"],"summary":"Create a new alert threshold","responses":{"201":{"description":"Alert threshold created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertThreshold"}}}}}}},"/alert-thresholds/{id}":{"get":{"tags":["Alert Thresholds"],"summary":"Get alert threshold by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Alert threshold details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertThreshold"}}}}}},"put":{"tags":["Alert Thresholds"],"summary":"Update an alert threshold","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Alert threshold updated"}}},"delete":{"tags":["Alert Thresholds"],"summary":"Delete an alert threshold","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Alert threshold deleted"}}}},"/alerts":{"get":{"tags":["Alerts"],"summary":"List all alerts","responses":{"200":{"description":"A list of alerts","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Alert"}}}}}}},"post":{"tags":["Alerts"],"summary":"Create a new alert","responses":{"201":{"description":"Alert created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Alert"}}}}}}},"/alerts/{id}":{"get":{"tags":["Alerts"],"summary":"Get alert by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Alert details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Alert"}}}}}},"put":{"tags":["Alerts"],"summary":"Update an alert","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Alert updated"}}},"delete":{"tags":["Alerts"],"summary":"Delete an alert","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Alert deleted"}}}}},"components":{"schemas":{"Email":{"type":"object","properties":{"id":{"type":"integer"},"subject":{"type":"string"},"body":{"type":"string"}},"example":{"id":1,"subject":"Spring Sale Announcement","body":"<p>Don't miss our spring sale!</p>"}},"EmailProps":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"from":{"type":"string"}},"example":{"id":10,"name":"Welcome Email","from":"noreply@example.com"}},"Campaign":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"type":{"type":"string"}},"example":{"id":20,"name":"Reactivation Campaign","type":"email"}},"Metric":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"value":{"type":"number"}},"example":{"id":30,"name":"Open Rate","value":45.5}},"CampaignMetric":{"type":"object","properties":{"id":{"type":"integer"},"campaign_id":{"type":"integer"},"metric_id":{"type":"integer"}},"example":{"id":1,"campaign_id":20,"metric_id":30}},"EmailMetric":{"type":"object","properties":{"id":{"type":"integer"},"email_id":{"type":"integer"},"metric_id":{"type":"integer"}},"example":{"id":2,"email_id":1,"metric_id":30}},"BusinessUnit":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"example":{"id":5,"name":"Marketing Team"}},"Alert":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":"string"},"message":{"type":"string"}},"example":{"id":42,"type":"bounce_rate_high","message":"Bounce rate exceeded 10%"}},"OptOutCategory":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"}},"example":{"id":7,"name":"Promotional Emails"}},"Tag":{"type":"object","properties":{"id":{"type":"integer"},"key":{"type":"string"},"placeholder":{"type":"string"}},"example":{"id":15,"key":"{{user.first_name}}","placeholder":"John"}},"AlertThreshold":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"value":{"type":"number"}},"example":{"id":60,"name":"high_unsubscribe","value":5.0}},"EmailAppointment":{"type":"object","properties":{"id":{"type":"integer"},"email_id":{"type":"integer"},"user_id":{"type":"integer"},"scheduled_at":{"type":"string","format":"date-time"}},"example":{"id":3,"email_id":1,"user_id":101,"scheduled_at":"2025-05-01T10:00:00Z"}},"EmailSend":{"type":"object","properties":{"id":{"type":"integer"},"appointment_id":{"type":"integer"},"status":{"type":"string"},"sent_at":{"type":"string","format":"date-time"}},"example":{"id":4,"appointment_id":3,"status":"sent","sent_at":"2025-05-01T10:02:00Z"}},"BrandKit":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"blocks":{"type":"object"}},"example":{"id":8,"name":"default-kit","blocks":{"header":"<header>Header</header>","footer":"<footer>Footer</footer>"}}}}},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/automattic-787/a8cmail/1.0.0"}]}