Managing Vacation Settings

You can use Settings to configure scheduled auto-reply for an account.

For information on how to get or update, see the Settings reference.

Configuring auto-reply

Auto-reply requires a response subject and body, either HTML or plain text. It can be enabled indefinitely, or limited to a defined period of time. You can also restrict auto-reply to known contacts or domain members.

Example of setting an auto-reply for a fixed period of time, restricting replies to users in the same domain:


VacationSettings vacationSettings = new VacationSettings()
        .setResponseBodyHtml("I'm on vacation and will reply when I'm back in the office. Thanks!")
        .setStartTime( * 1000)
        .setEndTime( * 1000);
VacationSettings response = gmailService.users().settings().updateVacation("me", vacationSettings).execute();


epoch = datetime.utcfromtimestamp(0)
now =
start_time = (now - epoch).total_seconds() * 1000
end_time = (now + timedelta(days=7) - epoch).total_seconds() * 1000
vacation_settings = {
    'enableAutoReply': True,
    'responseBodyHtml': "I'm on vacation and will reply when I'm "
                        "back in the office. Thanks!",
    'restrictToDomain': True,
    'startTime': long(start_time),
    'endTime': long(end_time)
response = gmail_service.users().settings().\
    updateVacation(userId='me', body=vacation_settings).execute()

To disable auto-reply, update the resource and set enableAutoReply to false. If an endTime is configured, auto-reply will automatically disable once the specified time has passed.