Skip to content

Function: getPageAncestors()

ts
function getPageAncestors(client, parameters): Promise<{
[key: string]: unknown;
  _links?: {
   [key: string]: unknown;
     base?: string;
     byOperation?: string;
     collection?: string;
     context?: string;
     download?: string;
     editui?: string;
     edituiv2?: string;
     next?: string;
     prev?: string;
     self?: string;
     tinyui?: string;
     webui?: string;
  };
  results?: object[];
}>;

Defined in: src/v2/api/ancestors.ts:134

Returns all ancestors for a given page by ID in top-to-bottom order (that is, the highest ancestor is the first item in the response payload). The number of results is limited by the limit parameter and additional results (if available) will be available by calling this endpoint with the ID of first ancestor in the response payload.

This endpoint returns minimal information about each ancestor. To fetch more details, use a related endpoint, such as Get page by id.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

Parameters

ParameterTypeDescription
clientClient-
parameters{ id: number; limit?: number; }-
parameters.idnumberThe ID of the page.
parameters.limit?numberMaximum number of pages per result to return. If more results exist, call this endpoint with the highest ancestor's ID to fetch the next set of results.

Returns

Promise&lt;{ [key: string]: unknown; _links?: { [key: string]: unknown; base?: string; byOperation?: string; collection?: string; context?: string; download?: string; editui?: string; edituiv2?: string; next?: string; prev?: string; self?: string; tinyui?: string; webui?: string; }; results?: object[]; }>