---
title: "Get all ancestors of database"
method: GET
path: "/databases/{id}/ancestors"
tags: ["Ancestors"]
---

# Get all ancestors of database

`GET /databases/{id}/ancestors`

Returns all ancestors for a given database 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 database by id](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-database/#api-databases-id-get).

**[Permissions](https://confluence.atlassian.com/x/_AozKw) required**:
Permission to access the Confluence site ('Can use' global permission).
Permission to view the database and its corresponding space

## Path parameters

- `id` integer, required

## Query parameters

- `limit` integer

## Response `200`

Returned if the requested ancestors are returned.

- object
  - `results` Ancestor[]
    - `id` string — ID of the ancestor
    - `type` 'page' | 'whiteboard' | 'database' | 'embed' | 'folder' — The type of ancestor.

## Other responses

- `400` — Returned if an invalid request is provided.
- `401` — Returned if the authentication credentials are incorrect or missing from the request.
- `404` — Returned if the calling user does not have permission to view the specified database or the database was not found.

---

[API](https://skmtc.net/atlassian/apis/the-confluence-cloud-rest-api-v2.md) · [All operations](https://skmtc.net/atlassian/apis/the-confluence-cloud-rest-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlassian/the-confluence-cloud-rest-api-v2/revisions/c4bd1ed570f2/schema)
