Skip to content

Function: movePage()

ts
function movePage(client, parameters): Promise<{
[key: string]: unknown;
  pageId?: string;
}>;

Defined in: src/v1/api/contentChildrenAndDescendants.ts:24

Move a page to a new location relative to a target page:

  • before - move the page under the same parent as the target, before the target in the list of children
  • after - move the page under the same parent as the target, after the target in the list of children
  • append - move the page to be a child of the target

Caution: This API can move pages to the top level of a space. Top-level pages are difficult to find in the UI because they do not show up in the page tree display. To avoid this, never use before or after positions when the targetId is a top-level page.

Parameters

ParameterTypeDescription
clientClient-
parameters{ pageId: string; position: "after" | "before" | "append"; targetId: string; }-
parameters.pageIdstringThe ID of the page to be moved
parameters.position"after" | "before" | "append"The position to move the page to relative to the target page: - before - move the page under the same parent as the target, before the target in the list of children - after - move the page under the same parent as the target, after the target in the list of children - append - move the page to be a child of the target
parameters.targetIdstringThe ID of the target page for this operation

Returns

Promise&lt;{ [key: string]: unknown; pageId?: string; }>