Spatio.Api.Mail (spatio_sdk v0.0.2)
API calls for all endpoints tagged Mail.
Summary
Functions
Archive multiple messages (remove the INBOX label).
Delete multiple messages in one call.
Soft-delete by default (moves to provider trash). Set permanent: true for a hard delete.
Mark multiple messages read or unread in one call.
Create a draft.
Create a label.
Create a mail template.
Delete a draft.
Delete an email. Soft-deletes (moves to provider trash).
Delete a label.
Delete a mail template.
Fetch one email.
Download an attachment.
Streams the attachment binary. Response Content-Type matches the attachment's declared MIME type; Content-Disposition sets the filename.
Fetch a thread (the conversation a message belongs to).
Fetch a mail template.
Read mail-tracking events for a thread (open log, reply log, etc.).
Render a template with variables and return the resulting draft.
List drafts across connected mail accounts.
List labels on the resolved mail account.
Single-account list. The platform auto-resolves to the caller's sole connected account; pass ?accountId= to disambiguate when multiple are connected.
List emails across connected mail accounts.
Fan-out list. Returns messages across every connected mail provider unless filtered. Pass ?accountIds= (repeatable) to restrict to specific accounts, ?providers= to restrict to specific provider ids, or both for the intersection.
List the caller's saved mail templates.
Reply to a specific email.
The original message is identified by ?messageId=. Body defaults to the original sender as recipient — pass to, cc, bcc to override.
Save-or-create endpoint used by the renderer's "save as template" flow. Distinct from POST /v1/mail/templates which is the strict create.
Structured search across connected mail accounts.
Fan-out search. Mirrors listEmails's account/provider filter semantics. Date range filters are inclusive. The query string itself is passed via ?q= (not ?query=); structured filters go in their own params.
Send a draft.
Submits the draft as an outbound message. The draft is consumed by the provider — subsequent getDraft/updateDraft calls return 404.
Send an email.
Sends through the resolved connected account (auto-picks if the caller has exactly one connected mail account; errors ambiguous_account otherwise unless accountId is supplied).
Update a draft (full replacement of provided fields). PUT replaces the full set of provided fields on the draft. Fields omitted from the body are not modified.
Update an email (mark read/star, add/remove labels).
Update a mail template.
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):message_id(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):message_id(String.t):attachment_id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Workspace-scoped renderer-compat alias for mail/email/{id}.
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):message_id(String.t):label_id(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters:q(String.t):
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Renderer-compat alias for /mail/send.
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
Functions
@spec bulk_archive_emails( Tesla.Env.client(), Spatio.Model.BulkArchiveRequest.t(), keyword() ) :: {:ok, Spatio.Model.BulkArchiveResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Archive multiple messages (remove the INBOX label).
Parameters
connection(Spatio.Connection): Connection to serverbulk_archive_request(BulkArchiveRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.BulkArchiveResponse.t}on success{:error, Tesla.Env.t}on failure
@spec bulk_delete_emails( Tesla.Env.client(), Spatio.Model.BulkDeleteEmailsRequest.t(), keyword() ) :: {:ok, Spatio.Model.BulkDeleteEmailsResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Delete multiple messages in one call.
Soft-delete by default (moves to provider trash). Set permanent: true for a hard delete.
Parameters
connection(Spatio.Connection): Connection to serverbulk_delete_emails_request(BulkDeleteEmailsRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.BulkDeleteEmailsResponse.t}on success{:error, Tesla.Env.t}on failure
@spec bulk_mark_emails_read( Tesla.Env.client(), Spatio.Model.BulkMarkReadRequest.t(), keyword() ) :: {:ok, Spatio.Model.BulkMarkReadResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Mark multiple messages read or unread in one call.
Parameters
connection(Spatio.Connection): Connection to serverbulk_mark_read_request(BulkMarkReadRequest):opts(keyword): Optional parameters
Returns
{:ok, Spatio.Model.BulkMarkReadResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_draft(Tesla.Env.client(), Spatio.Model.CreateDraftRequest.t(), keyword()) :: {:ok, Spatio.Model.DraftResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.CreateNote400Response.t()} | {:error, Tesla.Env.t()}
Create a draft.
Parameters
connection(Spatio.Connection): Connection to servercreate_draft_request(CreateDraftRequest):opts(keyword): Optional parameters:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.DraftResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_email_label( Tesla.Env.client(), Spatio.Model.CreateLabelRequest.t(), keyword() ) :: {:ok, Spatio.Model.CreateLabelResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.CreateNote400Response.t()} | {:error, Tesla.Env.t()}
Create a label.
Parameters
connection(Spatio.Connection): Connection to servercreate_label_request(CreateLabelRequest):opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.CreateLabelResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_mail_template( Tesla.Env.client(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Create a mail template.
Parameters
connection(Spatio.Connection): Connection to serverrequest_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec delete_draft(Tesla.Env.client(), String.t(), keyword()) :: {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Delete a draft.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Draft id.opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec delete_email(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.SuccessFlag.t()} | {:error, Tesla.Env.t()}
Delete an email. Soft-deletes (moves to provider trash).
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Email message id.opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.SuccessFlag.t}on success{:error, Tesla.Env.t}on failure
@spec delete_email_label(Tesla.Env.client(), String.t(), keyword()) :: {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Delete a label.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Label id.opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec delete_mail_template(Tesla.Env.client(), String.t(), keyword()) :: {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Delete a mail template.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec get_email(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.GetEmailResponse.t()} | {:ok, Spatio.Model.CreateNote400Response.t()} | {:error, Tesla.Env.t()}
Fetch one email.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Email message id.opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.GetEmailResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_email_attachment(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.CreateNote400Response.t()} | {:ok, String.t()} | {:error, Tesla.Env.t()}
Download an attachment.
Streams the attachment binary. Response Content-Type matches the attachment's declared MIME type; Content-Disposition sets the filename.
Parameters
connection(Spatio.Connection): Connection to servermessage_id(String.t): Message id the attachment belongs to.attachment_id(String.t): Attachment id within the message.opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, String.t}on success{:error, Tesla.Env.t}on failure
@spec get_email_thread(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.GetThreadResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.CreateNote400Response.t()} | {:error, Tesla.Env.t()}
Fetch a thread (the conversation a message belongs to).
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Thread id.opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.GetThreadResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_mail_template(Tesla.Env.client(), String.t(), keyword()) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Fetch a mail template.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec get_mail_thread_tracking(Tesla.Env.client(), String.t(), keyword()) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Read mail-tracking events for a thread (open log, reply log, etc.).
Parameters
connection(Spatio.Connection): Connection to serverthread_id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec instantiate_mail_template( Tesla.Env.client(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Render a template with variables and return the resulting draft.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec list_drafts( Tesla.Env.client(), keyword() ) :: {:ok, Spatio.Model.ListDraftsResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
List drafts across connected mail accounts.
Parameters
connection(Spatio.Connection): Connection to serveropts(keyword): Optional parameters:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.:accountIds([String.t]): Repeatable. Restrict to these connected-account row ids. Mutually orthogonal toproviders— when both are set the intersection is used.:providers([String.t]): Repeatable. Restrict to these provider ids (gmail,outlook).:limit(integer())::nextPageToken(String.t):
Returns
{:ok, Spatio.Model.ListDraftsResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_email_labels( Tesla.Env.client(), keyword() ) :: {:ok, Spatio.Model.ListLabelsResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.CreateNote400Response.t()} | {:error, Tesla.Env.t()}
List labels on the resolved mail account.
Single-account list. The platform auto-resolves to the caller's sole connected account; pass ?accountId= to disambiguate when multiple are connected.
Parameters
connection(Spatio.Connection): Connection to serveropts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.ListLabelsResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_emails( Tesla.Env.client(), keyword() ) :: {:ok, Spatio.Model.ListEmailsResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
List emails across connected mail accounts.
Fan-out list. Returns messages across every connected mail provider unless filtered. Pass ?accountIds= (repeatable) to restrict to specific accounts, ?providers= to restrict to specific provider ids, or both for the intersection.
Parameters
connection(Spatio.Connection): Connection to serveropts(keyword): Optional parameters:accountIds([String.t]): Repeatable. Restrict to these connected-account row ids. Mutually orthogonal toproviders— when both are set the intersection is used.:providers([String.t]): Repeatable. Restrict to these provider ids (gmail,outlook).:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.:query(String.t): Provider-specific full-text query (e.g. Gmail search syntax).:labels([String.t]): Repeatable. Filter to messages carrying every label.:folder(String.t): Logical folder filter. Canonical values:inbox,sent,starred,trash,archive. Provider-specific folders accepted as opaque strings.:limit(integer())::offset(integer()):
Returns
{:ok, Spatio.Model.ListEmailsResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_mail_templates( Tesla.Env.client(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
List the caller's saved mail templates.
Parameters
connection(Spatio.Connection): Connection to serveropts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec reply_email( Tesla.Env.client(), String.t(), Spatio.Model.ReplyEmailRequest.t(), keyword() ) :: {:ok, Spatio.Model.SendEmailResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.CreateNote400Response.t()} | {:error, Tesla.Env.t()}
Reply to a specific email.
The original message is identified by ?messageId=. Body defaults to the original sender as recipient — pass to, cc, bcc to override.
Parameters
connection(Spatio.Connection): Connection to servermessage_id(String.t): Id of the message being replied to.reply_email_request(ReplyEmailRequest):opts(keyword): Optional parameters:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.SendEmailResponse.t}on success{:error, Tesla.Env.t}on failure
@spec save_mail_template( Tesla.Env.client(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Save-or-create endpoint used by the renderer's "save as template" flow. Distinct from POST /v1/mail/templates which is the strict create.
Parameters
connection(Spatio.Connection): Connection to serverrequest_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec search_emails(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.SearchEmailsResponse.t()} | {:error, Tesla.Env.t()}
Structured search across connected mail accounts.
Fan-out search. Mirrors listEmails's account/provider filter semantics. Date range filters are inclusive. The query string itself is passed via ?q= (not ?query=); structured filters go in their own params.
Parameters
connection(Spatio.Connection): Connection to serverq(String.t): Provider-specific full-text query string.opts(keyword): Optional parameters:accountIds([String.t]): Repeatable. Restrict to these connected-account row ids. Mutually orthogonal toproviders— when both are set the intersection is used.:providers([String.t]): Repeatable. Restrict to these provider ids (gmail,outlook).:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.:from(String.t)::to(String.t)::subject(String.t)::hasAttachment(boolean())::isUnread(boolean())::isStarred(boolean())::labels([String.t])::after(DateTime.t): Inclusive lower-bound date.:before(DateTime.t): Inclusive upper-bound date.:limit(integer())::nextPageToken(String.t): Cursor returned by the previous call.
Returns
{:ok, Spatio.Model.SearchEmailsResponse.t}on success{:error, Tesla.Env.t}on failure
@spec send_draft(Tesla.Env.client(), String.t(), keyword()) :: {:ok, Spatio.Model.SendEmailResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Send a draft.
Submits the draft as an outbound message. The draft is consumed by the provider — subsequent getDraft/updateDraft calls return 404.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Draft id.opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.SendEmailResponse.t}on success{:error, Tesla.Env.t}on failure
@spec send_email(Tesla.Env.client(), Spatio.Model.SendEmailRequest.t(), keyword()) :: {:ok, Spatio.Model.SendEmailResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:ok, Spatio.Model.CreateNote400Response.t()} | {:error, Tesla.Env.t()}
Send an email.
Sends through the resolved connected account (auto-picks if the caller has exactly one connected mail account; errors ambiguous_account otherwise unless accountId is supplied).
Parameters
connection(Spatio.Connection): Connection to serversend_email_request(SendEmailRequest):opts(keyword): Optional parameters:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.SendEmailResponse.t}on success{:error, Tesla.Env.t}on failure
@spec update_draft( Tesla.Env.client(), String.t(), Spatio.Model.UpdateDraftRequest.t(), keyword() ) :: {:ok, Spatio.Model.DraftResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Update a draft (full replacement of provided fields). PUT replaces the full set of provided fields on the draft. Fields omitted from the body are not modified.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Draft id.update_draft_request(UpdateDraftRequest):opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.DraftResponse.t}on success{:error, Tesla.Env.t}on failure
@spec update_email( Tesla.Env.client(), String.t(), Spatio.Model.UpdateEmailRequest.t(), keyword() ) :: {:ok, Spatio.Model.UpdateEmailResponse.t()} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Update an email (mark read/star, add/remove labels).
Parameters
connection(Spatio.Connection): Connection to serverid(String.t): Email message id.update_email_request(UpdateEmailRequest):opts(keyword): Optional parameters:accountId(String.t): Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive withprovider. If omitted on a list endpoint the call fans out across every connected account.:"X-Workspace-ID"(String.t): Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.
Returns
{:ok, Spatio.Model.UpdateEmailResponse.t}on success{:error, Tesla.Env.t}on failure
@spec update_mail_template( Tesla.Env.client(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Update a mail template.
Parameters
connection(Spatio.Connection): Connection to serverid(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_add_mail_message_labels( Tesla.Env.client(), String.t(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):message_id(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_create_mail_draft( Tesla.Env.client(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_create_mail_label( Tesla.Env.client(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_delete_mail( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec workspace_delete_mail_draft( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec workspace_delete_mail_label( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec workspace_get_mail( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_get_mail_attachment( Tesla.Env.client(), String.t(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):message_id(String.t):attachment_id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_get_mail_by_id( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Workspace-scoped renderer-compat alias for mail/email/{id}.
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_get_mail_draft( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_get_mail_thread( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_list_mail(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_list_mail_drafts( Tesla.Env.client(), String.t(), String.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_list_mail_labels( Tesla.Env.client(), String.t(), String.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_patch_mail( Tesla.Env.client(), String.t(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_remove_mail_message_label( Tesla.Env.client(), String.t(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):message_id(String.t):label_id(String.t):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec workspace_reply_mail( Tesla.Env.client(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_search_mail(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):opts(keyword): Optional parameters:q(String.t):
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_send_mail( Tesla.Env.client(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_send_mail_draft( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_send_mail_email_alias( Tesla.Env.client(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Renderer-compat alias for /mail/send.
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_update_mail( Tesla.Env.client(), String.t(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_update_mail_draft( Tesla.Env.client(), String.t(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec workspace_update_mail_label( Tesla.Env.client(), String.t(), String.t(), String.t(), %{optional(String.t()) => any()}, keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}
Parameters
connection(Spatio.Connection): Connection to serverorg(String.t):workspace(String.t):id(String.t):request_body(%{optional(String.t) => any()}):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure