---
title: "List document ancestors"
method: GET
path: "/api/projects/{projectId}/documents/{documentId}/ancestors"
tags: ["Document"]
---

# List document ancestors

`GET /api/projects/{projectId}/documents/{documentId}/ancestors`

Retrieve the ancestor hierarchy of a document from root to the specified document.

## Path parameters

- `documentId` string, uuid, required
- `projectId` string, uuid, required

## Response `200`

List of ancestor documents from root to current

- object[] — List of ancestor documents from root to current
  - `id` string, uuid, required — Document unique identifier
  - `key` string, required — Document key path
  - `name` string, required — Document name
  - `parentId` string, uuid, nullable — Parent document ID
  - `originalPath` string, nullable — Original path before deletion

---

[API](https://skmtc.dev/gorules/apis/gorules-agent-api.md) · [All operations](https://skmtc.dev/gorules/apis/gorules-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gorules/gorules-agent-api/revisions/52c0773fcd80/schema)
