gmail.api.* operation is listed below with parameter shapes and return types from the plugin Zod schemas.
New to Corsair? See API access, authentication, and error handling.
Drafts
create
drafts.create
Create a new draft
Risk: write
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
draft | object | Yes | — |
draft full type
draft full type
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
message | object | No | — |
message full type
message full type
delete
drafts.delete
Delete a draft [DESTRUCTIVE]
Risk: destructive
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
void
get
drafts.get
Get a specific draft
Risk: read
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
format | minimal | full | raw | metadata | No | — |
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
message | object | No | — |
message full type
message full type
list
drafts.list
List drafts in the mailbox
Risk: read
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
maxResults | number | No | — |
pageToken | string | No | — |
q | string | No | — |
| Name | Type | Required | Description |
|---|---|---|---|
drafts | object[] | No | — |
nextPageToken | string | No | — |
resultSizeEstimate | number | No | — |
drafts full type
drafts full type
send
drafts.send
Send a draft as an email
Risk: write
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | No | — |
message | object | No | — |
message full type
message full type
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
threadId | string | No | — |
labelIds | string[] | No | — |
snippet | string | No | — |
historyId | string | No | — |
internalDate | string | number | date | No | — |
sizeEstimate | number | No | — |
payload | object | No | — |
raw | string | No | — |
payload full type
payload full type
update
drafts.update
Update an existing draft
Risk: write
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
draft | object | Yes | — |
draft full type
draft full type
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
message | object | No | — |
message full type
message full type
Labels
create
labels.create
Create a new label
Risk: write
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
label | object | Yes | — |
label full type
label full type
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
name | string | No | — |
messageListVisibility | show | hide | No | — |
labelListVisibility | labelShow | labelShowIfUnread | labelHide | No | — |
type | system | user | No | — |
messagesTotal | number | No | — |
messagesUnread | number | No | — |
threadsTotal | number | No | — |
threadsUnread | number | No | — |
color | object | No | — |
color full type
color full type
delete
labels.delete
Delete a label [DESTRUCTIVE]
Risk: destructive
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
void
get
labels.get
Get a specific label
Risk: read
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
name | string | No | — |
messageListVisibility | show | hide | No | — |
labelListVisibility | labelShow | labelShowIfUnread | labelHide | No | — |
type | system | user | No | — |
messagesTotal | number | No | — |
messagesUnread | number | No | — |
threadsTotal | number | No | — |
threadsUnread | number | No | — |
color | object | No | — |
color full type
color full type
list
labels.list
List all labels in the mailbox
Risk: read
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
| Name | Type | Required | Description |
|---|---|---|---|
labels | object[] | No | — |
labels full type
labels full type
update
labels.update
Update an existing label
Risk: write
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
label | object | Yes | — |
label full type
label full type
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
name | string | No | — |
messageListVisibility | show | hide | No | — |
labelListVisibility | labelShow | labelShowIfUnread | labelHide | No | — |
type | system | user | No | — |
messagesTotal | number | No | — |
messagesUnread | number | No | — |
threadsTotal | number | No | — |
threadsUnread | number | No | — |
color | object | No | — |
color full type
color full type
Messages
batchModify
messages.batchModify
Add or remove labels from multiple messages in bulk
Risk: write
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
ids | string[] | No | — |
addLabelIds | string[] | No | — |
removeLabelIds | string[] | No | — |
void
delete
messages.delete
Permanently delete a message [DESTRUCTIVE · IRREVERSIBLE]
Risk: destructive · Irreversible
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
void
get
messages.get
Get a specific message
Risk: read
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
format | minimal | full | raw | metadata | No | — |
metadataHeaders | string[] | No | — |
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
threadId | string | No | — |
labelIds | string[] | No | — |
snippet | string | No | — |
historyId | string | No | — |
internalDate | string | number | date | No | — |
sizeEstimate | number | No | — |
payload | object | No | — |
raw | string | No | — |
payload full type
payload full type
list
messages.list
List messages in a mailbox
Risk: read
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
q | string | No | — |
maxResults | number | No | — |
pageToken | string | No | — |
labelIds | string[] | No | — |
includeSpamTrash | boolean | No | — |
| Name | Type | Required | Description |
|---|---|---|---|
messages | object[] | No | — |
nextPageToken | string | No | — |
resultSizeEstimate | number | No | — |
messages full type
messages full type
modify
messages.modify
Add or remove labels from a message
Risk: write
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
addLabelIds | string[] | No | — |
removeLabelIds | string[] | No | — |
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
threadId | string | No | — |
labelIds | string[] | No | — |
snippet | string | No | — |
historyId | string | No | — |
internalDate | string | number | date | No | — |
sizeEstimate | number | No | — |
payload | object | No | — |
raw | string | No | — |
payload full type
payload full type
send
messages.send
Send an email to one or more recipients
Risk: write
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
raw | string | Yes | — |
threadId | string | No | — |
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
threadId | string | No | — |
labelIds | string[] | No | — |
snippet | string | No | — |
historyId | string | No | — |
internalDate | string | number | date | No | — |
sizeEstimate | number | No | — |
payload | object | No | — |
raw | string | No | — |
payload full type
payload full type
trash
messages.trash
Move a message to the trash
Risk: write
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
threadId | string | No | — |
labelIds | string[] | No | — |
snippet | string | No | — |
historyId | string | No | — |
internalDate | string | number | date | No | — |
sizeEstimate | number | No | — |
payload | object | No | — |
raw | string | No | — |
payload full type
payload full type
untrash
messages.untrash
Restore a message from the trash
Risk: write
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
threadId | string | No | — |
labelIds | string[] | No | — |
snippet | string | No | — |
historyId | string | No | — |
internalDate | string | number | date | No | — |
sizeEstimate | number | No | — |
payload | object | No | — |
raw | string | No | — |
payload full type
payload full type
Threads
delete
threads.delete
Permanently delete a thread [DESTRUCTIVE · IRREVERSIBLE]
Risk: destructive · Irreversible
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
void
get
threads.get
Get a specific thread
Risk: read
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
format | minimal | full | metadata | No | — |
metadataHeaders | string[] | No | — |
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
snippet | string | No | — |
historyId | string | No | — |
messages | object[] | No | — |
messages full type
messages full type
list
threads.list
List threads in the mailbox
Risk: read
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
q | string | No | — |
maxResults | number | No | — |
pageToken | string | No | — |
labelIds | string[] | No | — |
includeSpamTrash | boolean | No | — |
| Name | Type | Required | Description |
|---|---|---|---|
threads | object[] | No | — |
nextPageToken | string | No | — |
resultSizeEstimate | number | No | — |
threads full type
threads full type
modify
threads.modify
Add or remove labels from a thread
Risk: write
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
addLabelIds | string[] | No | — |
removeLabelIds | string[] | No | — |
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
snippet | string | No | — |
historyId | string | No | — |
messages | object[] | No | — |
messages full type
messages full type
trash
threads.trash
Move a thread to the trash
Risk: write
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
snippet | string | No | — |
historyId | string | No | — |
messages | object[] | No | — |
messages full type
messages full type
untrash
threads.untrash
Restore a thread from the trash
Risk: write
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | No | — |
id | string | Yes | — |
| Name | Type | Required | Description |
|---|---|---|---|
id | string | No | — |
snippet | string | No | — |
historyId | string | No | — |
messages | object[] | No | — |
messages full type
messages full type