Deskhero Developer Hub
Back to deskhero.com
Imports

Oauth validate and get folders

Returns the Sent folders (only those) of a Microsoft or Google mailbox reached with the tokens from a completed OAuth flow, without storing anything. The identifier is the one handed out by that flow and resolves against a cache entry that lives for one hour, after which the OAuth step has to be repeated. other_mailbox lets a Microsoft connection inspect a shared mailbox instead of the authorizing account's own, it is ignored for Google.

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

Request arguments

Name Type Source
inputDTO_import_email_oauth2_validationBody
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_import_email_oauth2_validation
NameTypeReadOnlyDescription
identifierStringIdentifier
other_mailboxStringOther mailbox
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