Queues a job that imports emails from a linked mailbox into the case: chosen threads, the results of one or several searches, or everything (optionally limited to some folders). Returns the job; poll GET import-jobs/:jobId for progress. An extraction-code user may only name a mailbox linked to their own code (404 otherwise).
Body
Required
-
Additional email addresses to send email to when export completes (other than user email)
-
Values are
by_thread,by_search,import_all, orby_multi_query. Default value isby_thread. -
Restrict the import to these provider folders (folder
idas returned by fetch-folders). Optional. Applies to import_all, by_search and by_multi_query; ignored for by_thread. -
Number of pages to skip for import all
-
If set, schedule the import to start at this time instead of immediately. Must be in the future.
curl \
--request POST 'http://api.example.com/email-data/{caseId}/start-import-emails' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"providerId": "string",
"extractionCode": "string",
"notificationEmails": [
"string"
],
"type": "by_thread",
"emails": [
{
"threadId": "string"
}
],
"searchData": {
"anyEmail": [
"string"
],
"to": [
"string"
],
"bcc": [
"string"
],
"cc": [
"string"
],
"from": [
"string"
],
"hasAttachment": true,
"receivedAfter": "string",
"receivedBefore": "string",
"keywords": [
"string"
],
"subject": "string",
"contactNames": [
"string"
],
"folders": [
"string"
]
},
"multiQueryData": {
"queries": [
"string"
],
"emails": [
"string"
],
"dateStart": "string",
"dateEnd": "string"
},
"folderIds": [
"string"
],
"importAllSkipPages": 42.0,
"scheduledFor": "string"
}'
{
"providerId": "string",
"extractionCode": "string",
"notificationEmails": [
"string"
],
"type": "by_thread",
"emails": [
{
"threadId": "string"
}
],
"searchData": {
"anyEmail": [
"string"
],
"to": [
"string"
],
"bcc": [
"string"
],
"cc": [
"string"
],
"from": [
"string"
],
"hasAttachment": true,
"receivedAfter": "string",
"receivedBefore": "string",
"keywords": [
"string"
],
"subject": "string",
"contactNames": [
"string"
],
"folders": [
"string"
]
},
"multiQueryData": {
"queries": [
"string"
],
"emails": [
"string"
],
"dateStart": "string",
"dateEnd": "string"
},
"folderIds": [
"string"
],
"importAllSkipPages": 42.0,
"scheduledFor": "string"
}
{
"data": {
"createdAt": "2026-01-15T14:30:00.000Z",
"updatedAt": "2026-01-15T14:30:00.000Z",
"id": "507f1f77bcf86cd799439011",
"emailDataProvider": {},
"extractionCode": {},
"case": {},
"notificationEmails": [
"jane.doe@example.com"
],
"status": "not_started",
"type": "by_thread",
"startedAt": "2026-01-15T14:30:00.000Z",
"completedAt": "2026-05-04T09:42:00Z",
"failedAt": "2026-05-04T09:42:00Z",
"message": "Importing threads",
"jobData": {
"providerId": "65a1b2c3d4e5f6a7b8c9d0e1"
},
"importedThreadsCount": 120,
"importedEmailsCount": 348,
"totalThreadsCount": 400,
"totalEmailsCount": 1150,
"isCancelled": false,
"scheduledFor": "2026-05-04T09:42:00Z"
},
"statusCode": 200,
"timestamp": "2026-01-15T10:15:00.000Z"
}