Users.settings: updateImap

Requires authorization

Updates IMAP settings. Try it now.

Request

HTTP request

PUT https://www.googleapis.com/gmail/v1/users/userId/settings/imap

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 (read more about authentication and authorization).

Scope
https://www.googleapis.com/auth/gmail.settings.basic

Request body

In the request body, supply data with the following structure:

{
  "enabled": boolean,
  "autoExpunge": boolean,
  "expungeBehavior": string,
  "maxFolderSize": integer
}
Property name Value Description Notes
autoExpunge boolean If this value is true, Gmail will immediately expunge a message when it is marked as deleted in IMAP. Otherwise, Gmail will wait for an update from the client before expunging messages marked as deleted.
expungeBehavior string The action that will be executed on a message when it is marked as deleted and expunged from the last visible IMAP folder.

Acceptable values are:
  • "archive": Archive messages marked as deleted.
  • "deleteForever": Immediately and permanently delete messages marked as deleted. The expunged messages cannot be recovered.
  • "expungeBehaviorUnspecified": Unspecified behavior.
  • "trash": Move messages marked as deleted to the trash.
maxFolderSize integer An optional limit on the number of messages that an IMAP folder may contain. Legal values are 0, 1000, 2000, 5000 or 10000. A value of zero is interpreted to mean that there is no limit.
enabled boolean Whether IMAP is enabled for the account.

Response

If successful, this method returns a response body with the following structure:

{
  "enabled": boolean,
  "autoExpunge": boolean,
  "expungeBehavior": string,
  "maxFolderSize": integer
}
Property name Value Description Notes
autoExpunge boolean If this value is true, Gmail will immediately expunge a message when it is marked as deleted in IMAP. Otherwise, Gmail will wait for an update from the client before expunging messages marked as deleted.
expungeBehavior string The action that will be executed on a message when it is marked as deleted and expunged from the last visible IMAP folder.

Acceptable values are:
  • "archive": Archive messages marked as deleted.
  • "deleteForever": Immediately and permanently delete messages marked as deleted. The expunged messages cannot be recovered.
  • "expungeBehaviorUnspecified": Unspecified behavior.
  • "trash": Move messages marked as deleted to the trash.
maxFolderSize integer An optional limit on the number of messages that an IMAP folder may contain. Legal values are 0, 1000, 2000, 5000 or 10000. A value of zero is interpreted to mean that there is no limit.
enabled boolean Whether IMAP is enabled for the account.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

フィードバックを送信...

ご不明な点がありましたら、Google のサポートページをご覧ください。