{"openapi":"3.0.3","info":{"title":"Mailagent REST","version":"0.1.0"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{}},"paths":{"/health":{"get":{"security":[],"responses":{"200":{"description":"Default Response"}}}},"/ready":{"get":{"security":[],"responses":{"200":{"description":"Default Response"}}}},"/v1/inboxes":{"post":{"summary":"Create an inbox on MAIL_DOMAIN","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9._-]{0,62}[a-z0-9])?$"}},"required":["name"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List authorized inboxes","responses":{"200":{"description":"Default Response"}}}},"/v1/inboxes/{id}":{"get":{"summary":"Get inbox","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Disable inbox, reserve address permanently","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/messages":{"get":{"summary":"List messages with cursor pagination","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"query","name":"inboxId","required":false},{"schema":{"type":"string","format":"email","maxLength":254},"in":"query","name":"sender","required":false},{"schema":{"type":"string","maxLength":200},"in":"query","name":"subject","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"since","required":false},{"schema":{"type":"string","maxLength":1000},"in":"query","name":"cursor","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Queue outbound email","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"inboxId":{"type":"string","format":"uuid"},"to":{"type":"array","items":{"type":"string","format":"email","maxLength":254},"minItems":1,"maxItems":50},"cc":{"type":"array","items":{"type":"string","format":"email","maxLength":254},"maxItems":50,"default":[]},"bcc":{"type":"array","items":{"type":"string","format":"email","maxLength":254},"maxItems":50,"default":[]},"subject":{"type":"string","maxLength":998},"text":{"type":"string","maxLength":1048576},"html":{"type":"string","maxLength":1048576},"attachments":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n/\\\\\\x00]+$"},"contentType":{"type":"string","maxLength":100,"pattern":"^[a-z0-9.+-]+\\/[a-z0-9.+-]+$"},"contentBase64":{"type":"string","maxLength":7340032,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"}},"required":["filename","contentType","contentBase64"],"additionalProperties":false},"maxItems":20,"default":[]}},"required":["inboxId","to","subject"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/messages/{id}":{"get":{"summary":"Get structured message","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/messages/{id}/text":{"get":{"summary":"Get text","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/messages/{id}/html":{"get":{"summary":"Get html","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/messages/{id}/mime":{"get":{"summary":"Get mime","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/messages/{id}/attachments/{attachmentId}":{"get":{"summary":"Stream authorized attachment","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true},{"schema":{"type":"string","format":"uuid"},"in":"path","name":"attachmentId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/messages/{id}/reply":{"post":{"summary":"Queue threaded reply","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"inboxId":{"type":"string","format":"uuid"},"to":{"type":"array","items":{"type":"string","format":"email","maxLength":254},"minItems":1,"maxItems":50},"cc":{"type":"array","items":{"type":"string","format":"email","maxLength":254},"maxItems":50,"default":[]},"bcc":{"type":"array","items":{"type":"string","format":"email","maxLength":254},"maxItems":50,"default":[]},"subject":{"type":"string","maxLength":998},"text":{"type":"string","maxLength":1048576},"html":{"type":"string","maxLength":1048576},"attachments":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string","maxLength":200,"pattern":"^[^\\r\\n/\\\\\\x00]+$"},"contentType":{"type":"string","maxLength":100,"pattern":"^[a-z0-9.+-]+\\/[a-z0-9.+-]+$"},"contentBase64":{"type":"string","maxLength":7340032,"pattern":"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"}},"required":["filename","contentType","contentBase64"],"additionalProperties":false},"maxItems":20,"default":[]}},"required":["inboxId","subject"],"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true},{"schema":{"type":"string","minLength":1,"maxLength":128},"in":"header","name":"idempotency-key","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/messages/wait":{"post":{"summary":"Wait for an existing or new message","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"inboxId":{"type":"string","format":"uuid"},"sender":{"type":"string","format":"email","maxLength":254},"subject":{"type":"string","maxLength":200},"since":{"type":"string","format":"date-time"},"timeoutMs":{"type":"integer","minimum":0,"maximum":60000,"default":30000}},"required":["inboxId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response"}}}},"/v1/webhooks":{"post":{"summary":"Create webhook; signing secret shown once","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":2048},"inboxId":{"type":"string","format":"uuid"}},"required":["url"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List webhooks","responses":{"200":{"description":"Default Response"}}}},"/v1/webhooks/{id}":{"delete":{"summary":"Disable webhook","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/keys":{"post":{"summary":"Issue a restricted tenant key","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"type":"array","items":{"type":"string","enum":["read","send","manage","keys"]},"minItems":1},"inboxIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100}},"required":["name","scopes"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response"}}},"get":{"summary":"List keys without secrets","responses":{"200":{"description":"Default Response"}}}},"/v1/keys/{id}":{"delete":{"summary":"Revoke tenant key","parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/jobs":{"get":{"summary":"List recent asynchronous job states and errors","responses":{"200":{"description":"Default Response"}}}}},"security":[{"bearerAuth":[]}]}