Update page

Important: APIs under the /beta version in Microsoft Graph are in preview and are subject to change. Use of these APIs in production applications is not supported.

Update the content of a OneNote page.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Notes.ReadWrite, Notes.ReadWrite.All
Delegated (personal Microsoft account) Notes.ReadWrite
Application Notes.ReadWrite.All

HTTP request

PATCH /me/onenote/pages/{id}/content
PATCH /users/{id | userPrincipalName}/onenote/pages/{id}/content
PATCH /groups/{id}/onenote/pages/{id}/content
PATCH /sites/{id}/onenote/pages/{id}/content

Request headers

Name Type Description
Authorization string Bearer {token}. Required.
Content-Type string application/json

Request body

In the request body, supply an array of patchContentCommand objects that represent the changes to the page. For more information and examples, see Update OneNote page content.

Response

If successful, this method returns a 204 No Content response code. No JSON data is returned for a PATCH request.

Example

Request

Here is an example of the request.

PATCH https://graph.microsoft.com/beta/me/onenote/pages/{id}/content
Content-type: application/json
Content-length: 312

[
   {
    'target':'#para-id',
    'action':'insert',
    'position':'before',
    'content':'<img src="image-url-or-part-name" alt="image-alt-text" />'
  }, 
  {
    'target':'#list-id',
    'action':'append',
    'content':'<li>new-page-content</li>'
  }
]
Response

Here is an example of the response.

HTTP/1.1 204 No Content