Microsoft Outlook 365
The robomotion outlook365 CLI connects to Microsoft Outlook 365 via the Graph API for email and calendar management. It sends, reads, replies to, and searches emails; manages mail folders; handles attachments; and creates, lists, and manages calendar events.
When to use
- Send emails with recipients, CC/BCC, and attachments
- Read, search, reply to, or delete emails
- Manage mail folders and email organization
- Create, list, and manage calendar events
Prerequisites
robomotionCLI installed- Package installed:
robomotion install outlook365 - Microsoft 365 OAuth2 credentials configured via Robomotion vault
IMPORTANT: Session Mode Required for Multi-Step Operations
Each CLI command runs as a separate process — connection IDs from connect do NOT persist across calls.
You MUST use --session on connect and pass --session-id to all subsequent commands.
Workflow
- Install (once):
robomotion install outlook365 - Connect with session:
robomotion outlook365 outlook_connect --session --output json # → {"outClientId":"<client-id>","session_id":"<session-id>"} - Use the returned
client-idandsession-idin all subsequent commands:robomotion outlook365 outlook_send_email --client-id "<client-id>" --to <email> --subject <subj> --body <body> --session-id "<session-id>" --output json - Disconnect when done:
robomotion outlook365 outlook_disconnect --client-id "<client-id>" --session-id "<session-id>" --output json
Always append --output json to get structured JSON results.
Commands Reference
robomotion outlook365 list_messages --folder --output jsonLists email messages from Outlook 365 mailbox or folderrobomotion outlook365 get_message --message-id --output jsonRetrieves a specific email message by ID from Outlook 365robomotion outlook365 search_messages --folder --search-query --from --output jsonSearches for email messages in Outlook 365 using subject٫ sender٫ or keywordsrobomotion outlook365 send_mail --to --cc --bcc --subject --body --attachments [--body-type] --output jsonSends a new email message via Outlook 365robomotion outlook365 reply_message --message-id --reply --attachments --output jsonReplies to an email message in Outlook 365robomotion outlook365 forward_message --message-id --to --comment --output jsonForwards an email message in Outlook 365robomotion outlook365 delete_message --message-id --output jsonDeletes an email message from Outlook 365robomotion outlook365 move_message --message-id --destination-folder --output jsonMoves an email message to a different folder in Outlook 365robomotion outlook365 get_attachments --message-id --output jsonLists all attachments for an email message without downloading themrobomotion outlook365 save_attachments --message-id --download-folder --output jsonDownloads and saves all attachments from an email message to a folderrobomotion outlook365 list_folders --parent-folder --output jsonLists mail folders in Outlook 365 mailboxrobomotion outlook365 get_folder --folder --output jsonRetrieves a specific mail folder from Outlook 365 by ID or well-known namerobomotion outlook365 list_events --calendar-id --output jsonLists calendar events from Outlook 365robomotion outlook365 get_event --event-id --output jsonRetrieves a specific calendar event from Outlook 365 by IDrobomotion outlook365 create_event --subject --body --start-time --end-time --location --attendees [--body-type] [--importance] --output jsonCreates a new calendar event in Outlook 365robomotion outlook365 update_event --event-id --subject --body --start-time --end-time --location --output jsonUpdates an existing calendar event in Outlook 365robomotion outlook365 delete_event --event-id --output jsonDeletes a calendar event from Outlook 365
Environment
- ROBOMOTION_API_TOKEN (if vault credentials are needed)