Infomaniak Mail icon

Infomaniak Mail

Interact with Infomaniak Mail API

Actions118

Mailboxes > Folders → Update Folders

AI-generated

Summary

Updates mailbox folders for a specified hosting and returns the updated folder object.

Inputs

  • authentication — Authentication method to use, either OAuth2 or API Key.
  • path_mail_hosting_id (required) — The unique identifier of the mail hosting containing the mailbox.
  • path_mailbox_name (required) — The username part of the email address whose folders are being updated.
  • body_archives_folder (required) — Destination folder for archived messages.
  • body_draft_folder (required) — Destination folder for draft messages.
  • body_sent_folder (required) — Destination folder for sent messages.
  • body_trash_folder (required) — Destination folder for deleted messages.
  • bodyParameters — Additional folder mappings such as commercials, social networks, and spam folders.
  • returnFullResponse — If true, the full response body is returned; otherwise only success/failure status is provided.

Output shape

a single folder object

Contains the updated folder's attributes; when returnFullResponse is true additional fields may be included; otherwise only minimal data is returned.

Examples

Example 1: Update folder destinations for a mailbox using OAuth2.

authentication=oauth2, path_mail_hosting_id=12, path_mailbox_name=john.doe, body_archives_folder=archives, body_draft_folder=drafts, body_sent_folder=sent, body_trash_folder=trash, bodyParameters={}, returnFullResponse=false

Example 2: Configure additional folder mappings with API Key and request full response.

authentication=apiKey, path_mail_hosting_id=5, path_mailbox_name=jane, body_archives_folder=archive, body_draft_folder=draft, body_sent_folder=sent, body_trash_folder=trash, bodyParameters={commercials_folder=commercial, social_networks_folder=social, spam_folder=spam}, returnFullResponse=true

Example 3: Minimal update of only the archives folder.

authentication=oauth2, path_mail_hosting_id=9, path_mailbox_name=admin, body_archives_folder=archive, bodyParameters={}, returnFullResponse=false

Links

Discussion