Emails
Your own mailboxes, hosting and sending limits.
Emails has fourteen public methods. They cover the reading side of the page: which mailboxes you have, the mail in them, its read and archived state, fetching new mail, and the AI's notes on a day and on a draft. Thirteen of them act for the account whose API key you use. The fourteenth, test_email, needs an admin key.
Sending a mail, adding a mailbox, choosing a plan, Email settings and forwarding addresses are done in the dashboard. They have no public method today.
Send a request to a method with your key:
A good answer has code 1. data holds docs, the mails; bookmark, to pass back for the next page; and total_emails.
Read the mail
get_user_mailboxesgives the mail counts of each mailbox.get_user_emailslists mail.mailbox_nameisinboxorsent, or any other folder path to match exactly.email_account_idlimits it to one mailbox,searchlooks in the subject and the other party's name or address,readset tofalsegives only unread mail, andfilter_typeset toarchivedlists the archived mail that is otherwise left out.date_fromanddate_to(epoch milliseconds) bound the dates,contact_emailgives the mail exchanged with one address, andemail_idgives one message. Page withlimit,skipandbookmark.get_email_overviewcounts received mail per day, 14 days by default and up to 31, and the unread mail per mailbox. It is what draws the band's dots.get_email_briefanswers the one sentence the AI writes from the summaries of today's mail. It is kept for the day and written again only when today's mail changes. Passlocaleandtz_offsetto have it in the reader's language and day.
Tidy it
read_emailandunread_emailmark a mail, and its conversation item, read or unread byemail_id.read_emailleaves the mailbox's own seen flag and the mail's time alone.archive_emailarchives a mail.unarchive_emailputs an archived one back at the state it had.
Keep it current
refresh_mailboxesfetches new mail now, for every mailbox, or for one when you passemail_account_id. It is the same as the Refresh button.pause_mailbox_importpauses a mailbox's import at once, as the import's Cancel does. Nothing more is read or filed for it until you continue syncing withrefresh_mailboxes.process_pending_emailhas the AI read one mail again. Passreset_errorto clear the error it stored first, as Try again does.
Ask for the AI's notes on a draft
get_email_read_along reads a draft beside the person writing it and writes nothing. It says what the mail being answered asks and whether the draft answers it, a file the draft mentions that is not attached, and a time it names that the calendar cannot make. Pass the draft as plain text in draft, the mail being answered in email_id, the names of attached files in attached, and tz_offset, time_zone and locale of the writer. It is what Read along uses.
Disconnect a mailbox
delete_email_account disconnects a mailbox by email_account_id. It is the same as Disconnect in the mailbox's window. The mailbox is marked deleted, and mail already brought in stays in the workspace.
Disconnecting a Xuda mailbox deletes it with all its mail on the mail server, and this cannot be undone. Disconnecting a Gmail or Outlook keeps the messages here and takes Xuda's access back. For an Outlook, Xuda deletes its own tokens; Xuda stays on the Microsoft account's list of apps until the person removes it there.