Imports
Old mail coming in, and moves from another provider.
Imports tools
| Tool | What it does |
|---|---|
| listImports | The imports of old mail into the workspace, newest first, with their status and progress. addressId keeps the ones into one address. |
| getImport | One import by its id: its files, how far it has read and how many messages it imported. |
| listImportFailures | The messages an import could not bring in, and why. |
| cancelImport | Stop an import that is still running. Mail it already imported stays. In the app’s chat it always asks first. |
| createImport | Start an import of old mail into one address from files, named with their sizes. The files are uploaded in parts over the REST API or with the CLI, then startImport reads them. |
| getImportUploadState | Which parts of the files of an import have arrived, so an interrupted upload sends only what is missing. |
| startImport | Start reading the uploaded files once every part has arrived. |
| deleteImportUpload | Delete the uploaded files of an import. Mail it imported stays. In the app’s chat it always asks first. |
| listProviderImports | The imports from another email provider (Resend, SendGrid, Postmark, Mailgun or Mailchimp), newest first, with their provider and status. |
| getProviderImport | One import from another provider with its report: what came across, the domains to publish here and the API keys to replace. |
| cancelProviderImport | Stop an import from another provider that is still running. What it already brought across stays. In the app’s chat it always asks first. |
| discoverMailboxSettings | Look up how to reach an old mailbox from its address: the provider, the IMAP server and whether it takes an app password, a password or a Microsoft sign-in. Nothing is connected. |
Imports of old mail need threads:read, and threads:write to cancel one. A client limited to some addresses sees only the imports into them.
Imports from another provider need settings:read, and settings:write to cancel one. Only the workspace owner reaches them.
No tool uploads mail or starts an import, because the files go up in parts and an import from another provider needs its API key. Start one on the Migrations page of the app, or with POST /imports and POST /provider-imports on the REST API.
discoverMailboxSettings needs threads:write and only looks a server up. Copying a live mailbox takes the password of the old mailbox, which never passes through a tool: the person enters it on the Migrations page, or a script sends it with POST /imports/mailbox.
Reference
listImports
The imports of old mail into this workspace, newest first, as the Migrations page of the app lists them: the address each one fills, its status, how far it has read and how many messages it imported. addressId keeps the ones into one address, source the ones from files, an IMAP mailbox or Microsoft, and status the ones the Migrations page groups as queued (uploading or queued), running, paused (parked or waiting for a password), done, failed or cancelled. search matches the address and the file names. A member sees the imports into the addresses they reach. listProviderImports lists the imports from sending providers. One page at a time: when more follow, the last line gives a cursor to pass back for the next page.
Inputs
addressIdstring- 1 to 128 characters
sourcestring- One of
"file""imap""microsoft" statusstring- One of
"queued""running""paused""done""failed""cancelled" searchstring- Up to 320 characters
limitinteger- At least 1At most 100
cursorstring
Also available in
- API
GET /importsGET /provider-imports- TypeScript
imports.list()imports.listAll()imports.iterate()providerImports.list()providerImports.listAll()providerImports.iterate()- Python
imports.list()imports.list_all()imports.iterate()provider_imports.list()provider_imports.list_all()provider_imports.iterate()- Ruby
imports.listimports.list_allimports.iterateprovider_imports.listprovider_imports.list_allprovider_imports.iterate- PHP
imports->listimports->listAllimports->iterateproviderImports->listproviderImports->listAllproviderImports->iterate- Go
Imports.ListImports.ListAllImports.IterateProviderImports.ListProviderImports.ListAllProviderImports.Iterate- Java
imports().listimports().listAllimports().iterateproviderImports().listproviderImports().listAllproviderImports().iterate- C#
Imports.ListAsyncImports.ListAllAsyncImports.IterateAsyncProviderImports.ListAsyncProviderImports.ListAllAsyncProviderImports.IterateAsync
getImport
One import of old mail by its id: its status, the files it reads, how far it has read, and how many messages it imported, found already here, left out or could not import. listImportFailures says which messages did not import and why.
Inputs
idstringRequired- 1 to 128 characters
Also available in
- API
GET /imports/{id}- TypeScript
imports.get()- Python
imports.get()- Ruby
imports.get- PHP
imports->get- Go
Imports.Get- Java
imports().get- C#
Imports.GetAsync
listImportFailures
The messages an import could not bring in, in the order it met them, with the reason for each, as What was not imported on the Migrations page shows them. When more follow, the last line gives the after value to pass back for the next page.
Inputs
idstringRequired- 1 to 128 characters
afterinteger- At least -1
limitinteger- At least 1At most 100
Also available in
cancelImport
Stop an import of old mail that is still uploading, waiting or running, as Cancel import on the Migrations page does. Mail it already imported stays in the mailbox. A chat always asks first.
Inputs
idstringRequired- 1 to 128 characters
Also available in
- API
POST /imports/{id}/cancel- TypeScript
imports.cancel()- Python
imports.cancel()- Ruby
imports.cancel- PHP
imports->cancel- Go
Imports.Cancel- Java
imports().cancel- C#
Imports.CancelAsync
createImport
Start an import of old mail into one address from files: Google Takeout archives, .mbox, .eml, .zip or .tgz. It names the files and their sizes and answers with the import, waiting for them. The files themselves are too large for a tool call: they are uploaded in parts of 8 MB with PUT /imports/{id}/files/{file}/chunks/{chunk} on the REST API, or with the CLI, and then startImport reads them. Imported mail is quiet: no rules, forwards, notifications, summaries or webhooks run for it.
Inputs
addressIdstringRequiredThe address the mail belongs to.
1 to 128 charactersfilesobject[]Required- 1 to 50 items
namestringRequired- 1 to 255 characters
bytesintegerRequired- At least 1At most 107374182400
optionsobjectkeepInboxbooleanDefault true. Mail that was in the old inbox lands in Inbox with its unread state; false files everything under Archive.
includeSpambooleanDefault false.
includeTrashbooleanDefault false.
Also available in
- API
POST /imports- TypeScript
imports.create()imports.importFiles()- Python
imports.create()imports.import_files()- Ruby
imports.createimports.import_files- PHP
imports->createimports->importFiles- Go
Imports.CreateImports.ImportFiles- Java
imports().createimports().importFiles- C#
Imports.CreateAsyncImports.ImportFilesAsync
getImportUploadState
Which parts of the files of an import have arrived, so an interrupted upload sends only what is missing. Files and parts are counted from 0.
Inputs
idstringRequired- 1 to 128 characters
Also available in
startImport
Start reading the uploaded files of an import, once every part of every file has arrived. It runs in the background; getImport follows it. A file still missing parts is refused with missing_chunks.
Inputs
idstringRequired- 1 to 128 characters
Also available in
- API
POST /imports/{id}/start- TypeScript
imports.start()- Python
imports.start()- Ruby
imports.start- PHP
imports->start- Go
Imports.Start- Java
imports().start- C#
Imports.StartAsync
deleteImportUpload
Delete the uploaded files of an import. Mail it already imported stays in the mailbox. It is refused while the import is queued or running.
Inputs
idstringRequired- 1 to 128 characters
Also available in
listProviderImports
The imports from another email provider (Resend, SendGrid, Postmark, Mailgun or Mailchimp) into this workspace, newest first: which provider, what each one brings across and its status. source keeps the ones from one provider, and status the ones the Migrations page groups as queued, running, done (completed), failed or cancelled. An import from a provider never pauses, so paused matches none. search matches the provider and what each one brings across. Only the workspace owner reaches them. getProviderImport gives the full report of one. One page at a time: when more follow, the last line gives a cursor to pass back for the next page.
Inputs
sourcestring- One of
"resend""sendgrid""postmark""mailgun""mailchimp" statusstring- One of
"queued""running""paused""done""failed""cancelled" searchstring- Up to 320 characters
limitinteger- At least 1At most 100
cursorstring
Also available in
- API
GET /importsGET /provider-importsGET /provider-imports/{id}- TypeScript
imports.list()imports.listAll()imports.iterate()providerImports.list()providerImports.listAll()providerImports.iterate()providerImports.get()- Python
imports.list()imports.list_all()imports.iterate()provider_imports.list()provider_imports.list_all()provider_imports.iterate()provider_imports.get()- Ruby
imports.listimports.list_allimports.iterateprovider_imports.listprovider_imports.list_allprovider_imports.iterateprovider_imports.get- PHP
imports->listimports->listAllimports->iterateproviderImports->listproviderImports->listAllproviderImports->iterateproviderImports->get- Go
Imports.ListImports.ListAllImports.IterateProviderImports.ListProviderImports.ListAllProviderImports.IterateProviderImports.Get- Java
imports().listimports().listAllimports().iterateproviderImports().listproviderImports().listAllproviderImports().iterateproviderImports().get- C#
Imports.ListAsyncImports.ListAllAsyncImports.IterateAsyncProviderImports.ListAsyncProviderImports.ListAllAsyncProviderImports.IterateAsyncProviderImports.GetAsync
getProviderImport
One import from another email provider by its id, with its report as the Migrations page shows it: what came across, the domains to publish here, the API keys to replace and what was not brought across. Only the workspace owner reaches it.
Inputs
idstringRequired- 1 to 128 characters
Also available in
- API
GET /provider-importsGET /provider-imports/{id}- TypeScript
providerImports.list()providerImports.listAll()providerImports.iterate()providerImports.get()- Python
provider_imports.list()provider_imports.list_all()provider_imports.iterate()provider_imports.get()- Ruby
provider_imports.listprovider_imports.list_allprovider_imports.iterateprovider_imports.get- PHP
providerImports->listproviderImports->listAllproviderImports->iterateproviderImports->get- Go
ProviderImports.ListProviderImports.ListAllProviderImports.IterateProviderImports.Get- Java
providerImports().listproviderImports().listAllproviderImports().iterateproviderImports().get- C#
ProviderImports.ListAsyncProviderImports.ListAllAsyncProviderImports.IterateAsyncProviderImports.GetAsync
cancelProviderImport
Stop an import from another email provider that is still waiting or running. What it already brought across stays. Only the workspace owner can, and a chat always asks first.
Inputs
idstringRequired- 1 to 128 characters
Also available in
discoverMailboxSettings
Look up how to reach an old mailbox at another provider, from its address alone, as the Mailbox tab of the Migrations page does before it asks for a password: which provider it is, the IMAP server, port and username to read it with, whether it takes an app password, the mailbox password or a Microsoft sign-in, and whether its contacts and calendars can come across too. Nothing is connected and no password is involved. Copying the mail itself takes the password of the old mailbox, which a tool call must never carry, so the person starts that in the app.
Inputs
emailstringRequired- 3 to 320 characters