Deskhero Developer Hub
Back to deskhero.com
Imports

Imap validate and get folders

Connects to the IMAP server with the supplied host, port and credentials and returns the folders it finds, each with its current message count. Nothing is stored, this only proves the credentials work before an import is created. Despite the name it does not return every folder: only folders whose name contains "Sent" plus the server's designated Sent folder are returned, since email imports read sent mail.

POST /api/{tenant:minlength(2)}/v{version:apiVersion}/imports/imap_validate_and_get_folders
Authorisation
Minimum role: ADMIN

Request arguments

Name Type Source
inputDTO_external_auth_imapBody
Request body example

Response

Status
200 (OK)
Type
DTO_external_email_folder[]
Wrapper
DTO_response_wrap
Other statuses
400 (BadRequest), 403 (Forbidden)
Response body example
DTO_external_auth_imap
NameTypeReadOnlyDescription
hostnameStringHostname
portInt32Port
usernameStringUsername
passwordStringPassword
DTO_external_email_folder
NameTypeReadOnlyDescription
mailboxStringMailbox
folder_nameStringFolder name
well_known_nameENUM mailbox_folder_well_known_nameWell known name
countInt32Count
ENUM mailbox_folder_well_known_name
ValueNameDescription
0UNKNOWNUNKNOWN
1INBOXINBOX
2SENT_ITEMSSENT_ITEMS
3DELETED_ITEMSDELETED_ITEMS
4DRAFTSDRAFTS
5ARCHIVEARCHIVE
6JUNK_SPAM_EMAILJUNK_SPAM_EMAIL
7CLUTTERCLUTTER
8CONVERSATION_HISTORYCONVERSATION_HISTORY
9OUTBOXOUTBOX
10TRASHTRASH
11IMPORTANTIMPORTANT
12STARREDSTARRED
13UNREADUNREAD
14CATEGORY_PERSONALCATEGORY_PERSONAL
15CATEGORY_SOCIALCATEGORY_SOCIAL
16CATEGORY_PROMOTIONSCATEGORY_PROMOTIONS
17CATEGORY_UPDATESCATEGORY_UPDATES
18CATEGORY_FORUMSCATEGORY_FORUMS
19RECOVERABLE_ROOTRECOVERABLE_ROOT
20RECOVERABLE_DELETIONSRECOVERABLE_DELETIONS
21RECOVERABLE_PURGESRECOVERABLE_PURGES

Generated Aug 4, 2026 18:37