Gmail — Email
Xem hồ sơ Gmail (Get profile) — gmail.get_profile
Gets the Gmail profile for the connected account, including emailAddress and mailbox totals. Use this to confirm which mailbox is linked before reading or sending mail.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | https://www.googleapis.com/auth/gmail.readonly |
Input
Không có input.
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
emailAddress | Địa chỉ email | string | |
messagesTotal | Tổng số thư | integer | |
threadsTotal | Tổng số chuỗi thư | integer | |
historyId | Mã lịch sử | string |
Xem danh sách nhãn (List labels) — gmail.list_labels
Lists Gmail labels for the connected account (id, name, type, visibility). Call this before modify_message_labels or create_label to resolve label ids. System labels like INBOX and UNREAD are included.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | https://www.googleapis.com/auth/gmail.readonly |
Input
Không có input.
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
labels | Danh sách nhãn | array of object | |
labels[].id | string | ||
labels[].name | string | ||
labels[].type | string | ||
labels[].messageListVisibility | string | ||
labels[].labelListVisibility | string |
Lấy danh sách email (Fetch emails) — gmail.fetch_emails
Fetches a list of Gmail messages for the connected account. Supports Gmail search q, max_results, page_token, and label_ids. Use this to find candidates; call get_message or get_thread for full content.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | https://www.googleapis.com/auth/gmail.readonly |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
q | Từ khóa tìm kiếm | string | không | Gmail search query, same syntax as the Gmail search box, e.g. "from:anna is:unread". |
max_results | Số kết quả tối đa | integer | không | Max messages to return (1-500). Defaults to 100. |
page_token | Mã trang tiếp theo | string | không | Token for the next page. From nextPageToken of the previous gmail.fetch_emails call. |
label_ids | Mã nhãn | array of string | không | Only return messages that have all of these label ids, e.g. ["INBOX", "UNREAD"]. From gmail.list_labels. |
Field thêm: gửi dưới dạng query parameter.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
messages | Danh sách thư | array of object | List entries contain only id + threadId; use get_message for full content. |
messages[].id | string | ||
messages[].threadId | string | ||
nextPageToken | Mã trang tiếp theo | string | |
resultSizeEstimate | Số kết quả ước tính | integer |
Xem thư (Get message) — gmail.get_message
Fetches a single Gmail message by message_id. Prefer get_thread when the agent needs the full conversation context. Obtain ids via fetch_emails or list_threads.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | https://www.googleapis.com/auth/gmail.readonly |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
message_id | Mã thư | string | có | Id of the message to fetch. From gmail.fetch_emails or gmail.get_thread. |
format | Định dạng | string | không | How much of the message to return; raw gives the base64url MIME in raw. Defaults to full. One of: minimal, full, raw, metadata. |
Field thêm: gửi dưới dạng query parameter.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã thư | string | |
threadId | Mã chuỗi thư | string | |
labelIds | Nhãn | array of string | |
snippet | Đoạn trích | string | |
historyId | Mã lịch sử | string | |
internalDate | Thời điểm nhận | string | |
sizeEstimate | Kích thước ước tính | integer | |
payload | Cấu trúc thư | object | |
raw | Thư nguyên bản | string |
Xem chuỗi thư (Get thread) — gmail.get_thread
Fetches a Gmail thread by thread_id, including messages in that conversation. Prefer this over get_message when the agent needs full reply context. Use list_threads or fetch_emails first if the id is unknown.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | https://www.googleapis.com/auth/gmail.readonly |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
thread_id | Mã chuỗi thư | string | có | Id of the thread to fetch. From gmail.list_threads or gmail.fetch_emails (threadId). |
format | Định dạng | string | không | How much of each message to return. Defaults to full. One of: full, metadata, minimal. |
Field thêm: gửi dưới dạng query parameter.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã chuỗi thư | string | |
snippet | Đoạn trích | string | |
historyId | Mã lịch sử | string | |
messages | Danh sách thư | array of object | |
messages[].id | string | ||
messages[].threadId | string | ||
messages[].labelIds | array of string | ||
messages[].snippet | string |
Xem danh sách chuỗi thư (List threads) — gmail.list_threads
Lists Gmail conversation threads for the connected account. Supports Gmail search q, max_results, page_token, and label_ids. Listed threads omit messages — call get_thread for full conversation content.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | https://www.googleapis.com/auth/gmail.readonly |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
q | Từ khóa tìm kiếm | string | không | Gmail search query, same syntax as the Gmail search box, e.g. "from:anna is:unread". |
max_results | Số kết quả tối đa | integer | không | Max threads to return (1-500). Defaults to 100. |
page_token | Mã trang tiếp theo | string | không | Token for the next page. From nextPageToken of the previous gmail.list_threads call. |
label_ids | Mã nhãn | array of string | không | Only return threads that have all of these label ids, e.g. ["INBOX", "UNREAD"]. From gmail.list_labels. |
Field thêm: gửi dưới dạng query parameter.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
threads | Danh sách chuỗi thư | array of object | List entries omit messages; use get_thread for full content. |
threads[].id | string | ||
threads[].snippet | string | ||
threads[].historyId | string | ||
nextPageToken | Mã trang tiếp theo | string | |
resultSizeEstimate | Số kết quả ước tính | integer |
Tải tệp đính kèm (Get attachment) — gmail.get_attachment
Downloads a Gmail message attachment by message_id and attachment_id. Obtain attachment_id from get_message payload parts. Returns base64url-encoded data and byte size.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | https://www.googleapis.com/auth/gmail.readonly |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
message_id | Mã thư | string | có | Id of the message that has the attachment. From gmail.fetch_emails or gmail.get_thread. |
attachment_id | Mã tệp đính kèm | string | có | Id of the attachment. From gmail.get_message (payload.parts[].body.attachmentId). |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
attachmentId | Mã tệp đính kèm | string | |
size | Kích thước | integer | |
data | Dữ liệu tệp | string |
Xem danh sách thư nháp (List drafts) — gmail.list_drafts
Lists Gmail drafts for the connected account. Supports optional q, max_results, and page_token. Listed drafts only include message id/threadId — call get_draft for content.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | https://www.googleapis.com/auth/gmail.readonly |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
q | Từ khóa tìm kiếm | string | không | Only return drafts matching this Gmail search query, e.g. "subject:invoice". |
max_results | Số kết quả tối đa | integer | không | Max drafts to return (1-500). Defaults to 100. |
page_token | Mã trang tiếp theo | string | không | Token for the next page. From nextPageToken of the previous gmail.list_drafts call. |
Field thêm: gửi dưới dạng query parameter.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
drafts | Danh sách thư nháp | array of object | |
drafts[].id | string | ||
drafts[].message | object | ||
drafts[].message.id | string | ||
drafts[].message.threadId | string | ||
nextPageToken | Mã trang tiếp theo | string | |
resultSizeEstimate | Số kết quả ước tính | integer |
Xem thư nháp (Get draft) — gmail.get_draft
Fetches a single Gmail draft by draft_id, including its message payload. Use list_drafts to discover ids. Prefer get_draft before send_draft or update_draft so the agent reviews current content.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| NONE | low | không | có | https://www.googleapis.com/auth/gmail.readonly |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
draft_id | Mã thư nháp | string | có | Id of the draft to fetch. From gmail.list_drafts. |
format | Định dạng | string | không | How much of the draft message to return. Defaults to full. One of: minimal, full, raw, metadata. |
Field thêm: gửi dưới dạng query parameter.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã thư nháp | string | |
message | Thư | object | |
message.id | string | ||
message.threadId | string | ||
message.labelIds | array of string | ||
message.snippet | string |
Tạo thư nháp (Create draft) — gmail.create_draft
Creates a Gmail draft with to, subject, and body. Does not send mail — use send_draft after review, or send_email for immediate send. Optional thread_id attaches the draft to an existing conversation.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | không | không | https://www.googleapis.com/auth/gmail.compose |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
to | Người nhận | string | có | Recipient email address; separate several with commas, e.g. "anna@example.com, bob@example.com". |
subject | Tiêu đề | string | có | Email subject line. |
body | Nội dung | string | có | Email body as plain text (HTML tags are not rendered). |
thread_id | Mã chuỗi thư | string | không | Thread to put this in; Subject must match the thread's subject. From gmail.list_threads or gmail.fetch_emails (threadId). |
cc | Đồng gửi | string | không | CC email addresses, comma-separated. |
bcc | Gửi ẩn | string | không | BCC email addresses, comma-separated. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã thư nháp | string | |
message | Thư | object | |
message.id | string | ||
message.threadId | string | ||
message.labelIds | array of string | ||
message.snippet | string |
Thẻ duyệt: hiển thị dạng email (to → to, cc → cc, bcc → bcc, subject → subject, body → body).
Cập nhật thư nháp (Update draft) — gmail.update_draft
Replaces an existing Gmail draft identified by draft_id with new to, subject, and body. Does not send mail. Call get_draft first if the agent needs the prior content.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | không | không | https://www.googleapis.com/auth/gmail.compose |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
draft_id | Mã thư nháp | string | có | Id of the draft to replace. From gmail.list_drafts. |
to | Người nhận | string | có | New recipient email address; separate several with commas. Replaces the draft's recipients. |
subject | Tiêu đề | string | có | New subject line; replaces the draft's subject. |
body | Nội dung | string | có | New body as plain text; replaces the draft's whole body. |
thread_id | Mã chuỗi thư | string | không | Thread to put this in; Subject must match the thread's subject. From gmail.list_threads or gmail.fetch_emails (threadId). |
cc | Đồng gửi | string | không | New CC email addresses, comma-separated. Leave empty to drop CC. |
bcc | Gửi ẩn | string | không | New BCC email addresses, comma-separated. Leave empty to drop BCC. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã thư nháp | string | |
message | Thư | object | |
message.id | string | ||
message.threadId | string | ||
message.labelIds | array of string | ||
message.snippet | string |
Thẻ duyệt: hiển thị dạng email (to → to, cc → cc, bcc → bcc, subject → subject, body → body).
Gửi thư nháp (Send draft) — gmail.send_draft
Sends an existing Gmail draft as-is by draft_id. This delivers email to recipients already on the draft — irreversible from the agent. Prefer create_draft + human review before send_draft.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | high | có | không | https://www.googleapis.com/auth/gmail.send |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
draft_id | Mã thư nháp | string | có | Id of the draft to send. From gmail.list_drafts or gmail.create_draft. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã thư | string | |
threadId | Mã chuỗi thư | string | |
labelIds | Nhãn | array of string |
Gửi email (Send email) — gmail.send_email
Sends a new Gmail message with to, subject, and body immediately. This delivers mail to recipients — irreversible from the agent. Prefer create_draft + send_draft when human review is needed first.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | high | có | không | https://www.googleapis.com/auth/gmail.send |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
to | Người nhận | string | có | Recipient email address; separate several with commas, e.g. "anna@example.com, bob@example.com". |
subject | Tiêu đề | string | có | Email subject line. |
body | Nội dung | string | có | Email body as plain text (HTML tags are not rendered). |
cc | Đồng gửi | string | không | CC email addresses, comma-separated. |
bcc | Gửi ẩn | string | không | BCC email addresses, comma-separated. |
thread_id | Mã chuỗi thư | string | không | Thread to put this in; Subject must match the thread's subject. From gmail.list_threads or gmail.fetch_emails (threadId). |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã thư | string | |
threadId | Mã chuỗi thư | string | |
labelIds | Nhãn | array of string |
Thẻ duyệt: hiển thị dạng email (to → to, cc → cc, bcc → bcc, subject → subject, body → body).
Trả lời chuỗi thư (Reply to thread) — gmail.reply_to_thread
Sends a reply into an existing Gmail thread by thread_id with to, subject, and body. This delivers mail — irreversible from the agent; prefer draft review when unsure.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | high | có | không | https://www.googleapis.com/auth/gmail.send |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
thread_id | Mã chuỗi thư | string | có | Id of the thread to reply in. From gmail.list_threads or gmail.fetch_emails (threadId). |
body | Nội dung | string | có | Reply text as plain text (HTML tags are not rendered). |
to | Người nhận | string | có | Who gets the reply, usually the original sender; separate several with commas. |
subject | Tiêu đề | string | có | Reply subject; match the thread's subject, e.g. "Re: Order 123", so Gmail keeps it in the thread. |
cc | Đồng gửi | string | không | CC email addresses, comma-separated. |
bcc | Gửi ẩn | string | không | BCC email addresses, comma-separated. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã thư | string | |
threadId | Mã chuỗi thư | string | |
labelIds | Nhãn | array of string |
Thẻ duyệt: hiển thị dạng email (to → to, cc → cc, bcc → bcc, subject → subject, body → body).
Chuyển tiếp thư (Forward message) — gmail.forward_message
Forwards an existing Gmail message identified by message_id to a new to recipient. Optional body adds forward commentary. This delivers mail — irreversible from the agent.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | high | có | không | https://www.googleapis.com/auth/gmail.readonly, https://www.googleapis.com/auth/gmail.send |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
message_id | Mã thư | string | có | Id of the message to forward. From gmail.fetch_emails or gmail.get_thread. |
to | Người nhận | string | có | Recipient email address; separate several with commas, e.g. "anna@example.com, bob@example.com". |
body | Nội dung | string | không | Optional plain-text note shown above the forwarded message. |
subject | Tiêu đề | string | không | Subject of the forward. Defaults to "Fwd: " plus the original subject. |
cc | Đồng gửi | string | không | CC email addresses, comma-separated. |
bcc | Gửi ẩn | string | không | BCC email addresses, comma-separated. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã thư | string | |
threadId | Mã chuỗi thư | string | |
labelIds | Nhãn | array of string |
Thẻ duyệt: hiển thị dạng email (to → to, cc → cc, bcc → bcc, subject → subject, body → body).
Đổi nhãn thư (Modify message labels) — gmail.modify_message_labels
Adds and/or removes Gmail labels on one message. Provide message_id and at least one of add_label_ids / remove_label_ids. Use list_labels to resolve custom label ids before calling.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | không | có | https://www.googleapis.com/auth/gmail.modify |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
message_id | Mã thư | string | có | Id of the message to relabel. From gmail.fetch_emails or gmail.get_thread. |
add_label_ids | Nhãn cần thêm | array of string | không | Label ids to add, e.g. ["STARRED"]. From gmail.list_labels. |
remove_label_ids | Nhãn cần bỏ | array of string | không | Label ids to remove, e.g. ["UNREAD"] marks it read. From gmail.list_labels. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã thư | string | |
threadId | Mã chuỗi thư | string | |
labelIds | Nhãn | array of string |
Đổi nhãn chuỗi thư (Modify thread labels) — gmail.modify_thread_labels
Adds and/or removes Gmail labels on an entire thread (all messages). Provide thread_id and at least one of add_label_ids / remove_label_ids. Use list_labels to resolve custom label ids before calling.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | không | có | https://www.googleapis.com/auth/gmail.modify |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
thread_id | Mã chuỗi thư | string | có | Id of the thread to relabel. From gmail.list_threads or gmail.fetch_emails (threadId). |
add_label_ids | Nhãn cần thêm | array of string | không | Label ids to add to every message in the thread, e.g. ["STARRED"]. From gmail.list_labels. |
remove_label_ids | Nhãn cần bỏ | array of string | không | Label ids to remove from every message, e.g. ["INBOX"] archives it. From gmail.list_labels. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã chuỗi thư | string | |
snippet | Đoạn trích | string | |
historyId | Mã lịch sử | string | |
messages | Danh sách thư | array of object | |
messages[].id | string | ||
messages[].threadId | string | ||
messages[].labelIds | array of string | ||
messages[].snippet | string |
Tạo nhãn (Create label) — gmail.create_label
Creates a user Gmail label with the given name. Optional visibility fields control inbox list presentation. Use list_labels afterward to confirm the new label id before applying it.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | không | không | https://www.googleapis.com/auth/gmail.modify |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
name | Tên nhãn | string | có | Display name of the new label, e.g. "Customers/VIP" (a slash nests it under "Customers"). |
message_list_visibility | Hiển thị trong danh sách thư | string | không | Whether messages with this label are shown in the message list. One of: show, hide. |
label_list_visibility | Hiển thị trong danh sách nhãn | string | không | Whether the label is shown in the label list; labelShowIfUnread shows it only when it has unread mail. One of: labelShow, labelShowIfUnread, labelHide. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã nhãn | string | |
name | Tên nhãn | string | |
type | Loại nhãn | string | |
messageListVisibility | Hiển thị trong danh sách thư | string | |
labelListVisibility | Hiển thị trong danh sách nhãn | string | |
messagesTotal | Tổng số thư | integer | |
messagesUnread | Số thư chưa đọc | integer | |
threadsTotal | Tổng số chuỗi thư | integer | |
threadsUnread | Số chuỗi thư chưa đọc | integer | |
color | Màu nhãn | object |
Chuyển thư vào thùng rác (Trash message) — gmail.trash_message
Moves a Gmail message to Trash by message_id. User-visible and recoverable via untrash_message until permanently deleted. Prefer trash over permanent delete for reversible cleanup.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | không | có | https://www.googleapis.com/auth/gmail.modify |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
message_id | Mã thư | string | có | Id of the message to move to Trash. From gmail.fetch_emails or gmail.get_thread. |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã thư | string | |
threadId | Mã chuỗi thư | string | |
labelIds | Nhãn | array of string |
Chuyển chuỗi thư vào thùng rác (Trash thread) — gmail.trash_thread
Moves an entire Gmail thread (all messages) to Trash by thread_id. User-visible and recoverable via untrash_thread. Use when the whole conversation should leave the inbox.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | không | có | https://www.googleapis.com/auth/gmail.modify |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
thread_id | Mã chuỗi thư | string | có | Id of the thread to move to Trash. From gmail.list_threads or gmail.fetch_emails (threadId). |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã chuỗi thư | string | |
snippet | Đoạn trích | string | |
historyId | Mã lịch sử | string | |
messages | Danh sách thư | array of object | |
messages[].id | string | ||
messages[].threadId | string | ||
messages[].labelIds | array of string | ||
messages[].snippet | string |
Khôi phục thư từ thùng rác (Untrash message) — gmail.untrash_message
Restores a Gmail message from Trash by message_id. Use after trash_message when the agent or user wants the message back. Low-risk write; does not permanently delete.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | low | không | có | https://www.googleapis.com/auth/gmail.modify |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
message_id | Mã thư | string | có | Id of the trashed message to restore. From gmail.trash_message or gmail.fetch_emails with q "in:trash". |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã thư | string | |
threadId | Mã chuỗi thư | string | |
labelIds | Nhãn | array of string |
Khôi phục chuỗi thư từ thùng rác (Untrash thread) — gmail.untrash_thread
Restores an entire Gmail thread from Trash by thread_id. Use after trash_thread to bring the conversation back. Low-risk write; does not permanently delete.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | low | không | có | https://www.googleapis.com/auth/gmail.modify |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
thread_id | Mã chuỗi thư | string | có | Id of the trashed thread to restore. From gmail.trash_thread or gmail.list_threads with q "in:trash". |
Field thêm: bỏ qua.
Output
| Field | Nhãn | Kiểu | Mô tả |
|---|---|---|---|
id | Mã chuỗi thư | string | |
snippet | Đoạn trích | string | |
historyId | Mã lịch sử | string | |
messages | Danh sách thư | array of object | |
messages[].id | string | ||
messages[].threadId | string | ||
messages[].labelIds | array of string | ||
messages[].snippet | string |
Xóa thư nháp (Delete draft) — gmail.delete_draft
Permanently deletes a Gmail draft by draft_id (not trash — irreversible). Prefer update_draft or leave drafts when unsure. Requires approval because the draft cannot be recovered.
| Tác động | Rủi ro | Cần duyệt | Idempotent | Scopes |
|---|---|---|---|---|
| WRITE | medium | có | có | https://www.googleapis.com/auth/gmail.compose |
Input
| Field | Nhãn | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
draft_id | Mã thư nháp | string | có | Id of the draft to delete for good. From gmail.list_drafts. |
Field thêm: bỏ qua.
Output
Trả về object rỗng.