Planning & Tasks - Microsoft Graph API
This resource covers task management across Microsoft 365: Planner (team planning), To Do (personal tasks), and OneNote (note taking).
Contents
- Base Endpoints
- Plans
- Buckets (Stages/Categories)
- Planner Tasks
- Task Details
- Planner Task Assignments
- Planner Categories & Priority
- Planner Progress & Dates
- Planner Ordering
- Planner Best Practices
- Task Lists
- To Do Tasks
- To Do Task Properties
- To Do Checklist Items
- To Do Linked Resources
- To Do Filtering & Querying
- To Do Best Practices
- Notebooks
- Sections
- Pages
- OneNote Search
- Page Resources & Preview
- OneNote HTML Elements
- OneNote Common Patterns
- OneNote Permissions Reference
- OneNote Best Practices
- Planner vs To Do vs OneNote
- Combined Common Patterns
Base Endpoints
- Planner:
https://graph.microsoft.com/v1.0/planner - To Do:
https://graph.microsoft.com/v1.0/me/todo - OneNote:
https://graph.microsoft.com/v1.0/me/onenote
---
Microsoft Planner - Team Task Management
Planner is for collaborative team-based project planning backed by Microsoft 365 Groups.
Plans
Get Plan
GET /planner/plans/{plan-id}
List Group Plans
GET /groups/{group-id}/planner/plans
Create Plan
POST /planner/plans
{
"owner": "{group-id}",
"title": "Project Plan"
}
Required Permissions: Group.ReadWrite.All
Update Plan
PATCH /planner/plans/{plan-id}
{
"title": "Updated Plan Name"
}
Note: Requires If-Match header with etag value
Delete Plan
DELETE /planner/plans/{plan-id}
---
Buckets (Stages/Categories)
List Plan Buckets
GET /planner/plans/{plan-id}/buckets
Get Bucket
GET /planner/buckets/{bucket-id}
Create Bucket
POST /planner/buckets
{
"name": "To Do",
"planId": "{plan-id}",
"orderHint": " !"
}
Update Bucket
PATCH /planner/buckets/{bucket-id}
{
"name": "In Progress"
}
Delete Bucket
DELETE /planner/buckets/{bucket-id}
---
Planner Tasks
List Plan Tasks
GET /planner/plans/{plan-id}/tasks
List Bucket Tasks
GET /planner/buckets/{bucket-id}/tasks
Get User Tasks
GET /me/planner/tasks
GET /users/{user-id}/planner/tasks
Get Task
GET /planner/tasks/{task-id}
Create Task
POST /planner/tasks
{
"planId": "{plan-id}",
"bucketId": "{bucket-id}",
"title": "Implement new feature",
"assignments": {
"{user-id}": {
"@odata.type": "#microsoft.graph.plannerAssignment",
"orderHint": " !"
}
},
"dueDateTime": "2024-01-31T00:00:00Z"
}
Update Task
PATCH /planner/tasks/{task-id}
{
"title": "Updated task title",
"percentComplete": 50
}
Complete Task
PATCH /planner/tasks/{task-id}
{
"percentComplete": 100
}
Delete Task
DELETE /planner/tasks/{task-id}
---
Task Details
Get Task Details
GET /planner/tasks/{task-id}/details
Update Task Details
PATCH /planner/tasks/{task-id}/details
{
"description": "Detailed task description",
"checklist": {
"checklist-item-1": {
"@odata.type": "#microsoft.graph.plannerChecklistItem",
"title": "Subtask 1",
"isChecked": false
}
}
}
Task details include:
description- Task description (HTML support)checklist- Subtasks/checklist itemsreferences- Links/attachmentspreviewType- Preview type (automatic, checklist, description)
---
Planner Task Assignments
Assign Task
PATCH /planner/tasks/{task-id}
{
"assignments": {
"{user-id}": {
"@odata.type": "#microsoft.graph.plannerAssignment",
"orderHint": " !"
}
}
}
Unassign Task
PATCH /planner/tasks/{task-id}
{
"assignments": {
"{user-id}": null
}
}
---
Planner Categories & Priority
Update Task Categories (Labels)
PATCH /planner/tasks/{task-id}
{
"appliedCategories": {
"category1": true,
"category2": true
}
}
Available categories: category1 through category25
Configure Category Names
PATCH /planner/plans/{plan-id}/details
{
"categoryDescriptions": {
"category1": "High Priority",
"category2": "Bug",
"category3": "Feature"
}
}
Set Task Priority
PATCH /planner/tasks/{task-id}
{
"priority": 5
}
Priority values: 0-10 (0 = Urgent, 5 = Important, 10 = Low)
---
Planner Progress & Dates
Task Properties
percentComplete- 0, 25, 50, 75, 100startDateTime- Start date/timedueDateTime- Due date/timecompletedDateTime- Completion date/time (read-only)
Get My Incomplete Tasks
GET /me/planner/tasks?$filter=percentComplete lt 100&$orderby=dueDateTime
Move Task to Different Bucket
PATCH /planner/tasks/{task-id}
{
"bucketId": "{new-bucket-id}"
}
---
Planner Ordering
Planner uses orderHint for custom ordering:
PATCH /planner/tasks/{task-id}
{
"orderHint": " !"
}
To place between two items, use hints from both:
{
"orderHint": "{previous-hint} {next-hint}!"
}
---
Planner Best Practices
- Always include If-Match header with etag for updates
- Use group-based plans (Planner requires Microsoft 365 Group)
- Order tasks using orderHint
- Set due dates for better tracking
- Use categories for visual organization
- Add checklist items for subtasks
- Include task descriptions for clarity
- Use priority field for importance
- Assign tasks to specific users
- Track progress with percentComplete
---
Microsoft To Do - Personal Task Management
To Do is for personal task lists (non-collaborative).
Task Lists
List All Task Lists
GET /me/todo/lists
Get Task List
GET /me/todo/lists/{list-id}
Create Task List
POST /me/todo/lists
{
"displayName": "Shopping List"
}
Update Task List
PATCH /me/todo/lists/{list-id}
{
"displayName": "Updated List Name"
}
Delete Task List
DELETE /me/todo/lists/{list-id}
Required Permissions: Tasks.ReadWrite
---
To Do Tasks
List Tasks
GET /me/todo/lists/{list-id}/tasks
GET /me/todo/lists/{list-id}/tasks?$filter=status ne 'completed'
Get Task
GET /me/todo/lists/{list-id}/tasks/{task-id}
Create Task
POST /me/todo/lists/{list-id}/tasks
{
"title": "Buy groceries",
"importance": "high",
"dueDateTime": {
"dateTime": "2024-01-20T00:00:00",
"timeZone": "UTC"
},
"reminderDateTime": {
"dateTime": "2024-01-20T09:00:00",
"timeZone": "UTC"
}
}
Update Task
PATCH /me/todo/lists/{list-id}/tasks/{task-id}
{
"title": "Updated task title",
"status": "inProgress"
}
Complete Task
PATCH /me/todo/lists/{list-id}/tasks/{task-id}
{
"status": "completed",
"completedDateTime": {
"dateTime": "2024-01-15T14:30:00",
"timeZone": "UTC"
}
}
Delete Task
DELETE /me/todo/lists/{list-id}/tasks/{task-id}
---
To Do Task Properties
Core Properties
title- Task title (required)status-notStarted,inProgress,completed,waitingOnOthers,deferredimportance-low,normal,highisReminderOn- Boolean for reminderreminderDateTime- Reminder date/timedueDateTime- Due date/timecompletedDateTime- Completion date/time (read-only)createdDateTime- Creation date/time (read-only)lastModifiedDateTime- Last modified date/time (read-only)
Task Body
PATCH /me/todo/lists/{list-id}/tasks/{task-id}
{
"body": {
"content": "Task description with details",
"contentType": "text"
}
}
contentType: text or html
---
To Do Checklist Items
List Checklist Items
GET /me/todo/lists/{list-id}/tasks/{task-id}/checklistItems
Add Checklist Item
POST /me/todo/lists/{list-id}/tasks/{task-id}/checklistItems
{
"displayName": "Subtask 1",
"isChecked": false
}
Update Checklist Item
PATCH /me/todo/lists/{list-id}/tasks/{task-id}/checklistItems/{item-id}
{
"isChecked": true
}
Delete Checklist Item
DELETE /me/todo/lists/{list-id}/tasks/{task-id}/checklistItems/{item-id}
---
To Do Linked Resources
List Linked Resources
GET /me/todo/lists/{list-id}/tasks/{task-id}/linkedResources
Add Linked Resource
POST /me/todo/lists/{list-id}/tasks/{task-id}/linkedResources
{
"webUrl": "https://contoso.sharepoint.com/document.pdf",
"applicationName": "SharePoint",
"displayName": "Project Document"
}
Linked resources connect tasks to emails, files, or web pages.
Delete Linked Resource
DELETE /me/todo/lists/{list-id}/tasks/{task-id}/linkedResources/{resource-id}
---
To Do Filtering & Querying
Filter by Status
GET /me/todo/lists/{list-id}/tasks?$filter=status eq 'notStarted'
GET /me/todo/lists/{list-id}/tasks?$filter=status ne 'completed'
Filter by Importance
GET /me/todo/lists/{list-id}/tasks?$filter=importance eq 'high'
Filter by Due Date
GET /me/todo/lists/{list-id}/tasks?$filter=dueDateTime/dateTime le '2024-01-31T23:59:59Z'
Order Tasks
GET /me/todo/lists/{list-id}/tasks?$orderby=dueDateTime/dateTime
GET /me/todo/lists/{list-id}/tasks?$orderby=importance desc
Get Today's Tasks
GET /me/todo/lists/{list-id}/tasks?$filter=dueDateTime/dateTime ge '{today-start}' and dueDateTime/dateTime le '{today-end}'
Get Overdue Tasks
GET /me/todo/lists/{list-id}/tasks?$filter=dueDateTime/dateTime lt '{now}' and status ne 'completed'
---
To Do Best Practices
- Use importance to prioritize tasks
- Set reminders for time-sensitive tasks
- Use checklist items for multi-step tasks
- Link resources to provide context
- Filter completed tasks to focus on active work
- Set due dates for better organization
- Use body for detailed descriptions
- Create separate lists for different projects
- Update status as work progresses
- Regular cleanup of completed tasks
---
Microsoft OneNote - Note Taking
OneNote is for creating and organizing digital notes with text, images, and tables.
Notebooks
List Notebooks
GET /me/onenote/notebooks
GET /users/{user-id}/onenote/notebooks
GET /groups/{group-id}/onenote/notebooks
GET /sites/{site-id}/onenote/notebooks
Get Notebook
GET /me/onenote/notebooks/{notebook-id}
Create Notebook
POST /me/onenote/notebooks
{
"displayName": "Project Notes"
}
Required Permissions: Notes.Create, Notes.ReadWrite
---
Sections
List Sections
GET /me/onenote/sections
GET /me/onenote/notebooks/{notebook-id}/sections
Get Section
GET /me/onenote/sections/{section-id}
Create Section
POST /me/onenote/notebooks/{notebook-id}/sections
{
"displayName": "Meeting Notes"
}
Section Groups
List Section Groups
GET /me/onenote/sectionGroups
GET /me/onenote/notebooks/{notebook-id}/sectionGroups
Create Section Group
POST /me/onenote/notebooks/{notebook-id}/sectionGroups
{
"displayName": "Q1 2024"
}
---
Pages
List Pages
GET /me/onenote/pages
GET /me/onenote/sections/{section-id}/pages
Get Page
GET /me/onenote/pages/{page-id}
Get Page Content
GET /me/onenote/pages/{page-id}/content
Returns HTML content of the page.
Create Page
Simple Page
POST /me/onenote/sections/{section-id}/pages
Content-Type: text/html
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Meeting Notes - January 15, 2024</h1>
<p>Attendees: John, Jane, Bob</p>
<ul>
<li>Discussed Q1 goals</li>
<li>Reviewed project timeline</li>
</ul>
</body>
</html>
Page with Image
POST /me/onenote/sections/{section-id}/pages
Content-Type: multipart/form-data; boundary=MyBoundary
--MyBoundary
Content-Disposition: form-data; name="Presentation"
Content-Type: text/html
<!DOCTYPE html>
<html>
<head><title>Page with Image</title></head>
<body>
<h1>Screenshot</h1>
<img src="name:image1" alt="Screenshot" />
</body>
</html>
--MyBoundary
Content-Disposition: form-data; name="image1"
Content-Type: image/png
[Binary image data]
--MyBoundary--
Update Page
PATCH /me/onenote/pages/{page-id}/content
Content-Type: application/json
[
{
"target": "body",
"action": "append",
"content": "<p>New content added to page</p>"
}
]
Actions:
append- Add after targetinsert- Insert before targetreplace- Replace targetdelete- Delete target
Copy Page to Section
POST /me/onenote/pages/{page-id}/copyToSection
{
"id": "{target-section-id}"
}
Returns: Operation location URL
---
OneNote Search
Search Pages
GET /me/onenote/pages?$search=meeting notes
---
Page Resources & Preview
Get Page Preview
GET /me/onenote/pages/{page-id}/preview
Returns text preview of page content.
List Page Resources
GET /me/onenote/pages/{page-id}/resources
Resources are embedded images and files.
Get Resource
GET /me/onenote/resources/{resource-id}
GET /me/onenote/resources/{resource-id}/content
---
OneNote HTML Elements
OneNote pages support subset of HTML:
Supported elements:
<h1>through<h6>- Headings<p>- Paragraphs<ul>,<ol>,<li>- Lists<table>,<tr>,<td>- Tables<img>- Images<a>- Links<b>,<i>,<u>- Text formatting<br>- Line breaks
Special attributes:
data-tag- Tags (to-do, important, question, etc.)data-id- Element IDs for updates
Example with Tags
<p data-tag="to-do">Complete project proposal</p>
<p data-tag="important">Review budget before meeting</p>
<p data-tag="question">Who is leading the presentation?</p>
---
OneNote Common Patterns
Create Notebook with Sections and Pages
# 1. Create notebook
POST /me/onenote/notebooks
{
"displayName": "Project Notebook"
}
# 2. Create section
POST /me/onenote/notebooks/{notebook-id}/sections
{
"displayName": "Meeting Notes"
}
# 3. Create pages
POST /me/onenote/sections/{section-id}/pages
Content-Type: text/html
<!DOCTYPE html>
<html>
<head><title>First Meeting</title></head>
<body>
<h1>Kickoff Meeting</h1>
<p>Notes here...</p>
</body>
</html>
Create To-Do List
POST /me/onenote/sections/{section-id}/pages
Content-Type: text/html
<!DOCTYPE html>
<html>
<head><title>Task List</title></head>
<body>
<h1>Weekly Tasks</h1>
<p data-tag="to-do">Complete documentation</p>
<p data-tag="to-do">Review pull requests</p>
<p data-tag="to-do">Team standup meeting</p>
</body>
</html>
Append Content to Existing Page
PATCH /me/onenote/pages/{page-id}/content
[
{
"target": "body",
"action": "append",
"content": "<h2>Follow-up Items</h2><ul><li>Item 1</li><li>Item 2</li></ul>"
}
]
Create Page with Table
POST /me/onenote/sections/{section-id}/pages
Content-Type: text/html
<!DOCTYPE html>
<html>
<head><title>Project Status</title></head>
<body>
<h1>Project Status Report</h1>
<table>
<tr><th>Task</th><th>Owner</th><th>Status</th></tr>
<tr><td>Backend API</td><td>John</td><td>In Progress</td></tr>
<tr><td>Frontend UI</td><td>Jane</td><td>Complete</td></tr>
</table>
</body>
</html>
---
OneNote Permissions Reference
Delegated Permissions
Notes.Read- Read user's OneNote notebooksNotes.ReadWrite- Read and write user's notebooksNotes.Create- Create user's notebooksNotes.Read.All- Read all OneNote notebooks user can accessNotes.ReadWrite.All- Read and write all notebooks user can access
Application Permissions
Notes.Read.All- Read all OneNote notebooksNotes.ReadWrite.All- Read and write all notebooks
---
OneNote Best Practices
- Use semantic HTML - h1, h2, p, etc.
- Include page titles in HTML head
- Use data-tag for task tracking
- Organize with sections and section groups
- Make content searchable - use descriptive text
- Use multipart for media - multipart/form-data for images
- Handle async operations - page creation returns 201
- Reference embedded resources by name
- Update incrementally - use PATCH for appending
- Preview content - use preview endpoint
---
Planner vs To Do vs OneNote
| Feature | Planner | To Do | OneNote |
|---|---|---|---|
| Scope | Team planning | Personal tasks | Note taking |
| Collaboration | Full team | Individual only | Shared notebooks |
| Backed by | Microsoft 365 Group | User account | OneDrive/SharePoint |
| Best for | Projects | Personal lists | Documentation |
| Permissions Reference | Required permissions for group-based operations | Delegated permissions | Basic delegated permissions |
---
Combined Common Patterns
Team Project Workflow
# 1. Create team plan (Planner)
POST /planner/plans
{...}
# 2. Create reference notebook (OneNote)
POST /me/onenote/notebooks
{...}
# 3. Create personal to-do (To Do)
POST /me/todo/lists
{...}
Track Task with Notes and Links
# 1. Create Planner task
POST /planner/tasks
{...}
# 2. Create OneNote page for details
POST /me/onenote/sections/{section-id}/pages
{...}
# 3. Link To Do task
POST /me/todo/lists/{list-id}/tasks/{task-id}/linkedResources
{...}