Infomaniak Mail icon

Infomaniak Mail

Interact with Infomaniak Mail API

Actions118

Service Mail > Redirections → Create Redirection

AI-generated

Summary

Create a new mail redirection for a specified Infomaniak hosting using the chosen authentication method.

Inputs

  • authentication (required) — Authentication method; either OAuth2 or API Key.
  • path_mail_hosting_id (required) — Identifier of the mail hosting to which the redirection belongs.
  • body_name (required) — Name of the redirection (the label shown to users).
  • body_targets (required) — JSON object or array specifying email addresses that will receive redirected mail.
  • returnFullResponse — If true, the full API response is returned; otherwise only a success indication is provided.

Output shape

a single redirection object

Success returns the created object; when returnFullResponse is true the full API response JSON is returned, otherwise only a success status.

Examples

Example 1: Create a redirection via OAuth2

authentication: OAuth2; path_mail_hosting_id: 12345; body_name: "forward-to-gmail"; body_targets: ["user@example.com"]; returnFullResponse: false

Example 2: Create with API Key and request full response

authentication: API Key; path_mail_hosting_id: 67890; body_name: "backup-mail"; body_targets: {"primary":"mail@example.com"}; returnFullResponse: true

Links

Discussion