# Create A Page

`POST /pages`

Creates a page in the requested folder, or at the Markdawn root when `parentId` is omitted or `null`. You can include initial markdown in the request body.
## Authentication

Use one of the following authentication alternatives:

- **API token** (`bearerToken`) : Send a named API token in the Authorization header. Send it in the `Authorization: Bearer <token>` header.
- **Better Auth browser session** (`browserSession`) : Use the Better Auth session cookie from a signed-in browser session. Send it in the `better-auth.session_token` cookie.
## Token permissions

API tokens must include `pages:write`.
## Request Body

Required.

### `application/json`

```json
{
  "title": "Project notes",
  "markdown": "# Project notes\n\nStart writing here."
}
```
## Responses

### 201

Created page metadata.


### `application/json`

```json
{
  "id": "00000000-0000-0000-0000-000000000000",
  "parentId": "00000000-0000-0000-0000-000000000000",
  "title": "string",
  "icon": "string",
  "cover": {
    "type": "string",
    "value": "string"
  },
  "properties": {},
  "ownerId": "00000000-0000-0000-0000-000000000000",
  "permission": "view",
  "createdAt": "string",
  "updatedAt": "string"
}
```

### 403

The API token is missing a required scope: pages:write.


### `application/json`

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```
