Edit

Create page

Namespace: microsoft.graph

Create a new page in the specified section.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet
✅ ❌ ❌ ❌

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Notes.Create Notes.ReadWrite, Notes.ReadWrite.All
Delegated (personal Microsoft account) Notes.Create Notes.ReadWrite
Application Notes.ReadWrite.All Not available.

HTTP request

POST /me/onenote/sections/{id}/pages
POST /users/{id | userPrincipalName}/onenote/sections/{id}/pages
POST /groups/{id}/onenote/sections/{id}/pages
POST /sites/{id}/onenote/sections/{id}/pages

Request headers

Name Type Description
Authorization string Bearer {token}. Required. Learn more about authentication and authorization.
Content-Type string text/html or application/xhtml+xml for the HTML content, including for the required "Presentation" part of multipart requests. Multipart requests use the multipart/form-data; boundary=your-boundary content type.

Request body

In the request body, supply the page HTML content.

The body can contain HTML placed directly in the request body, or it can contain a multipart message format as shown in the example. If you're sending binary data, then you must send a multipart request.

Response

If successful, this method returns 201 Created response code and the new page object in the response body.

Example

Request

The following example shows a request.

POST https://graph.microsoft.com/v1.0/me/onenote/sections/{id}/pages
Content-type: multipart/form-data; boundary=MyPartBoundary198374

--MyPartBoundary198374
Content-Disposition:form-data; name="Presentation"
Content-Type:text/html



  
    A page with <i>rendered</i> images and an <b>attached</b> file
    
  
  
    

Here's an image from an online source:

an image on the page

Here's an image uploaded as binary data:

an image on the page

Here's a file attachment:

--MyPartBoundary198374 Content-Disposition:form-data; name="imageBlock1" Content-Type:image/jpeg ... binary image data ... --MyPartBoundary198374 Content-Disposition:form-data; name="fileBlock1" Content-Type:application/pdf ... binary file data ... --MyPartBoundary198374--