{"openapi":"3.1.0","info":{"title":"AgentEmail standalone mailbox API","version":"3.0.0","description":"Read-only access to an owned standalone mailbox. No sending or billing operations."},"servers":[{"url":"https://agentemail.cc/v3"}],"security":[{"MailboxKey":[]}],"paths":{"/messages":{"get":{"operationId":"listMessages","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Message metadata and nextCursor","content":{"application/json":{"schema":{"type":"object","required":["messages","nextCursor"],"properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/MessageMetadata"}},"nextCursor":{"type":["string","null"]}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Key unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Browser transport rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Route or message unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{messageId}":{"get":{"operationId":"readMessage","parameters":[{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Parsed plain-text message preview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePreview"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Key unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Browser transport rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Route or message unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages/{messageId}/raw":{"get":{"operationId":"downloadMessage","parameters":[{"name":"messageId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Original RFC822 email","content":{"message/rfc822":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Key unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Browser transport rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Route or message unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"MailboxKey":{"type":"http","scheme":"bearer","description":"Mailbox-scoped messages:read key generated in the dashboard."}},"schemas":{"MessageMetadata":{"type":"object","required":["message_id","recipient","envelope_from","raw_size","state","received_at"],"properties":{"message_id":{"type":"string","format":"uuid"},"recipient":{"type":"string"},"envelope_from":{"type":"string"},"raw_size":{"type":"integer","minimum":0,"maximum":1048576},"state":{"type":"string"},"received_at":{"type":"integer","minimum":0}}},"MessagePreview":{"allOf":[{"$ref":"#/components/schemas/MessageMetadata"},{"type":"object","required":["subject","text","preview_available","text_truncated","html_omitted","attachment_bytes_omitted"],"properties":{"subject":{"type":["string","null"],"maxLength":1024},"text":{"type":["string","null"]},"preview_available":{"type":"boolean"},"text_truncated":{"type":"boolean"},"html_omitted":{"const":true},"attachment_bytes_omitted":{"const":true}}}]},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}