Microsoft OneNote 365
The robomotion onenote365 CLI connects to Microsoft OneNote via the Graph API for notebook management. It lists and manages notebooks, section groups, and sections; creates and reads pages with HTML content; and organizes note hierarchies.
When to use
- Create pages with HTML content in OneNote sections
- List notebooks, section groups, and sections
- Read page content and manage notebook structure
Prerequisites
robomotionCLI installed- Package installed:
robomotion install onenote365 - 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 onenote365 - Connect with session:
robomotion onenote365 onenote_connect --session --output json # → {"outClientId":"<client-id>","session_id":"<session-id>"} - Use the returned
client-idandsession-idin all subsequent commands:robomotion onenote365 onenote_list_notebooks --client-id "<client-id>" --session-id "<session-id>" --output json - Disconnect when done:
robomotion onenote365 onenote_disconnect --client-id "<client-id>" --session-id "<session-id>" --output json
Always append --output json to get structured JSON results.
Commands Reference
robomotion onenote365 list_notebooks --output jsonLists all OneNote notebooks for the authenticated userrobomotion onenote365 get_notebook --notebook-id --output jsonGets a specific OneNote notebook by IDrobomotion onenote365 create_notebook --display-name --output jsonCreates a new OneNote notebookrobomotion onenote365 list_sections --notebook-id --output jsonLists all sections in a OneNote notebookrobomotion onenote365 get_section --section-id --output jsonGets a specific OneNote section by IDrobomotion onenote365 create_section --notebook-id --display-name --output jsonCreates a new section in a OneNote notebookrobomotion onenote365 list_section_groups --notebook-id --output jsonLists all section groups in a OneNote notebookrobomotion onenote365 get_section_group --section-group-id --output jsonGets a specific OneNote section group by IDrobomotion onenote365 create_section_group --notebook-id --display-name --output jsonCreates a new section group in a OneNote notebookrobomotion onenote365 list_pages --section-id --output jsonLists all pages in a OneNote sectionrobomotion onenote365 get_page --page-id --output jsonGets a specific OneNote page by ID، optionally including its HTML contentrobomotion onenote365 create_page --section-id --title --html-content --output jsonCreates a new page in a OneNote sectionrobomotion onenote365 update_page --page-id --html-content [--action] --output jsonUpdates the content of a OneNote page by appending or replacing contentrobomotion onenote365 delete_page --page-id --output jsonDeletes a OneNote pagerobomotion onenote365 search_pages --notebook-id --query --output jsonSearches for OneNote pages by title
Environment
- ROBOMOTION_API_TOKEN (if vault credentials are needed)