mail

POST /v1/mail/mailboxes/{mailboxId}/imports/{importId}/cancel

Cancel an import.

All mail endpoints

All developer docs →

Zinn®, our Viking, hammering at his anvil beside an API endpoint sending events to several listeners.

Authentication

Send an API key as a bearer token. The key must carry the mail.manage permission; a key without it is refused with 403, not 404.

This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.

Try it

Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.

curl -X POST https://api.zinndigital.com/v1/mail/mailboxes/{mailboxId}/imports/{importId}/cancel \
  -H "Authorization: Bearer zdk_live_…"

Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console

Details

Stops an open import the same way as finishing it (access revoked, outside password deleted); mail already copied stays. Audited. Requires mail.manage.

Parameters

NameTypeRequiredWhat it is
mailboxId (path)UuidYesMailbox ID (UUIDv7).
importId (path)UuidYesMailbox import ID (UUIDv7).

Response

NameTypeRequiredWhat it is
idstringYes—
mailbox_idstringYes—
statusstring<pending, syncing, synced, finished, failed, cancelled>Yes—
source_hoststringYes—
source_portintegerYes—
source_usernamestringYes—
messages_copiedintegerYes—
foldersMailboxImportFolder[]Yes—
folders_skippedstring[]YesFolders not copied on purpose (Trash, Spam, All Mail).
error_codestringYesWhy a failed import failed: source_login_refused, source_host_refused, source_unreachable, source_secret_missing, destination_refused, copy_failed, not_started;…
last_synced_atstringYes—
finished_atstringYes—
auto_finish_atstringYesWhen an open import finishes by itself.
created_atstringYes—

Errors this endpoint can return

401 · 403 · 404 · 409 · 503