Step 1: Get a personal access token
A personal access token (PAT) lets you authenticate API requests as yourself. No connection setup or OAuth flow required.Donโt see the option to create a token?On Business and Enterprise plans, PAT creation is restricted by default. Ask a workspace owner to enable it in Settings & members โ Connections.Learn more about who can create PATs โ
Step 2: Create a page
Make a POST request to the Create a page endpoint with markdown content. The API creates a private page in your workspace, using the# heading as the page title automatically.
markdown field accepts Notion-flavored Markdown โ headings, lists, code blocks, links, and more. The API converts it to Notion blocks for you.
Under the hood: markdown โ blocks
Under the hood: markdown โ blocks
Notion pages are made up of blocks โ headings, paragraphs, lists, and more. When you send The block model gives you precise control over every element โ formatting, colors, toggles, and block types that markdown canโt express. Use
markdown, the API converts it into this block structure automatically.You can also build this structure directly using the children field. Hereโs what the same page looks like expressed as blocks:markdown when you want simplicity, and children when you need that control.See Working with page content to learn more about the block model.Check the result
A successful response returns a page object:Response
- From the response: Copy the
urlvalue and open it in your browser. - From Notion: Look in Private in your sidebar for ๐ Hello from the API.
Getting an error?
Getting an error?
Error responses return a JSON object with a
For the full list of error codes, see Status codes.
code and message:| Error | Fix |
|---|---|
unauthorized | Double-check that your token is correct and hasnโt expired. |
validation_error | Check the request body against the Create a page reference. |
Next steps
Now that youโve made your first request, explore what else you can build โ create databases, query content, manage comments, upload files, and more.API reference
Browse every endpoint, request parameter, and response field.
JavaScript SDK
Official client library for Node.js.