Updates the auto-forwarding setting for the specified account. A verified
forwarding address must be specified when auto-forwarding is enabled.
This method is only available to service account clients that have been
delegated domain-wide authority.
Request
HTTP request
PUT https://www.googleapis.com/gmail/v1/users/userId/settings/autoForwarding
Parameters
Parameter name | Value | Description |
---|---|---|
Path parameters | ||
userId |
string |
User's email address. The special value "me" can be used to indicate the authenticated user. |
Authorization
This request requires authorization with the following scope:
Scope |
---|
https://www.googleapis.com/auth/gmail.settings.sharing |
For more information, see the authentication and authorization page.
Request body
In the request body, supply data with the following structure:
{ "enabled": boolean, "emailAddress": string, "disposition": string }
Property name | Value | Description | Notes |
---|---|---|---|
emailAddress |
string |
Email address to which all incoming messages are forwarded. This email address must be a verified member of the forwarding addresses. | |
disposition |
string |
The state that a message should be left in after it has been forwarded.
Acceptable values are:
|
|
enabled |
boolean |
Whether all incoming mail is automatically forwarded to another address. |
Response
If successful, this method returns a response body with the following structure:
{ "enabled": boolean, "emailAddress": string, "disposition": string }
Property name | Value | Description | Notes |
---|---|---|---|
emailAddress |
string |
Email address to which all incoming messages are forwarded. This email address must be a verified member of the forwarding addresses. | |
disposition |
string |
The state that a message should be left in after it has been forwarded.
Acceptable values are:
|
|
enabled |
boolean |
Whether all incoming mail is automatically forwarded to another address. |