{"openapi":"3.1.0","info":{"title":"Amāia Email API","description":"\n    An API to operations data for sending Email.\n    ","contact":{"name":"Kage Technologies","email":"support.dev@kagetechnologies.com"},"license":{"name":"All rights reserved to Kage Technologies"},"version":"0.1.0"},"paths":{"/v1/email/send":{"post":{"tags":["Email"],"summary":"Send an email as the signed-in user","description":"The one send endpoint, for the web/mobile clients and for the agent alike.\n\nRequires the user's Firebase ID token (Authorization, or\nX-Forwarded-Authorization when a gateway or the agent forwards it) and\nX-Org-Id. The sender name and reply-to address come from the user's verified\nFirebase token; the caller supplies only recipients, subject, content type and body.","operationId":"send_email_v1_email_send_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-forwarded-authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Forwarded-Authorization"}},{"name":"x-org-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Organisation UUID (set by the API gateway)","title":"X-Org-Id"},"description":"Organisation UUID (set by the API gateway)"},{"name":"x-user-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End-user UUID","title":"X-User-Id"},"description":"End-user UUID"},{"name":"x-user-role","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Role the caller acts as","title":"X-User-Role"},"description":"Role the caller acts as"},{"name":"x-user-lang","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Caller's language, BCP 47 (e.g. en, fr-CA)","title":"X-User-Lang"},"description":"Caller's language, BCP 47 (e.g. en, fr-CA)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEmailRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ContentType":{"type":"string","enum":["text/plain","text/html","multipart/form-data"],"title":"ContentType"},"EmailType":{"type":"string","enum":["personal","notification"],"title":"EmailType","description":"Who the email appears to come from.\n\n* ``personal``: sent on the user's behalf -- From shows the user's name\n  (\"Jane Doe via Amaia\") and replies go to the user.\n* ``notification``: sent by the platform -- From shows \"Amāia Notification\"\n  in the user's language and there is no Reply-To."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SendEmailResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Delivery status reported by the mail provider","default":"queued"},"provider_message_id":{"type":"string","title":"Provider Message Id","description":"Message id assigned by the mail provider","default":""},"sent_by":{"type":"string","title":"Sent By","description":"Authenticated caller that requested the send","default":""},"org_id":{"type":"string","title":"Org Id","description":"Organisation the email was sent for (X-Org-Id)","default":""},"user_id":{"type":"string","title":"User Id","description":"End user the email was sent for (X-User-Id / token)","default":""},"correlation_id":{"type":"string","title":"Correlation Id","description":"Request trace id (X-Correlation-ID); also on the response header","default":""}},"type":"object","title":"SendEmailResponse"},"UserEmailRequest":{"properties":{"tos":{"items":{"type":"string","format":"email"},"type":"array","minItems":1,"title":"Tos","description":"Recipient email addresses"},"subject":{"type":"string","maxLength":998,"minLength":1,"title":"Subject","description":"Subject of the email"},"content_type":{"$ref":"#/components/schemas/ContentType","description":"text/plain or text/html","default":"text/plain"},"text_message":{"type":"string","minLength":1,"title":"Text Message","description":"Body; treated as HTML when content_type is text/html"},"email_type":{"$ref":"#/components/schemas/EmailType","description":"personal (from the user, replies to the user) or notification (from Amāia, no reply-to)","default":"personal"}},"type":"object","required":["tos","subject","text_message"],"title":"UserEmailRequest","description":"What a signed-in user may supply. Sender identity comes from their profile."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}