V2
Move Page
Move a page-level object to a new parent and optionally control its position.
Move Page
Use Case
Use this endpoint to move a normal page, database, mind map, or folder under another page, database, or the workspace root. It moves page-level objects only; use block endpoints for normal content blocks.
Endpoint
| Item | Value |
|---|---|
| Method | PATCH |
| Path | /v2/pages/:page_id/move |
| Request body | Target parent and position |
| Returns | move_result |
| Scope | pages.write |
Permissions
Requires pages.write. The source object and target parent must both be in the current bot workspace, and the bot must have write access to both.
Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page_id |
string | Yes | ID of the page-level object to move. Supports pages, databases, mind maps, and folders. |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
parent |
object | Yes | Target parent. Provide exactly one of workspace, page_id, or database_id. |
after |
string | No | Insert after a direct child of the target parent. Cannot be used with before. |
before |
string | No | Insert before a direct child of the target parent. Cannot be used with after. |
parent supports these forms:
{ "workspace": true }
{ "page_id": "55555555-5555-4555-8555-555555555555" }
{ "database_id": "66666666-6666-4666-8666-666666666666" }
Request Example
{
"parent": {
"page_id": "55555555-5555-4555-8555-555555555555"
},
"after": "12121212-1212-4212-8212-121212121212"
}
Move to workspace root:
{
"parent": {
"workspace": true
},
"before": "34343434-3434-4434-8434-343434343434"
}
Response Example
{
"object": "move_result",
"id": "22222222-2222-4222-8222-222222222222",
"object_type": "page",
"parent": {
"type": "page_id",
"page_id": "55555555-5555-4555-8555-555555555555"
},
"after": "12121212-1212-4212-8212-121212121212",
"before": null
}
object_type can be:
| Value | Description |
|---|---|
page |
Normal page. |
database |
Database or database page. |
mind_map |
Mind map or mind map page. |
folder |
Folder. |
Behavior
- If neither
afternorbeforeis provided, the object moves to the end of the target parent's direct child list. afterorbeforemust reference a direct child of the target parent.- A page-level object cannot be moved under itself or one of its descendants.
parent.database_idmoves the object under a database as a record; this endpoint does not set database properties.- Normal content blocks should still be moved with block endpoints.
Errors
400 validation_error: missingparent, multiple parent targets, bothafterandbefore, position sibling is not a direct child of target parent, or target is self or descendant.401 unauthorized: invalid or expired token.403 forbidden: missingpages.write, no write access to the source object, or no write access to the target parent.404 not_found: source object or target parent does not exist.