---
title: "Get Document Tree"
url: "https://nov18-dev.movespot.fyi/apis/internal-documenthub-developer-api-0/versions/e30c6169-1eab-485d-8526-f80b29f34b35/operations/getDocumentTree"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/internal-documenthub-developer-api-0/versions/e30c6169-1eab-485d-8526-f80b29f34b35.md

# Get Document Tree

`GET` `/{resourceKind}/{resourceId}/documents/tree`

Operation ID: `getDocumentTree`

get the document tree

## Path parameters

- `resourceKind` (string, required) - Kind of the Konnect resource
- `resourceId` (string, uuid, required) - Id of the Konnect resource

## Responses

- `200` - Tree of documents
- `404` - Not Found

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Internal DocumentHub Developer Api
  version: 0.0.1
servers:
  - url: http://documenthub.documenthub.svc.cluster.local:4400/developer/v0
    description: Konnect cluster
paths:
  /{resourceKind}/{resourceId}/documents/tree:
    get:
      operationId: getDocumentTree
      summary: Get Document Tree
      description: get the document tree
      parameters:
        - $ref: "#/components/parameters/resourceKindParam"
        - $ref: "#/components/parameters/resourceId"
      responses:
        "200":
          description: Tree of documents
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/DocumentTree"
        "404":
          $ref: "#/components/responses/NotFound"
      tags:
        - Customization
security:
  - bearerAuth: []
components:
  parameters:
    resourceKindParam:
      name: resourceKind
      in: path
      required: true
      description: Kind of the Konnect resource
      example: services
      schema:
        type: string
        enum:
          - services
    resourceId:
      name: resourceId
      in: path
      required: true
      description: Id of the Konnect resource
      example: bf138ba2-c9b1-4229-b268-04d9d8a6410b
      schema:
        type: string
        format: uuid
  schemas:
    DocumentTree:
      description: a document tree
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: d32d905a-ed33-46a3-a093-d8f536af9a8a
        parent_document_id:
          type: string
          format: uuid
          example: dd4e1b98-3629-4dd3-acc0-759a726ffee2
          nullable: true
        title:
          description: the title of the document
          type: string
          example: Getting Started
        slug:
          description: the slug of the document
          type: string
          example: getting-started
        meta:
          description: the metadata of the document
          type: object
          example:
            author: Jane Doe
            description: This is a description
            keywords: hello, world
        children:
          type: array
          items:
            $ref: "#/components/schemas/DocumentTree"
      required:
        - id
        - title
        - slug
        - meta
        - children
      title: DocumentTree
    NotFoundError:
      allOf:
        - $ref: "#/components/schemas/BaseError"
        - type: object
          properties:
            status:
              example: 404
            title:
              example: Not Found
            type:
              example: https://httpstatuses.com/404
            instance:
              example: kong:trace:1234567890
            detail:
              example: Not found
    BaseError:
      description: standard error
      type: object
      properties:
        status:
          description: >
            The HTTP status code of the error. Useful when passing the response

            body to child properties in a frontend UI. Must be returned as an
            integer.
          type: integer
          readOnly: true
        title:
          description: |
            A short, human-readable summary of the problem. It should not
            change between occurences of a problem, except for localization.
            Should be provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
        type:
          description: The error type.
          type: string
          readOnly: true
        instance:
          description: |
            Used to return the correlation ID back to the user, in the format
            kong:trace:<correlation_id>. This helps us find the relevant logs
            when a customer reports an issue.
          type: string
          readOnly: true
        detail:
          description: >
            A human readable explanation specific to this occurence of the
            problem.

            This field may contain request/entity data to help the user
            understand

            what went wrong. Enclose variable values in square brackets. Should
            be

            provided as "Sentence case" for direct use in the UI.
          type: string
          readOnly: true
      required:
        - status
        - title
        - instance
        - detail
      title: Error
  responses:
    NotFound:
      description: Not Found
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/NotFoundError"
          examples:
            NotFoundExample:
              $ref: "#/components/examples/NotFoundExample"
  examples:
    NotFoundExample:
      value:
        status: 404
        title: Not Found
        instance: kong:trace:6816496025408232265
        detail: Not Found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
```
