پرش به مستندات
API

درون‌ریزی‌ها

هر عملیات در این گروه: آنچه می‌پذیرد، آنچه برمی‌گرداند و خطاهایی که ممکن است با آن‌ها پاسخ دهد.

عملیات‌ها

Two ways to bring an existing setup across.

A mailbox import reads an export file: Google Takeout archives, .mbox, .eml, .zip and .tgz. Create the import, upload each file in parts, then start it. Imported mail is quiet, so no rules, forwards, notifications, summaries or webhooks run for it.

A provider import reads a Resend account with a full-access key: suppressions, segments as audiences, subscribed contacts, templates, and webhooks created switched off, plus a checklist of the domains and API keys to recreate by hand. Inspect it first to see what would come across. The key is held encrypted only while the import runs and is erased when it ends, and running it twice duplicates nothing.

GET/imports

List mailbox imports

محدوده‌های دسترسیthreads:readمی‌خواند

Every import in the workspace, newest first, one page at a time, each with its status, byte progress and running counts. Nothing is dropped from the history, so following nextCursor reaches the first import. A key limited to particular addresses sees only imports into those addresses.

Requires the threads:read scope.

پارامترهای کوئری

addressIdstring

Only imports into this address.

limitinteger

Rows per page, 1 to 100.

دست‌کم 1حداکثر 100پیش‌فرض25
cursorstring

An import id. Keyset, not offset: pass the previous page's nextCursor. One that names nothing in this list is a 400 invalid_cursor.

خروجی

200

A page of imports, newest first, with hasMore and nextCursor.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
imports.list()imports.listAll()imports.iterate()
CLI
openemail imports list
MCP
listImports

POST/imports

Start a mailbox import

محدوده‌های دسترسیthreads:writeداده‌ها را تغییر می‌دهد

Creates an import into one address and returns it with status: uploading. Upload each file in parts of chunkBytes with the chunk operation, then call start. The import reads Google Takeout archives, .mbox, .eml, .zip and .tgz files. Imported mail is quiet: no rules, forwards, notifications, summaries or webhooks run for it.

Requires the threads:write scope.

بدنهٔ درخواست

addressIdstringالزامی

The address the mail belongs to.

filesobject[]الزامی

Each file as { name, bytes }, 1 to 50 of them, each at most 100 GB.

1 تا 50 مورد
namestringالزامی
تا 255 نویسه
bytesintegerالزامی
دست‌کم 1حداکثر 107374182400
optionsobject

keepInbox, includeSpam and includeTrash, as for create.

keepInboxboolean

Default true. Mail that was in the old inbox lands in Inbox with its unread state; false files everything under Archive.

includeSpamboolean

Default false.

includeTrashboolean

Default false.

خروجی

201

The import, waiting for its files.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
imports.create()imports.importFiles()
CLI
openemail imports createopenemail imports import-files

GET/imports/{id}

Get a mailbox import

محدوده‌های دسترسیthreads:readمی‌خواند

Status, byte progress and counts. Poll it while the import runs.

Requires the threads:read scope.

پارامترهای مسیر

idstringالزامی

Import id, imp_ followed by 24 hex characters.

خروجی

200

The import.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
imports.get()
CLI
openemail imports get
MCP
getImport

GET/imports/{id}/upload

Which parts have arrived

محدوده‌های دسترسیthreads:writeمی‌خواند

For each file, the indexes of the parts already stored, so an interrupted upload sends only what is missing.

Requires the threads:write scope.

پارامترهای مسیر

idstringالزامی

Import id, imp_ followed by 24 hex characters.

خروجی

200

Received parts per file.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
imports.uploadState()
CLI
openemail imports upload-state

DELETE/imports/{id}/upload

Delete the uploaded files

محدوده‌های دسترسیthreads:writeحذف می‌کند

Removes the uploaded archive. Mail already imported stays in the mailbox. Refused with 409 while the import is queued or running.

Requires the threads:write scope.

پارامترهای مسیر

idstringالزامی

Import id, imp_ followed by 24 hex characters.

خروجی

200

The import, with uploadDeleted: true.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
imports.deleteUpload()
CLI
openemail imports delete-upload

PUT/imports/{id}/files/{file}/chunks/{chunk}

Upload one part of a file

محدوده‌های دسترسیthreads:writeداده‌ها را تغییر می‌دهد

Stores bytes chunk * chunkBytes up to the next part of file file. Every part is exactly chunkBytes long except the last. Sending a part again replaces it, so a failed part can simply be retried.

Requires the threads:write scope.

پارامترهای مسیر

idstringالزامی

Import id, imp_ followed by 24 hex characters.

fileintegerالزامی

The file index, in the order given to create.

دست‌کم 0
chunkintegerالزامی

The part index, from 0.

دست‌کم 0

بدنهٔ درخواست

نوع محتواapplication/octet-stream

binary

خروجی

200

The part was stored.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
imports.uploadChunk()
CLI
openemail imports upload-chunk

POST/imports/{id}/start

Start reading the uploaded files

محدوده‌های دسترسیthreads:writeداده‌ها را تغییر می‌دهد

Checks that every part of every file has arrived and queues the import. 412 missing_chunks names the files still incomplete.

Requires the threads:write scope.

پارامترهای مسیر

idstringالزامی

Import id, imp_ followed by 24 hex characters.

خروجی

200

The import, queued.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
imports.start()
CLI
openemail imports start

POST/imports/{id}/cancel

Cancel a mailbox import

محدوده‌های دسترسیthreads:writeحذف می‌کند

Stops the import at its next checkpoint. Mail already imported stays.

Requires the threads:write scope.

پارامترهای مسیر

idstringالزامی

Import id, imp_ followed by 24 hex characters.

خروجی

200

The import, cancelled.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
imports.cancel()
CLI
openemail imports cancel
MCP
cancelImport

GET/imports/{id}/failures

What an import could not bring across

محدوده‌های دسترسیthreads:readمی‌خواند

Each message or archive entry that did not come across, with the reason. Page with after, the nextCursor of the previous page.

Requires the threads:read scope.

پارامترهای مسیر

idstringالزامی

Import id, imp_ followed by 24 hex characters.

پارامترهای کوئری

afterinteger

The nextCursor of the previous page.

limitinteger

At most 100, the default.

دست‌کم 1حداکثر 100

خروجی

200

Failures.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
imports.listFailures()
CLI
openemail imports list-failures
MCP
listImportFailures

POST/provider-imports/inspect

Look inside a Resend account before importing

محدوده‌های دسترسیsettings:writeمی‌خواند

Reads the first page of each resource with a full-access Resend key and returns what an import would bring. Nothing is stored and the key is not kept. A sending-only key is 400 restricted_key.

Requires the settings:write scope.

بدنهٔ درخواست

apiKeystringالزامی
8 تا 200 نویسه

خروجی

200

Counts per resource.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
providerImports.inspect()
CLI
openemail provider-imports inspect

GET/provider-imports

List imports from sending providers

محدوده‌های دسترسیsettings:readمی‌خواند

Every provider import in the workspace, newest first, one page at a time, each with its report. Follow nextCursor to reach the first one.

Requires the settings:read scope.

پارامترهای کوئری

limitinteger

Rows per page, 1 to 100.

دست‌کم 1حداکثر 100پیش‌فرض25
cursorstring

A provider import id. Keyset, not offset: pass the previous page's nextCursor. One that names nothing in this list is a 400 invalid_cursor.

خروجی

200

A page of provider imports, newest first, with hasMore and nextCursor.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
providerImports.list()providerImports.listAll()providerImports.iterate()
CLI
openemail provider-imports list
MCP
getProviderImportlistProviderImports

POST/provider-imports

Import from Resend

محدوده‌های دسترسیsettings:writeداده‌ها را تغییر می‌دهد

Starts an import from a Resend account: suppressions, segments as audiences, subscribed contacts, templates, and webhooks created switched off, plus a checklist of domains and API keys. The key is held encrypted only while the import runs and is erased when it ends. Running it twice duplicates nothing.

Requires the settings:write scope.

بدنهٔ درخواست

apiKeystringالزامی

A full-access Resend API key.

8 تا 200 نویسه
resourcesstring[]الزامی

Any of suppressions, audiences, contacts, templates, webhooks, domains and api-keys.

دست‌کم یک موردیکی از"suppressions""audiences""contacts""templates""webhooks""domains""api-keys"

خروجی

201

The import, queued.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
providerImports.create()
CLI
openemail provider-imports create

GET/provider-imports/{id}

Get an import from a sending provider

محدوده‌های دسترسیsettings:readمی‌خواند

Status, current step and the report so far.

Requires the settings:read scope.

پارامترهای مسیر

idstringالزامی

Provider import id, pimp_ followed by 24 hex characters.

خروجی

200

The provider import.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
providerImports.get()
CLI
openemail provider-imports get
MCP
getProviderImportlistProviderImports

POST/provider-imports/{id}/cancel

Cancel an import from a sending provider

محدوده‌های دسترسیsettings:writeحذف می‌کند

Stops it and erases the key. What already came across stays.

Requires the settings:write scope.

پارامترهای مسیر

idstringالزامی

Provider import id, pimp_ followed by 24 hex characters.

خروجی

200

The provider import, cancelled.

خطاها

خطاهایی که هر عملیاتی ممکن است برگرداند400401403404422500فهرست خطاها

همچنین در دسترس در

SDK
providerImports.cancel()
CLI
openemail provider-imports cancel
MCP
cancelProviderImport