NAiOS IconNAiOS Logo
Volver al catálogo

Gmail

gmail

Gmail is Google’s email service, featuring spam protection, search functions, and seamless integration with other G Suite apps for productivity

Acciones
23
Triggers
2
Autenticación
OAuth gestionado
Información técnica: el detalle de parámetros, schemas y triggers de esta página está pensado para equipos de integración. Si solo necesitas saber si tu herramienta favorita está disponible, basta con ver la lista de acciones.

Acciones disponibles (23)

Cada acción es una operación que el agente puede ejecutar contra este conector. Haz clic en una acción para ver sus parámetros.

Modify email labelsGMAIL_ADD_LABEL_TO_EMAILAcción

Adds and/or removes specified gmail labels for a message; ensure `message id` and all `label ids` are valid (use 'listlabels' for custom label ids).

Parámetros de entrada

  • user_idstring

    User's email address or 'me' for the authenticated user.

  • message_idstringObligatorio

    Immutable ID of the message to modify (e.g., from 'fetchEmails' or 'fetchMessagesByThreadId').

  • add_label_idsstring[]

    Label IDs to add. For custom labels, obtain IDs via 'listLabels'. System labels (e.g., 'INBOX', 'SPAM') can also be used.

  • remove_label_idsstring[]

    Label IDs to remove. For custom labels, obtain IDs via 'listLabels'. System labels can also be used.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Create email draftGMAIL_CREATE_EMAIL_DRAFTAcción

Creates a gmail email draft, supporting to/cc/bcc, subject, plain/html body (ensure `is html=true` for html), attachments, and threading.

Parámetros de entrada

  • ccstring[]

    'Cc' (carbon copy) recipient email addresses.

  • bccstring[]

    'Bcc' (blind carbon copy) recipient email addresses.

  • bodystringObligatorio

    Email body content (plain text or HTML); `is_html` must be True if HTML.

  • is_htmlboolean

    Set to True if `body` is HTML, otherwise the action may fail.

  • subjectstringObligatorio

    Email subject line.

  • user_idstring

    User's email address or 'me' for the authenticated user.

  • thread_idstring

    ID of an existing Gmail thread to reply to; omit for new thread.

  • attachmentobject

    File to attach to the email.

  • recipient_emailstringObligatorio

    Primary recipient's email address.

  • extra_recipientsstring[]

    Additional 'To' recipient email addresses.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Create labelGMAIL_CREATE_LABELAcción

Creates a new label with a unique name in the specified user's gmail account.

Parámetros de entrada

  • user_idstring

    The email address of the user in whose account the label will be created.

  • label_namestringObligatorio

    The name for the new label. Must be unique within the account, non-blank, maximum length 225 characters, cannot contain ',' or '/', not only whitespace, and must not be a reserved system label (e.g., INBOX, DRAFTS, SENT).

  • text_colorstring

    The text color of the label, in hex (e.g., "#000000").

  • background_colorstring

    The background color of the label, in hex (e.g., "#FFFFFF").

  • label_list_visibilitystring

    Controls how the label is displayed in the label list in the Gmail sidebar.

  • message_list_visibilitystring

    Controls how messages with this label are displayed in the message list.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Delete DraftGMAIL_DELETE_DRAFTAcción

Permanently deletes a specific gmail draft using its id; ensure the draft exists and the user has necessary permissions for the given `user id`.

Parámetros de entrada

  • user_idstring

    User's email address or 'me' for the authenticated user; 'me' is recommended.

  • draft_idstringObligatorio

    Immutable ID of the draft to delete, typically obtained when the draft was created.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Delete messageGMAIL_DELETE_MESSAGEAcción

Permanently deletes a specific email message by its id from a gmail mailbox; for `user id`, use 'me' for the authenticated user or an email address to which the authenticated user has delegated access.

Parámetros de entrada

  • user_idstring

    User's email address. The special value 'me' refers to the authenticated user.

  • message_idstringObligatorio

    Identifier of the email message to delete.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Fetch emailsGMAIL_FETCH_EMAILSAcción

Fetches a list of email messages from a gmail account, supporting filtering, pagination, and optional full content retrieval.

Parámetros de entrada

  • querystring

    Gmail advanced search query (e.g., 'from:user subject:meeting'). Supports operators like 'from:', 'to:', 'subject:', 'label:', 'has:attachment', 'is:unread', 'after:YYYY/MM/DD', 'before:YYYY/MM/DD', AND/OR/NOT. Use quotes for exact phrases. Omit for no query filter.

  • user_idstring

    User's email address or 'me' for the authenticated user.

  • verboseboolean

    If false, uses optimized concurrent metadata fetching for faster performance (~75% improvement). If true, uses standard detailed message fetching. When false, only essential fields (subject, sender, recipient, time, labels) are guaranteed.

  • ids_onlyboolean

    If true, only returns message IDs from the list API without fetching individual message details. Fastest option for getting just message IDs and thread IDs.

  • label_idsstring[]

    Filter by label IDs; only messages with all specified labels are returned. Common IDs: 'INBOX', 'SPAM', 'TRASH', 'UNREAD', 'STARRED', 'IMPORTANT', 'CATEGORY_PRIMARY' (alias 'CATEGORY_PERSONAL'), 'CATEGORY_SOCIAL', 'CATEGORY_PROMOTIONS', 'CATEGORY_UPDATES', 'CATEGORY_FORUMS'. Use 'listLabels' action for custom IDs.

  • page_tokenstring

    Token for retrieving a specific page, obtained from a previous response's `nextPageToken`. Omit for the first page.

  • max_resultsinteger

    Maximum number of messages to retrieve per page.

  • include_payloadboolean

    Set to true to include full message payload (headers, body, attachments); false for metadata only.

  • include_spam_trashboolean

    Set to true to include messages from 'SPAM' and 'TRASH'.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Fetch message by message IDGMAIL_FETCH_MESSAGE_BY_MESSAGE_IDAcción

Fetches a specific email message by its id, provided the `message id` exists and is accessible to the authenticated `user id`.

Parámetros de entrada

  • formatstring

    Format for message content: 'minimal' (ID/labels), 'full' (complete data), 'raw' (base64url string), 'metadata' (ID/labels/headers).

  • user_idstring

    User's email address or 'me' for the authenticated user.

  • message_idstringObligatorio

    Unique ID of the email message to retrieve, obtainable from actions like 'List Messages'.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Fetch Message by Thread IDGMAIL_FETCH_MESSAGE_BY_THREAD_IDAcción

Retrieves messages from a gmail thread using its `thread id`, where the thread must be accessible by the specified `user id`.

Parámetros de entrada

  • user_idstring

    The email address of the user.

  • thread_idstringObligatorio

    Unique ID of the thread, obtainable from actions like 'listThreads' or 'fetchEmails'.

  • page_tokenstring

    Opaque page token for fetching a specific page of messages if results are paginated.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Get Gmail attachmentGMAIL_GET_ATTACHMENTAcción

Retrieves a specific attachment by id from a message in a user's gmail mailbox, requiring valid message and attachment ids.

Parámetros de entrada

  • user_idstring

    User's email address ('me' for authenticated user).

  • file_namestringObligatorio

    Desired filename for the downloaded attachment.

  • message_idstringObligatorio

    Immutable ID of the message containing the attachment.

  • attachment_idstringObligatorio

    ID of the attachment to retrieve.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Get contactsGMAIL_GET_CONTACTSAcción

Fetches contacts (connections) for the authenticated google account, allowing selection of specific data fields and pagination.

Parámetros de entrada

  • page_tokenstring

    Token to retrieve a specific page of results, obtained from 'nextPageToken' in a previous response.

  • person_fieldsstring

    Comma-separated person fields to retrieve for each contact (e.g., 'names,emailAddresses').

  • resource_namestring

    Identifier for the person resource whose connections are listed; use 'people/me' for the authenticated user.

  • include_other_contactsboolean

    Include 'Other Contacts' (interacted with but not explicitly saved) in addition to regular contacts; if true, fetches from both endpoints and merges results.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Get PeopleGMAIL_GET_PEOPLEAcción

Retrieves either a specific person's details (using `resource name`) or lists 'other contacts' (if `other contacts` is true), with `person fields` specifying the data to return.

Parámetros de entrada

  • page_sizeinteger

    The number of 'Other Contacts' to return per page. Applicable only when `other_contacts` is true.

  • page_tokenstring

    An opaque token from a previous response to retrieve the next page of 'Other Contacts' results. Applicable only when `other_contacts` is true and paginating.

  • sync_tokenstring

    A token from a previous 'Other Contacts' list call to retrieve only changes since the last sync; leave empty for an initial full sync. Applicable only when `other_contacts` is true.

  • person_fieldsstring

    A comma-separated field mask to restrict which fields on the person (or persons) are returned. Consult the Google People API documentation for a comprehensive list of valid fields.

  • resource_namestring

    Resource name identifying the person for whom to retrieve information (like the authenticated user or a specific contact). Used only when `other_contacts` is false.

  • other_contactsboolean

    If true, retrieves 'Other Contacts' (people interacted with but not explicitly saved), ignoring `resource_name` and enabling pagination/sync. If false, retrieves information for the single person specified by `resource_name`.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Get ProfileGMAIL_GET_PROFILEAcción

Retrieves key gmail profile information (email address, message/thread totals, history id) for a user.

Parámetros de entrada

  • user_idstring

    The email address of the Gmail user whose profile is to be retrieved, or the special value 'me' to indicate the currently authenticated user.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

List draftsGMAIL_LIST_DRAFTSAcción

Retrieves a paginated list of email drafts from a user's gmail account. use verbose=true to get full draft details including subject, body, sender, and timestamp.

Parámetros de entrada

  • user_idstring

    User's mailbox ID; use 'me' for the authenticated user.

  • verboseboolean

    If true, fetches full draft details including subject, sender, recipient, body, and timestamp. If false, returns only draft IDs (faster).

  • page_tokenstring

    Token from a previous response to retrieve a specific page of drafts.

  • max_resultsinteger

    Maximum number of drafts to return per page.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

List Gmail labelsGMAIL_LIST_LABELSAcción

Retrieves a list of all system and user-created labels for the specified gmail account.

Parámetros de entrada

  • user_idstring

    Identifies the Gmail account (owner's email or 'me' for authenticated user) for which labels will be listed.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

List threadsGMAIL_LIST_THREADSAcción

Retrieves a list of email threads from a gmail account, identified by `user id` (email address or 'me'), supporting filtering and pagination.

Parámetros de entrada

  • querystring

    Filter for threads, using Gmail search query syntax (e.g., 'from:user@example.com is:unread').

  • user_idstring

    The user's email address or 'me' to specify the authenticated Gmail account.

  • verboseboolean

    If false, returns threads with basic fields (id, snippet, historyId). If true, returns threads with complete message details including headers, body, attachments, and metadata for each message in the thread.

  • page_tokenstring

    Token from a previous response to retrieve a specific page of results; omit for the first page.

  • max_resultsinteger

    Maximum number of threads to return.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Modify thread labelsGMAIL_MODIFY_THREAD_LABELSAcción

Adds or removes specified existing label ids from a gmail thread, affecting all its messages; ensure the thread id is valid.

Parámetros de entrada

  • user_idstring

    User's email address or 'me' for the authenticated user.

  • thread_idstringObligatorio

    Immutable ID of the thread to modify.

  • add_label_idsstring[]

    List of label IDs to add to the thread; these labels must exist.

  • remove_label_idsstring[]

    List of label IDs to remove from the thread; these labels must exist.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Move to TrashGMAIL_MOVE_TO_TRASHAcción

Moves an existing, non-deleted email message to the trash for the specified user.

Parámetros de entrada

  • user_idstring

    User's email address or 'me' for the authenticated user.

  • message_idstringObligatorio

    Identifier of the email message to move to trash.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Patch LabelGMAIL_PATCH_LABELAcción

Patches the specified label.

Parámetros de entrada

  • idstringObligatorio

    The ID of the label to update.

  • namestring

    The display name of the label.

  • colorobject

    The color to assign to the label. Color is only available for labels that have their `type` set to `user`.

  • userIdstringObligatorio

    The user's email address. The special value `me` can be used to indicate the authenticated user.

  • labelListVisibilitystring

    The visibility of the label in the label list in the Gmail web interface.

  • messageListVisibilitystring

    The visibility of messages with this label in the message list in the Gmail web interface.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Remove labelGMAIL_REMOVE_LABELAcción

Permanently deletes a specific, existing user-created gmail label by its id for a user; cannot delete system labels.

Parámetros de entrada

  • user_idstring

    User's email address or 'me' for the authenticated user.

  • label_idstringObligatorio

    ID of the user-created label to be permanently deleted; must exist and not be a system label.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Reply to email threadGMAIL_REPLY_TO_THREADAcción

Sends a reply within a specific gmail thread using the original thread's subject, requiring a valid `thread id` and correctly formatted email addresses. supports attachments via the `attachment` parameter with valid `s3key`, `mimetype`, and `name`.

Parámetros de entrada

  • ccstring[]

    CC recipients' email addresses.

  • bccstring[]

    BCC recipients' email addresses (hidden from other recipients).

  • is_htmlboolean

    Indicates if `message_body` is HTML; if True, body must be valid HTML, if False, body should not contain HTML tags.

  • user_idstring

    Identifier for the user sending the reply; 'me' refers to the authenticated user.

  • thread_idstringObligatorio

    Identifier of the Gmail thread for the reply.

  • attachmentobject

    File to attach to the reply. Just Provide file path here

  • message_bodystringObligatorio

    Content of the reply message, either plain text or HTML.

  • recipient_emailstringObligatorio

    Primary recipient's email address.

  • extra_recipientsstring[]

    Additional 'To' recipients' email addresses.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Search PeopleGMAIL_SEARCH_PEOPLEAcción

Searches contacts by matching the query against names, nicknames, emails, phone numbers, and organizations, optionally including 'other contacts'.

Parámetros de entrada

  • querystringObligatorio

    Matches contact names, nicknames, email addresses, phone numbers, and organization fields.

  • pageSizeinteger

    Maximum results to return; values >30 are capped to 30 by the API.

  • person_fieldsstring

    Comma-separated fields to return (e.g., 'names,emailAddresses'); see PersonFields enum. If 'other_contacts' is true, only 'emailAddresses', 'names', 'phoneNumbers' are allowed.

  • other_contactsboolean

    Include 'Other Contacts' (interacted with but not explicitly saved) in search results; if false, searches only primary contacts.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Send DraftGMAIL_SEND_DRAFTAcción

Sends the specified, existing draft to the recipients in the to, cc, and bcc headers.

Parámetros de entrada

  • user_idstring

    The user's email address. The special value `me` can be used to indicate the authenticated user.

  • draft_idstringObligatorio

    The ID of the draft to send.

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Send EmailGMAIL_SEND_EMAILAcción

Sends an email via gmail api using the authenticated user's google profile display name, requiring `is html=true` if the body contains html and valid `s3key`, `mimetype`, `name` for any attachment.

Parámetros de entrada

  • ccstring[]

    Carbon Copy (CC) recipients' email addresses.

  • bccstring[]

    Blind Carbon Copy (BCC) recipients' email addresses.

  • bodystringObligatorio

    Email content (plain text or HTML); if HTML, `is_html` must be `True`.

  • is_htmlboolean

    Set to `True` if the email body contains HTML tags.

  • subjectstring

    Subject line of the email.

  • user_idstring

    User's email address; the literal 'me' refers to the authenticated user.

  • attachmentobject

    File to attach; ensure `s3key`, `mimetype`, and `name` are set if provided. Omit or set to null for no attachment.

  • recipient_emailstringObligatorio

    Primary recipient's email address.

  • extra_recipientsstring[]

    Additional 'To' recipients' email addresses (not Cc or Bcc).

Parámetros de salida

  • dataobjectObligatorio

    Data from the action execution

  • errorstring

    Error if any occurred during the execution of the action

  • successfulbooleanObligatorio

    Whether or not the action execution was successful or not

Triggers (2)

Los triggers son eventos externos que pueden iniciar un flujo en tus agentes (ej: nuevo email, mensaje recibido, registro creado).

Email SentGMAIL_EMAIL_SENT_TRIGGERTrigger

Triggers when a Gmail message is sent by the authenticated user. It polls the 'SENT' label and emits metadata including sender, recipients, subject, timestamp, and thread ID.

Configuración

  • intervalnumber

    Periodic Interval to Check for Updates & Send a Trigger in Minutes

  • querystring

    Optional additional Gmail search query to further filter sent messages. Uses Gmail search syntax (e.g., to:example@domain.com subject:report).

  • userIdstring

    The user's email address or 'me' for the authenticated user.

Payload del evento

  • attachment_listarray

    The list of attachments in the sent message

  • bccstring

    Bcc recipients

  • ccstring

    Cc recipients

  • message_idstring

    Gmail message ID

  • message_textstring

    The text of the sent message

  • message_timestampstring

    Timestamp of the sent message in ISO format

  • payloadobject

    Raw Gmail payload

  • recipientsstring

    Comma-separated list of all recipients (To, Cc, Bcc)

  • senderstring

    Sender email

  • subjectstring

    Email subject

  • thread_idstring

    Gmail thread ID

  • tostring

    To recipients

Instrucciones

This trigger monitors Gmail's Sent Mail folder for newly sent messages by the authenticated user. Optionally provide a search query to further filter sent messages (e.g., to:someone@example.com).

New Gmail Message Received TriggerGMAIL_NEW_GMAIL_MESSAGETrigger

Triggers when a new message is received in Gmail.

Configuración

  • intervalnumber

    Periodic Interval to Check for Updates & Send a Trigger in Minutes

  • labelIdsstring

    Filter messages by a single label ID. Labels identify the status or category of messages. Supported labels include 'INBOX', 'SPAM', 'TRASH', 'UNREAD', 'STARRED', 'IMPORTANT', 'CATEGORY_PERSONAL', 'CATEGORY_SOCIAL', 'CATEGORY_PROMOTIONS', 'CATEGORY_UPDATES', and 'CATEGORY_FORUMS'. For complex label filtering, use the 'query' parameter instead.

  • querystring

    Advanced Gmail search using the same syntax as Gmail's search box. Use 'AND' for messages that match all conditions, 'OR' for any condition. Search by sender (from:email@domain.com), labels (label:inbox), status (is:unread), attachments (has:attachment), dates (after:2023/1/1), and more. If specified, this takes precedence over labelIds.

  • userIdstring

    The user's email address or 'me' for the authenticated user.

Payload del evento

  • attachment_listarray

    The list of attachments in the message

  • idstring

    The raw Gmail message ID

  • label_idsstring[]

    The Gmail label IDs applied to the message

  • message_idstring

    The message ID of the message

  • message_textstring

    The text of the message

  • message_timestampstring

    The timestamp of the message

  • payloadobject

    The payload of the message

  • previewobject

    The preview payload of the message

  • senderstring

    The sender of the message

  • subjectstring

    The subject of the message

  • thread_idstring

    The thread ID of the message

  • tostring

    The recipient of the message

Instrucciones

**Instructions for Setting Up the Trigger:** - Ensure that the Gmail API is enabled for your Google account. - Provide the user ID (usually 'me' for the authenticated user). - Optionally, provide label IDs to filter messages.