Skip to the documentation
CLI

openemail provider-imports

Every command in this namespace, with its arguments, flags and examples.

Commands

Move from Resend, SendGrid, Postmark, Mailgun or Mailchimp: suppressions, audiences, contacts, templates and webhooks come across with one key, with a checklist for domains and API keys.

Every command here also takes the global flags, such as --json, --profile and --dry-run. See the global flags

openemail provider-imports inspect

Look inside an account at another provider before importing

Scopessettings:writeNeeds a sign-in

Usage

openemail provider-imports inspect <api-key> [flags]

Reads the first page of every resource with a key from Resend, SendGrid, Postmark, Mailgun or Mailchimp and returns a count for each, with more set where a resource runs past its first page. resources lists what this key can bring across: what the provider has no such thing for, or the key may not read, is left out. Nothing is stored, and the key is not kept.

--provider picks the provider and defaults to resend. Resend needs a full-access key, SendGrid a key with read access, Postmark a Server API token, Mailgun a private API key from either region and Mailchimp an API key with its datacenter suffix. A key that can read nothing but sending is 400 restricted_key: create one with more access for the import and revoke it afterwards.

Arguments

<api-key>Required

The key from the other provider: a full-access Resend key re_…, a SendGrid key SG.…, a Postmark Server API token, a Mailgun private API key or a Mailchimp key ending in its datacenter, such as -us6. Pass - to read it from standard input, or @path to read it from a file, so it stays out of your shell history.

Flags

--provider <value>

One of resend, sendgrid, postmark, mailgun and mailchimp. Defaults to resend.

Examples

The required values only
openemail provider-imports inspect @provider-key.txt
With optional flags
openemail provider-imports inspect @provider-key.txt --provider sendgrid

Also available in

API
POST /provider-imports/inspect
TypeScript
providerImports.inspect()
Python
provider_imports.inspect()
Ruby
provider_imports.inspect
PHP
providerImports->inspect
Go
ProviderImports.Inspect
Java
providerImports().inspect
C#
ProviderImports.InspectAsync

openemail provider-imports create

Import from another provider

Scopessettings:writeNeeds a sign-inAliasesnewadd

Usage

openemail provider-imports create --provider-key <value> --resources <a,b> [flags]
openemail provider-imports create --data <json|@file|-> [flags]

Queues an import from Resend, SendGrid, Postmark, Mailgun or Mailchimp. Suppressions keep their reason, segments and lists become audiences, subscribed contacts arrive with their names, templates arrive as HTML templates with their variables declared, and webhooks are registered switched off because deliveries here are signed differently. A contact who unsubscribed at the provider is not imported and is recorded as unsubscribed, so suppressions.listUnsubscribes lists them. Domains and API keys come back as a checklist in the report, since a signing key or a token cannot leave the provider that made it. Resources the provider has no such thing for, or the key cannot read, are left out, and resources on the import says what it brings.

The key is held encrypted only while the import runs and is erased when it ends, fails or is cancelled. Running it twice duplicates nothing.

Flags

--provider-key <value>

The key from the other provider, as inspect takes it. Pass - to read it from standard input, or @path to read it from a file, so it stays out of your shell history. Required, here or in --data.

--provider <value>

One of resend, sendgrid, postmark, mailgun and mailchimp. Defaults to resend.

Default"resend"
--resources <a,b>Repeatable

Any of suppressions, audiences, contacts, templates, webhooks, domains and api-keys. Required, here or in --data.

--data <json|@file|->

The whole body as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

Examples

The required values only
openemail provider-imports create --provider-key @provider-key.txt --resources suppressions,audiences,contacts,templates,webhooks,domains,api-keys
With optional flags
openemail provider-imports create --provider-key @provider-key.txt --resources suppressions,audiences,contacts,templates,webhooks,domains,api-keys --provider mailgun
Read the whole body from a JSON file
openemail provider-imports create --data @provider-import.json

Also available in

API
POST /provider-imports
TypeScript
providerImports.create()
Python
provider_imports.create()
Ruby
provider_imports.create
PHP
providerImports->create
Go
ProviderImports.Create
Java
providerImports().create
C#
ProviderImports.CreateAsync

openemail provider-imports list

List one page of imports from sending providers

Scopessettings:readNeeds a sign-inAliasesls

Usage

openemail provider-imports list [flags]

One page of the provider imports in the workspace, newest first, each with its report.

Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.

Flags

--limit <n>

Rows per page, a whole number from 1 to 100. The server defaults to 25.

Default25
--cursor <value>

The nextCursor from the previous page. One that names no provider import in the workspace is a 400 invalid_cursor.

--all

Fetch every page and stream the items as they arrive.

--max <n>

Stop after this many items. Implies --all.

--ndjson

Print every item as one JSON object per line. Implies --all

Examples

openemail provider-imports list
Walk every page and stop after 100 items
openemail provider-imports list --all --max 100
One JSON object per line when piped
openemail provider-imports list --all > provider-imports.ndjson

Also available in

API
GET /provider-imports
TypeScript
providerImports.list()
Python
provider_imports.list()
Ruby
provider_imports.list
PHP
providerImports->list
Go
ProviderImports.List
Java
providerImports().list
C#
ProviderImports.ListAsync

openemail provider-imports get

Read one import from a sending provider

Scopessettings:readNeeds a sign-inAliasesshowview

Usage

openemail provider-imports get <id> [flags]

Status, the step it is on and the report so far. Poll it while status is queued or running.

Arguments

<id>Required

Provider import id, pimp_ followed by 24 hex characters.

Examples

openemail provider-imports get pimp_3f9c2a7b1e4d8f60a5c7b92d
Print the raw JSON
openemail provider-imports get pimp_3f9c2a7b1e4d8f60a5c7b92d --json

Also available in

API
GET /provider-imports/{id}
TypeScript
providerImports.get()
Python
provider_imports.get()
Ruby
provider_imports.get
PHP
providerImports->get
Go
ProviderImports.Get
Java
providerImports().get
C#
ProviderImports.GetAsync

openemail provider-imports cancel

Cancel an import from a sending provider

Scopessettings:writeNeeds a sign-in
Asks you to confirm

Usage

openemail provider-imports cancel <id> [flags]

Stops the import and erases the provider key. What already came across stays.

Arguments

<id>Required

Provider import id, pimp_ followed by 24 hex characters.

Examples

openemail provider-imports cancel pimp_3f9c2a7b1e4d8f60a5c7b92d
Skip the confirmation, for scripts
openemail provider-imports cancel pimp_3f9c2a7b1e4d8f60a5c7b92d --yes

Also available in

API
POST /provider-imports/{id}/cancel
TypeScript
providerImports.cancel()
Python
provider_imports.cancel()
Ruby
provider_imports.cancel
PHP
providerImports->cancel
Go
ProviderImports.Cancel
Java
providerImports().cancel
C#
ProviderImports.CancelAsync