Skip to content

Microsoft: Update the navigation property mail Folders in users

Microsoft usersMailFolder.updateMailFolders: arguments, response, policy and SDK examples.

← Users mail folder operations · Get started

Operation microsoft.users_updatemailfolders

Provider route: PATCH /users/{user-id}/mailFolders/{mailFolder-id}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/microsoft with npm, or alter-sdk-microsoft with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { MicrosoftIntegration } from "@alter-ai/microsoft";
async function execute(input: Parameters<MicrosoftIntegration["usersMailFolder"]["updateMailFolders"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new MicrosoftIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.usersMailFolder.updateMailFolders(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_microsoft import MicrosoftIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = MicrosoftIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.users_mail_folder.update_mail_folders(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.user-idstringRequired within parent
path.mailFolder-idstringRequired within parent
bodyModelRequired within parentExpand Create Mail Folder — request body — body

Referenced models: Create Mail Folder — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get mail Folder — response body

Referenced models: Get mail Folder — response body

23 more schemas are linked from the tables above, on the schema pages.

Get mail Folder — response body
FieldTypePresenceDescription and constraints
$JSONRoot
$ (allOf 1)ModelAll variants applyExpand Get rule — response body — @odata type, id
$ (allOf 2)objectAll variants applydiscriminator: {"mapping": {}, "propertyName": "@odata.type"}
$ (allOf 2).@odata.typestringOptional
$ (allOf 2).childFolderCountJSONOptional
$ (allOf 2).childFolderCount (anyOf 1)JSONAlternative
$ (allOf 2).childFolderCount (anyOf 1) (anyOf 1)numberAlternativeThe number of immediate child mailFolders in the current mailFolder.
Format: int32
Maximum: 2147483647
Minimum: -2147483648
$ (allOf 2).childFolderCount (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
$ (allOf 2).childFolderCount (anyOf 2)nullAlternative
$ (allOf 2).childFoldersarrayOptionalThe collection of child folders in the mailFolder.
$ (allOf 2).childFolders[]ModelEach itemExpand Get mail Folder — response body
$ (allOf 2).displayNameJSONOptional
$ (allOf 2).displayName (anyOf 1)stringAlternativeThe mailFolder's display name.
$ (allOf 2).displayName (anyOf 2)nullAlternative
$ (allOf 2).isHiddenJSONOptional
$ (allOf 2).isHidden (anyOf 1)booleanAlternativeIndicates whether the mailFolder is hidden. This property can be set only when creating the folder. Find more information in Hidden mail folders.
$ (allOf 2).isHidden (anyOf 2)nullAlternative
$ (allOf 2).messageRulesarrayOptionalThe collection of rules that apply to the user's Inbox folder.
$ (allOf 2).messageRules[]ModelEach itemExpand Get rule — response body
$ (allOf 2).messagesarrayOptionalThe collection of messages in the mailFolder.
$ (allOf 2).messages[]ModelEach itemExpand Get message — response body
$ (allOf 2).multiValueExtendedPropertiesarrayOptionalThe collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable.
$ (allOf 2).multiValueExtendedProperties[]ModelEach itemExpand Get mail Folder — response body — @odata type, child Folder Count, child Folders, display Name, is Hidden, message Rules, messages, multi Value Extended Properties, parent Folder Id, single Value Extended Properties, total Item Count, unread Item Count multi Value Extended Properties item
$ (allOf 2).parentFolderIdJSONOptional
$ (allOf 2).parentFolderId (anyOf 1)stringAlternativeThe unique identifier for the mailFolder's parent mailFolder.
$ (allOf 2).parentFolderId (anyOf 2)nullAlternative
$ (allOf 2).singleValueExtendedPropertiesarrayOptionalThe collection of single-value extended properties defined for the mailFolder. Read-only. Nullable.
$ (allOf 2).singleValueExtendedProperties[]ModelEach itemExpand Get mail Folder — response body — @odata type, child Folder Count, child Folders, display Name, is Hidden, message Rules, messages, multi Value Extended Properties, parent Folder Id, single Value Extended Properties, total Item Count, unread Item Count single Value Extended Properties item
$ (allOf 2).totalItemCountJSONOptional
$ (allOf 2).totalItemCount (anyOf 1)JSONAlternative
$ (allOf 2).totalItemCount (anyOf 1) (anyOf 1)numberAlternativeThe number of items in the mailFolder.
Format: int32
Maximum: 2147483647
Minimum: -2147483648
$ (allOf 2).totalItemCount (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
$ (allOf 2).totalItemCount (anyOf 2)nullAlternative
$ (allOf 2).unreadItemCountJSONOptional
$ (allOf 2).unreadItemCount (anyOf 1)JSONAlternative
$ (allOf 2).unreadItemCount (anyOf 1) (anyOf 1)numberAlternativeThe number of items in the mailFolder marked as unread.
Format: int32
Maximum: 2147483647
Minimum: -2147483648
$ (allOf 2).unreadItemCount (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
$ (allOf 2).unreadItemCount (anyOf 2)nullAlternative

Referenced models: Get rule — response body — @odata type, id, Get mail Folder — response body, Get message — response body, Get rule — response body, Get mail Folder — response body — @odata type, child Folder Count, child Folders, display Name, is Hidden, message Rules, messages, multi Value Extended Properties, parent Folder Id, single Value Extended Properties, total Item Count, unread Item Count multi Value Extended Properties item, Get mail Folder — response body — @odata type, child Folder Count, child Folders, display Name, is Hidden, message Rules, messages, multi Value Extended Properties, parent Folder Id, single Value Extended Properties, total Item Count, unread Item Count single Value Extended Properties item

Get mail Folder — response body — @odata type, child Folder Count, child Folders, display Name, is Hidden, message Rules, messages, multi Value Extended Properties, parent Folder Id, single Value Extended Properties, total Item Count, unread Item Count multi Value Extended Properties item
FieldTypePresenceDescription and constraints
$JSONRoot
$ (allOf 1)ModelAll variants applyExpand Get rule — response body — @odata type, id
$ (allOf 2)objectAll variants apply
$ (allOf 2).@odata.typestringOptional
$ (allOf 2).valuearrayOptionalA collection of property values.
$ (allOf 2).value[]JSONEach item
$ (allOf 2).value[] (anyOf 1)stringAlternative
$ (allOf 2).value[] (anyOf 2)nullAlternative

Referenced models: Get rule — response body — @odata type, id

Get mail Folder — response body — @odata type, child Folder Count, child Folders, display Name, is Hidden, message Rules, messages, multi Value Extended Properties, parent Folder Id, single Value Extended Properties, total Item Count, unread Item Count single Value Extended Properties item
FieldTypePresenceDescription and constraints
$JSONRoot
$ (allOf 1)ModelAll variants applyExpand Get rule — response body — @odata type, id
$ (allOf 2)objectAll variants apply
$ (allOf 2).@odata.typestringOptional
$ (allOf 2).valueJSONOptional
$ (allOf 2).value (anyOf 1)stringAlternativeA property value.
$ (allOf 2).value (anyOf 2)nullAlternative

Referenced models: Get rule — response body — @odata type, id

Create Mail Folder — request body — body @odata type, child Folder Count, child Folders, display Name, is Hidden, message Rules, messages, multi Value Extended Properties, parent Folder Id, single Value Extended Properties, total Item Count, unread Item Count child Folders item
FieldTypePresenceDescription and constraints
$JSONRoot
$ (allOf 1)ModelAll variants applyExpand Get rule — response body — @odata type, id
$ (allOf 2)objectAll variants applydiscriminator: {"mapping": {}, "propertyName": "@odata.type"}
$ (allOf 2).@odata.typestringOptional
$ (allOf 2).childFolderCountJSONOptional
$ (allOf 2).childFolderCount (anyOf 1)numberAlternativeThe number of immediate child mailFolders in the current mailFolder.
Format: int32
Maximum: 2147483647
Minimum: -2147483648
$ (allOf 2).childFolderCount (anyOf 2)nullAlternative
$ (allOf 2).displayNameJSONOptional
$ (allOf 2).displayName (anyOf 1)stringAlternativeThe mailFolder's display name.
$ (allOf 2).displayName (anyOf 2)nullAlternative
$ (allOf 2).isHiddenJSONOptional
$ (allOf 2).isHidden (anyOf 1)booleanAlternativeIndicates whether the mailFolder is hidden. This property can be set only when creating the folder. Find more information in Hidden mail folders.
$ (allOf 2).isHidden (anyOf 2)nullAlternative
$ (allOf 2).parentFolderIdJSONOptional
$ (allOf 2).parentFolderId (anyOf 1)stringAlternativeThe unique identifier for the mailFolder's parent mailFolder.
$ (allOf 2).parentFolderId (anyOf 2)nullAlternative
$ (allOf 2).totalItemCountJSONOptional
$ (allOf 2).totalItemCount (anyOf 1)numberAlternativeThe number of items in the mailFolder.
Format: int32
Maximum: 2147483647
Minimum: -2147483648
$ (allOf 2).totalItemCount (anyOf 2)nullAlternative
$ (allOf 2).unreadItemCountJSONOptional
$ (allOf 2).unreadItemCount (anyOf 1)numberAlternativeThe number of items in the mailFolder marked as unread.
Format: int32
Maximum: 2147483647
Minimum: -2147483648
$ (allOf 2).unreadItemCount (anyOf 2)nullAlternative

Referenced models: Get rule — response body — @odata type, id

SDK function policy ID: microsoft.users_updatemailfolders. Catalog operation: users_updatemailfolders. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["Mail.ReadWrite"]

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.