View as Markdown
Microsoft Outlook Email icon

Microsoft Outlook Email ACTION

Modify Email

Apply one or more state mutations to an email message: mark read/unread, add/remove categories, move to a folder, or change the flag status. All params except messageId are optional — only the ones you provide are applied. Use Find Email to obtain a message id before modifying. Recipes: Mark read: isRead: true | Mark unread: isRead: false Add category: addCategories: ["Follow Up"] | Remove category: removeCategories: ["Follow Up"] Move to archive: destinationFolderId: "archive" | Move to inbox: destinationFolderId: "inbox" Flag: flagStatus: "flagged" | Unflag: flagStatus: "notFlagged" | Mark complete: flagStatus: "complete" Example: modify-email(messageId="AAMk...", isRead=true) → marks the message as read. Example: modify-email(messageId="AAMk...", addCategories=["Eval-Seinfeld"], destinationFolderId="archive") → adds a category AND moves to archive in a single call. See the documentation
  • Action
  • Writes data
  • OAuth
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Microsoft Outlook Email account once, then configure and run Modify Email from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "microsoft_outlook-modify-email",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    microsoft_outlook: { authProvisionId: "apn_xxxxxxx" },
    messageId: "Message ID",
    isRead: true,
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Modify Email inputs
Property Type Description
messageId Message ID string
The Microsoft Graph message ID. Obtain from Find Email (id field in results).
Required
isRead Is Read boolean
true marks the message as read; false marks it as unread. Omit to leave unchanged.
Optional
addCategories Add Categories string[]
Category names to add to the message, e.g. ["Follow Up", "Important"]. Existing categories are preserved.
Optional
removeCategories Remove Categories string[]
Category names to remove from the message. Existing categories not listed here are preserved.
Optional
destinationFolderId Destination Folder ID string
Move the message to this folder. Use well-known names (inbox, archive, deleteditems, drafts, junkemail, sentitems) or a folder ID. Omit to leave in current folder.
Optional
flagStatus Flag Status string
Set the message flag: flagged (flag it), notFlagged (remove flag), or complete (mark flag as done).
Optional
userId User ID string
The user ID or UPN of a shared mailbox. Omit to use the authenticated user's mailbox.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
microsoft_outlook-modify-email
Version
0.0.6
App
Microsoft Outlook Email
Authentication
OAuth
Read-only
No
Destructive
No
Open world
Yes