{"openapi":"3.1.0","info":{"title":"Mail API","version":"1.0.0","description":"Read, search, send and organize email. Docs: https://email.appwrite.network/developers"},"servers":[{"url":"https://email-api.appwrite.network"}],"components":{"securitySchemes":{"oauth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://fra.cloud.appwrite.io/v1/oauth2/6ae21f6271db427f12bc/authorize","tokenUrl":"https://fra.cloud.appwrite.io/v1/oauth2/6ae21f6271db427f12bc/token","refreshUrl":"https://fra.cloud.appwrite.io/v1/oauth2/6ae21f6271db427f12bc/token","scopes":{"mail.read":"Read your messages, threads, labels and mailbox details","mail.send":"Send email and replies from your address","mail.modify":"Mark, star, label, archive, move and delete messages"}}}},"apiKey":{"type":"http","scheme":"bearer","description":"Personal API key (mk_…) from Settings."}},"schemas":{"Summary":{"type":"object","properties":{"id":{"type":"string"},"threadId":{"type":"string"},"folder":{"type":"string"},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"snippet":{"type":"string"},"date":{"type":"string","format":"date-time"},"read":{"type":"boolean"},"starred":{"type":"boolean"},"labels":{"type":"array","items":{"type":"string"}},"hasAttachments":{"type":"boolean"}}},"Message":{"allOf":[{"$ref":"#/components/schemas/Summary"},{"type":"object","properties":{"text":{"type":"string"},"html":{"type":"string"},"attachments":{"type":"array","items":{"type":"object"}}}}]},"Changes":{"type":"object","properties":{"read":{"type":"boolean"},"starred":{"type":"boolean"},"folder":{"type":"string","enum":["inbox","archive","spam","trash"]},"addLabels":{"type":"array","items":{"type":"string"}},"removeLabels":{"type":"array","items":{"type":"string"}}}}}},"paths":{"/v1/me":{"get":{"summary":"Your mailbox","security":[{"oauth2":["mail.read"]},{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/messages":{"get":{"summary":"List or search messages","security":[{"oauth2":["mail.read"]},{"apiKey":[]}],"parameters":[{"name":"folder","in":"query","schema":{"type":"string"},"description":"inbox | starred | snoozed | sent | scheduled | archive | spam | trash | all"},{"name":"q","in":"query","schema":{"type":"string"},"description":"Full-text search"},{"name":"unread","in":"query","schema":{"type":"boolean"},"description":"Only unread"},{"name":"starred","in":"query","schema":{"type":"boolean"},"description":"Only starred"},{"name":"label","in":"query","schema":{"type":"string"},"description":"Label ID"},{"name":"limit","in":"query","schema":{"type":"integer"},"description":"1–100, default 20"},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"nextCursor from the previous page"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Summary"}},"nextCursor":{"type":["string","null"]}}}}}}}},"post":{"summary":"Send a message or reply","security":[{"oauth2":["mail.send"]},{"apiKey":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"array","items":{"type":"string"}},"cc":{"type":"array","items":{"type":"string"}},"bcc":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"text":{"type":"string"},"html":{"type":"string"},"replyTo":{"type":"string","description":"Message ID to reply to"},"replyAll":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"patch":{"summary":"Update many messages","security":[{"oauth2":["mail.modify"]},{"apiKey":[]}],"requestBody":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Changes"},{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}}}}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/messages/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Read a message","security":[{"oauth2":["mail.read"]},{"apiKey":[]}],"parameters":[{"name":"html","in":"query","schema":{"type":"boolean"},"description":"Include HTML body"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}}}},"patch":{"summary":"Update a message","security":[{"oauth2":["mail.modify"]},{"apiKey":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Changes"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Summary"}}}}}},"delete":{"summary":"Move a message to Trash","security":[{"oauth2":["mail.modify"]},{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Summary"}}}}}}},"/v1/threads/{id}":{"get":{"summary":"Read a conversation","security":[{"oauth2":["mail.read"]},{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/labels":{"get":{"summary":"List labels","security":[{"oauth2":["mail.read"]},{"apiKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}}}}