> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/makenotion/notion-sdk-js/llms.txt
> Use this file to discover all available pages before exploring further.

# pages.move

> Move a page to a different parent location

Moves a page to a new parent location. The page can be moved to a different page (making it a child page) or to a different data source (database).

## Method Signature

```typescript theme={null}
notion.pages.move(args: MovePageParameters): Promise<PageObjectResponse | PartialPageObjectResponse>
```

## Parameters

<ParamField path="page_id" type="string" required>
  The ID of the page to move (with or without dashes).
</ParamField>

<ParamField path="parent" type="object" required>
  The new parent location for the page.

  <Expandable title="Parent Types">
    <ParamField path="page_id" type="string">
      The ID of the parent page (with or without dashes). The page will become a child of this page.

      Example: `"195de9221179449fab8075a27c979105"`
    </ParamField>

    <ParamField path="data_source_id" type="string">
      The ID of the parent data source (collection), with or without dashes. The page will be moved into this database.

      Example: `"f336d0bc-b841-465b-8045-024475c079dd"`
    </ParamField>
  </Expandable>
</ParamField>

<ParamField path="auth" type="string">
  Bearer token for authentication. Overrides the client-level authentication.
</ParamField>

## Response

<ResponseField name="object" type="string">
  Always `"page"`
</ResponseField>

<ResponseField name="id" type="string">
  The ID of the moved page
</ResponseField>

<ResponseField name="created_time" type="string">
  ISO 8601 timestamp when the page was created
</ResponseField>

<ResponseField name="last_edited_time" type="string">
  ISO 8601 timestamp when the page was last edited (updated after the move)
</ResponseField>

<ResponseField name="archived" type="boolean">
  Whether the page is archived
</ResponseField>

<ResponseField name="in_trash" type="boolean">
  Whether the page is in trash
</ResponseField>

<ResponseField name="is_locked" type="boolean">
  Whether the page is locked from editing
</ResponseField>

<ResponseField name="url" type="string">
  The URL of the Notion page (may change after move)
</ResponseField>

<ResponseField name="public_url" type="string | null">
  The public URL if published to the web
</ResponseField>

<ResponseField name="parent" type="object">
  Information about the page's new parent location
</ResponseField>

<ResponseField name="properties" type="object">
  Property values of the page
</ResponseField>

<ResponseField name="icon" type="object | null">
  Page icon
</ResponseField>

<ResponseField name="cover" type="object | null">
  Page cover image
</ResponseField>

<ResponseField name="created_by" type="object">
  User who created the page
</ResponseField>

<ResponseField name="last_edited_by" type="object">
  User who last edited the page
</ResponseField>

## Examples

### Move Page to Another Page

Move a page to become a child of another page:

```typescript theme={null}
const page = await notion.pages.move({
  page_id: "897e5a76-ae52-4b48-9fdf-e71f5945d1af",
  parent: {
    page_id: "b55c9c91-384d-452b-81db-d1ef79372b75",
  },
})

console.log("Page moved successfully")
console.log("New parent:", page.parent)
```

### Move Page to a Data Source

Move a page into a database (data source):

```typescript theme={null}
const page = await notion.pages.move({
  page_id: "897e5a76-ae52-4b48-9fdf-e71f5945d1af",
  parent: {
    data_source_id: "f336d0bc-b841-465b-8045-024475c079dd",
  },
})

console.log("Page moved to data source")
```

### Move with Type Guard

```typescript theme={null}
import { isFullPage } from "@notionhq/client"

const response = await notion.pages.move({
  page_id: "897e5a76-ae52-4b48-9fdf-e71f5945d1af",
  parent: {
    page_id: "b55c9c91-384d-452b-81db-d1ef79372b75",
  },
})

if (isFullPage(response)) {
  console.log("New URL:", response.url)
  console.log("Parent type:", response.parent.type)
  
  if (response.parent.type === "page_id") {
    console.log("Parent page ID:", response.parent.page_id)
  } else if (response.parent.type === "data_source_id") {
    console.log("Parent data source:", response.parent.data_source_id)
  }
}
```

### Organize Pages into Sections

```typescript theme={null}
// Move multiple pages under a section page
const sectionPageId = "b55c9c91-384d-452b-81db-d1ef79372b75"

const pageIdsToMove = [
  "897e5a76-ae52-4b48-9fdf-e71f5945d1af",
  "c66d0c02-495e-563c-92ec-e80f8496c186",
  "d77e1d13-506f-674d-03fd-f91f9507d297",
]

for (const pageId of pageIdsToMove) {
  await notion.pages.move({
    page_id: pageId,
    parent: {
      page_id: sectionPageId,
    },
  })
  console.log(`Moved page ${pageId} to section`)
}
```

### Move Page from Database to Page

```typescript theme={null}
// Extract a database item and convert it to a standalone page
const page = await notion.pages.move({
  page_id: "897e5a76-ae52-4b48-9fdf-e71f5945d1af",
  parent: {
    page_id: "b55c9c91-384d-452b-81db-d1ef79372b75",
  },
})

console.log("Converted database item to child page")
```

### Error Handling

```typescript theme={null}
import { APIResponseError, APIErrorCode } from "@notionhq/client"

try {
  const page = await notion.pages.move({
    page_id: "897e5a76-ae52-4b48-9fdf-e71f5945d1af",
    parent: {
      page_id: "invalid-parent-id",
    },
  })
} catch (error) {
  if (APIResponseError.isAPIResponseError(error)) {
    if (error.code === APIErrorCode.ObjectNotFound) {
      console.error("Page or parent not found")
    } else if (error.code === APIErrorCode.ValidationError) {
      console.error("Invalid parent or insufficient permissions")
    } else {
      console.error("API error:", error.message)
    }
  } else {
    console.error("Unexpected error:", error)
  }
}
```

### Conditional Move Based on Property

```typescript theme={null}
import { isFullPage } from "@notionhq/client"

// Retrieve the page first
const page = await notion.pages.retrieve({
  page_id: "897e5a76-ae52-4b48-9fdf-e71f5945d1af",
})

if (isFullPage(page)) {
  const statusProp = page.properties.Status
  
  if (statusProp.type === "select" && statusProp.select?.name === "Done") {
    // Move completed items to archive page
    await notion.pages.move({
      page_id: page.id,
      parent: {
        page_id: "archive-page-id",
      },
    })
    console.log("Moved completed page to archive")
  }
}
```

## Important Notes

<Warning>
  When moving a page from one database to another, ensure the target database has compatible properties. The page will retain its property values, but incompatible properties may be lost.
</Warning>

<Note>
  Moving a page updates its `last_edited_time` and `last_edited_by` fields. The page URL may also change after the move.
</Note>

<Tip>
  You need appropriate permissions to move a page. The integration must have access to both the page being moved and the destination parent.
</Tip>

## Use Cases

* **Organize content**: Move pages into different sections or categories
* **Archive completed items**: Move finished tasks to an archive page
* **Restructure hierarchy**: Reorganize your workspace structure
* **Promote database items**: Convert database entries to standalone pages
* **Migrate data**: Move pages between databases

## Related Methods

* [pages.retrieve](/api/pages/retrieve) - Retrieve a page before moving
* [pages.update](/api/pages/update) - Update page properties after moving
* [pages.create](/api/pages/create) - Create a new page in a specific location

## See Also

* [Notion API: Move a page](https://developers.notion.com/reference/post-page-move)
* [Understanding page hierarchy](https://developers.notion.com/docs/working-with-page-content)
