Skip to content

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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcóhttps://www.googleapis.com/auth/gmail.readonly

Input

Không có input.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
emailAddressĐịa chỉ emailstring
messagesTotalTổng số thưinteger
threadsTotalTổng số chuỗi thưinteger
historyIdMã 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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcóhttps://www.googleapis.com/auth/gmail.readonly

Input

Không có input.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
labelsDanh sách nhãnarray of object
labels[].idstring
labels[].namestring
labels[].typestring
labels[].messageListVisibilitystring
labels[].labelListVisibilitystring

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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcóhttps://www.googleapis.com/auth/gmail.readonly

Input

FieldNhãnKiểuBắt buộcMô tả
qTừ khóa tìm kiếmstringkhôngGmail search query, same syntax as the Gmail search box, e.g. "from:anna is:unread".
max_resultsSố kết quả tối đaintegerkhôngMax messages to return (1-500). Defaults to 100.
page_tokenMã trang tiếp theostringkhôngToken for the next page. From nextPageToken of the previous gmail.fetch_emails call.
label_idsMã nhãnarray of stringkhôngOnly 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

FieldNhãnKiểuMô tả
messagesDanh sách thưarray of objectList entries contain only id + threadId; use get_message for full content.
messages[].idstring
messages[].threadIdstring
nextPageTokenMã trang tiếp theostring
resultSizeEstimateSố kết quả ước tínhinteger

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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcóhttps://www.googleapis.com/auth/gmail.readonly

Input

FieldNhãnKiểuBắt buộcMô tả
message_idMã thưstringcóId of the message to fetch. From gmail.fetch_emails or gmail.get_thread.
formatĐịnh dạngstringkhôngHow 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

FieldNhãnKiểuMô tả
idMã thưstring
threadIdMã chuỗi thưstring
labelIdsNhãnarray of string
snippetĐoạn tríchstring
historyIdMã lịch sửstring
internalDateThời điểm nhậnstring
sizeEstimateKích thước ước tínhinteger
payloadCấu trúc thưobject
rawThư nguyên bảnstring

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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcóhttps://www.googleapis.com/auth/gmail.readonly

Input

FieldNhãnKiểuBắt buộcMô tả
thread_idMã chuỗi thưstringcóId of the thread to fetch. From gmail.list_threads or gmail.fetch_emails (threadId).
formatĐịnh dạngstringkhôngHow 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

FieldNhãnKiểuMô tả
idMã chuỗi thưstring
snippetĐoạn tríchstring
historyIdMã lịch sửstring
messagesDanh sách thưarray of object
messages[].idstring
messages[].threadIdstring
messages[].labelIdsarray of string
messages[].snippetstring

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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcóhttps://www.googleapis.com/auth/gmail.readonly

Input

FieldNhãnKiểuBắt buộcMô tả
qTừ khóa tìm kiếmstringkhôngGmail search query, same syntax as the Gmail search box, e.g. "from:anna is:unread".
max_resultsSố kết quả tối đaintegerkhôngMax threads to return (1-500). Defaults to 100.
page_tokenMã trang tiếp theostringkhôngToken for the next page. From nextPageToken of the previous gmail.list_threads call.
label_idsMã nhãnarray of stringkhôngOnly 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

FieldNhãnKiểuMô tả
threadsDanh sách chuỗi thưarray of objectList entries omit messages; use get_thread for full content.
threads[].idstring
threads[].snippetstring
threads[].historyIdstring
nextPageTokenMã trang tiếp theostring
resultSizeEstimateSố kết quả ước tínhinteger

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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcóhttps://www.googleapis.com/auth/gmail.readonly

Input

FieldNhãnKiểuBắt buộcMô tả
message_idMã thưstringcóId of the message that has the attachment. From gmail.fetch_emails or gmail.get_thread.
attachment_idMã tệp đính kèmstringcóId of the attachment. From gmail.get_message (payload.parts[].body.attachmentId).

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
attachmentIdMã tệp đính kèmstring
sizeKích thướcinteger
dataDữ liệu tệpstring

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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcóhttps://www.googleapis.com/auth/gmail.readonly

Input

FieldNhãnKiểuBắt buộcMô tả
qTừ khóa tìm kiếmstringkhôngOnly return drafts matching this Gmail search query, e.g. "subject:invoice".
max_resultsSố kết quả tối đaintegerkhôngMax drafts to return (1-500). Defaults to 100.
page_tokenMã trang tiếp theostringkhôngToken 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

FieldNhãnKiểuMô tả
draftsDanh sách thư nháparray of object
drafts[].idstring
drafts[].messageobject
drafts[].message.idstring
drafts[].message.threadIdstring
nextPageTokenMã trang tiếp theostring
resultSizeEstimateSố kết quả ước tínhinteger

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 độngRủi roCần duyệtIdempotentScopes
NONElowkhôngcóhttps://www.googleapis.com/auth/gmail.readonly

Input

FieldNhãnKiểuBắt buộcMô tả
draft_idMã thư nhápstringcóId of the draft to fetch. From gmail.list_drafts.
formatĐịnh dạngstringkhôngHow 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

FieldNhãnKiểuMô tả
idMã thư nhápstring
messageThưobject
message.idstring
message.threadIdstring
message.labelIdsarray of string
message.snippetstring

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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumkhôngkhônghttps://www.googleapis.com/auth/gmail.compose

Input

FieldNhãnKiểuBắt buộcMô tả
toNgười nhậnstringcóRecipient email address; separate several with commas, e.g. "anna@example.com, bob@example.com".
subjectTiêu đềstringcóEmail subject line.
bodyNội dungstringcóEmail body as plain text (HTML tags are not rendered).
thread_idMã chuỗi thưstringkhôngThread to put this in; Subject must match the thread's subject. From gmail.list_threads or gmail.fetch_emails (threadId).
ccĐồng gửistringkhôngCC email addresses, comma-separated.
bccGửi ẩnstringkhôngBCC email addresses, comma-separated.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
idMã thư nhápstring
messageThưobject
message.idstring
message.threadIdstring
message.labelIdsarray of string
message.snippetstring

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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumkhôngkhônghttps://www.googleapis.com/auth/gmail.compose

Input

FieldNhãnKiểuBắt buộcMô tả
draft_idMã thư nhápstringcóId of the draft to replace. From gmail.list_drafts.
toNgười nhậnstringcóNew recipient email address; separate several with commas. Replaces the draft's recipients.
subjectTiêu đềstringcóNew subject line; replaces the draft's subject.
bodyNội dungstringcóNew body as plain text; replaces the draft's whole body.
thread_idMã chuỗi thưstringkhôngThread to put this in; Subject must match the thread's subject. From gmail.list_threads or gmail.fetch_emails (threadId).
ccĐồng gửistringkhôngNew CC email addresses, comma-separated. Leave empty to drop CC.
bccGửi ẩnstringkhôngNew BCC email addresses, comma-separated. Leave empty to drop BCC.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
idMã thư nhápstring
messageThưobject
message.idstring
message.threadIdstring
message.labelIdsarray of string
message.snippetstring

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 độngRủi roCần duyệtIdempotentScopes
WRITEhighcókhônghttps://www.googleapis.com/auth/gmail.send

Input

FieldNhãnKiểuBắt buộcMô tả
draft_idMã thư nhápstringcóId of the draft to send. From gmail.list_drafts or gmail.create_draft.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
idMã thưstring
threadIdMã chuỗi thưstring
labelIdsNhãnarray 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 độngRủi roCần duyệtIdempotentScopes
WRITEhighcókhônghttps://www.googleapis.com/auth/gmail.send

Input

FieldNhãnKiểuBắt buộcMô tả
toNgười nhậnstringcóRecipient email address; separate several with commas, e.g. "anna@example.com, bob@example.com".
subjectTiêu đềstringcóEmail subject line.
bodyNội dungstringcóEmail body as plain text (HTML tags are not rendered).
ccĐồng gửistringkhôngCC email addresses, comma-separated.
bccGửi ẩnstringkhôngBCC email addresses, comma-separated.
thread_idMã chuỗi thưstringkhôngThread 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

FieldNhãnKiểuMô tả
idMã thưstring
threadIdMã chuỗi thưstring
labelIdsNhãnarray 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 độngRủi roCần duyệtIdempotentScopes
WRITEhighcókhônghttps://www.googleapis.com/auth/gmail.send

Input

FieldNhãnKiểuBắt buộcMô tả
thread_idMã chuỗi thưstringcóId of the thread to reply in. From gmail.list_threads or gmail.fetch_emails (threadId).
bodyNội dungstringcóReply text as plain text (HTML tags are not rendered).
toNgười nhậnstringcóWho gets the reply, usually the original sender; separate several with commas.
subjectTiêu đềstringcóReply subject; match the thread's subject, e.g. "Re: Order 123", so Gmail keeps it in the thread.
ccĐồng gửistringkhôngCC email addresses, comma-separated.
bccGửi ẩnstringkhôngBCC email addresses, comma-separated.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
idMã thưstring
threadIdMã chuỗi thưstring
labelIdsNhãnarray 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 độngRủi roCần duyệtIdempotentScopes
WRITEhighcókhônghttps://www.googleapis.com/auth/gmail.readonly, https://www.googleapis.com/auth/gmail.send

Input

FieldNhãnKiểuBắt buộcMô tả
message_idMã thưstringcóId of the message to forward. From gmail.fetch_emails or gmail.get_thread.
toNgười nhậnstringcóRecipient email address; separate several with commas, e.g. "anna@example.com, bob@example.com".
bodyNội dungstringkhôngOptional plain-text note shown above the forwarded message.
subjectTiêu đềstringkhôngSubject of the forward. Defaults to "Fwd: " plus the original subject.
ccĐồng gửistringkhôngCC email addresses, comma-separated.
bccGửi ẩnstringkhôngBCC email addresses, comma-separated.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
idMã thưstring
threadIdMã chuỗi thưstring
labelIdsNhãnarray 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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumkhôngcóhttps://www.googleapis.com/auth/gmail.modify

Input

FieldNhãnKiểuBắt buộcMô tả
message_idMã thưstringcóId of the message to relabel. From gmail.fetch_emails or gmail.get_thread.
add_label_idsNhãn cần thêmarray of stringkhôngLabel ids to add, e.g. ["STARRED"]. From gmail.list_labels.
remove_label_idsNhãn cần bỏarray of stringkhôngLabel ids to remove, e.g. ["UNREAD"] marks it read. From gmail.list_labels.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
idMã thưstring
threadIdMã chuỗi thưstring
labelIdsNhãnarray 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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumkhôngcóhttps://www.googleapis.com/auth/gmail.modify

Input

FieldNhãnKiểuBắt buộcMô tả
thread_idMã chuỗi thưstringcóId of the thread to relabel. From gmail.list_threads or gmail.fetch_emails (threadId).
add_label_idsNhãn cần thêmarray of stringkhôngLabel ids to add to every message in the thread, e.g. ["STARRED"]. From gmail.list_labels.
remove_label_idsNhãn cần bỏarray of stringkhôngLabel ids to remove from every message, e.g. ["INBOX"] archives it. From gmail.list_labels.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
idMã chuỗi thưstring
snippetĐoạn tríchstring
historyIdMã lịch sửstring
messagesDanh sách thưarray of object
messages[].idstring
messages[].threadIdstring
messages[].labelIdsarray of string
messages[].snippetstring

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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumkhôngkhônghttps://www.googleapis.com/auth/gmail.modify

Input

FieldNhãnKiểuBắt buộcMô tả
nameTên nhãnstringcóDisplay name of the new label, e.g. "Customers/VIP" (a slash nests it under "Customers").
message_list_visibilityHiển thị trong danh sách thưstringkhôngWhether messages with this label are shown in the message list. One of: show, hide.
label_list_visibilityHiển thị trong danh sách nhãnstringkhôngWhether 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

FieldNhãnKiểuMô tả
idMã nhãnstring
nameTên nhãnstring
typeLoại nhãnstring
messageListVisibilityHiển thị trong danh sách thưstring
labelListVisibilityHiển thị trong danh sách nhãnstring
messagesTotalTổng số thưinteger
messagesUnreadSố thư chưa đọcinteger
threadsTotalTổng số chuỗi thưinteger
threadsUnreadSố chuỗi thư chưa đọcinteger
colorMàu nhãnobject

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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumkhôngcóhttps://www.googleapis.com/auth/gmail.modify

Input

FieldNhãnKiểuBắt buộcMô tả
message_idMã thưstringcóId of the message to move to Trash. From gmail.fetch_emails or gmail.get_thread.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
idMã thưstring
threadIdMã chuỗi thưstring
labelIdsNhãnarray 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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumkhôngcóhttps://www.googleapis.com/auth/gmail.modify

Input

FieldNhãnKiểuBắt buộcMô tả
thread_idMã chuỗi thưstringcóId of the thread to move to Trash. From gmail.list_threads or gmail.fetch_emails (threadId).

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
idMã chuỗi thưstring
snippetĐoạn tríchstring
historyIdMã lịch sửstring
messagesDanh sách thưarray of object
messages[].idstring
messages[].threadIdstring
messages[].labelIdsarray of string
messages[].snippetstring

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 độngRủi roCần duyệtIdempotentScopes
WRITElowkhôngcóhttps://www.googleapis.com/auth/gmail.modify

Input

FieldNhãnKiểuBắt buộcMô tả
message_idMã thưstringcó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

FieldNhãnKiểuMô tả
idMã thưstring
threadIdMã chuỗi thưstring
labelIdsNhãnarray 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 độngRủi roCần duyệtIdempotentScopes
WRITElowkhôngcóhttps://www.googleapis.com/auth/gmail.modify

Input

FieldNhãnKiểuBắt buộcMô tả
thread_idMã chuỗi thưstringcó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

FieldNhãnKiểuMô tả
idMã chuỗi thưstring
snippetĐoạn tríchstring
historyIdMã lịch sửstring
messagesDanh sách thưarray of object
messages[].idstring
messages[].threadIdstring
messages[].labelIdsarray of string
messages[].snippetstring

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 độngRủi roCần duyệtIdempotentScopes
WRITEmediumcócóhttps://www.googleapis.com/auth/gmail.compose

Input

FieldNhãnKiểuBắt buộcMô tả
draft_idMã thư nhápstringcóId of the draft to delete for good. From gmail.list_drafts.

Field thêm: bỏ qua.

Output

Trả về object rỗng.