cloadyDocs
API ReferenceEndpointsWorkspaces

List mail migrations

Every migration of mail into the workspace's mailboxes, newest first, with each mailbox's progress. Needs the admin role.

GET
/api/workspaces/{workspaceSlug}/mail/migrations
AuthorizationBearer <token>

Personal API token (cldy_…)

In: header

Path Parameters

workspaceSlug*string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/workspaces/string/mail/migrations"
{  "migrations": [    {      "id": "string",      "domain": "string",      "provider": "google",      "status": "pending",      "source": {        "host": "string",        "account": "string"      },      "authorize": {        "url": "string",        "clientId": "string",        "scopes": [          "string"        ]      },      "mailboxes": [        {          "from": "string",          "to": "string",          "status": "pending",          "messages": -9007199254740991,          "copied": -9007199254740991,          "error": "string"        }      ],      "error": "string",      "createdAt": "string",      "startedAt": "string",      "finishedAt": "string"    }  ]}

Follow changes to mailboxes GET

Returns one JMAP StateChange with the current state of every mailbox the caller may read: every mailbox for admins, the ones assigned to them for other members. Sending `Accept: text/event-stream` instead follows them live, sending a StateChange whenever new mail arrives or a message or folder changes, which never completes on its own: then fetch the changes with runEmailJmap's /changes methods. An API token needs the `account` capability.

Move mail in from another provider POST

Copies mailboxes with their folders, read state and flags into the workspace's mailboxes on a domain with email on, and contacts too from Microsoft 365, creating mailboxes that don't exist yet without a password (reset one in updateMailbox). Google Workspace needs a super administrator to allow Cloady's client ID with domain-wide delegation, Microsoft 365 a global administrator's consent: `authorize` says how, and copying starts once it's done (runEmailMigration starts it at once). Only mailboxes the provider lists on the domain are copied, from a Google customer or Microsoft 365 tenant that owns the domain; a listed mailbox it doesn't list ends `canceled`. Google Workspace and Microsoft 365 answer 503 `provider_unavailable` while Cloady isn't set up for them. Migrations need a card on the workspace owner's account (402 `payment_required`), create missing mailboxes at 2 GB within the mailbox and storage limits (409 `mailbox_limit`, `storage_limit`, `storage_full`), copy one mailbox at a time per workspace, and refuse IMAP servers that resolve into a private network or the cluster (400 `bad_host`). Zoho and other IMAP servers copy mail with each mailbox's password, which is kept encrypted until the migration is canceled or 14 days after its last copy. Switch the domain's MX when the copy is done, then run the migration again to copy what arrived meanwhile. Needs the admin role.