Method: users.drafts.update
Replaces a draft's content.
HTTP request
- Upload URI, for media upload requests:
PUT https://gmail.googleapis.com/upload/gmail/v1/users/{userId}/drafts/{id}
- Metadata URI, for metadata-only requests:
PUT https://gmail.googleapis.com/gmail/v1/users/{userId}/drafts/{id}
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
userId |
string
The user's email address. The special value me can be used to indicate the authenticated user.
|
id |
string
The ID of the draft to update.
|
Request body
The request body contains an instance of Draft
.
Response body
If successful, the response body contains an instance of Draft
.
Authorization scopes
Requires one of the following OAuth scopes:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.compose
For more information, see the Authorization guide.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-04 UTC.
[null,null,["Last updated 2024-09-04 UTC."],[[["This method replaces the content of an existing draft using either a media upload URI for attachments or a metadata URI for metadata-only updates."],["It requires specifying the user ID (`userId`) and the draft ID (`id`) as path parameters in the request URL."],["The request body must contain a `Draft` object representing the new draft content."],["Upon successful execution, the API returns the updated `Draft` object in the response body."],["Authorization is necessary and requires one of the specified OAuth scopes related to Gmail access and modification."]]],["This document details updating a draft in Gmail using a PUT request. Two URIs are specified: one for media uploads and another for metadata. The `userId` and `id` path parameters identify the user and draft, respectively. The request body requires a `Draft` instance, and a successful response also returns a `Draft` instance. Authorization requires one of three specified OAuth scopes, such as `gmail.modify`, `gmail.compose` or `mail.google.com/`.\n"]]