---
title: "Get category hierarchy for multiple categories"
method: POST
path: "/api/v1/categories/hierarchy"
tags: ["Categories"]
---

# Get category hierarchy for multiple categories

`POST /api/v1/categories/hierarchy`

Retrieves the parent hierarchy for a set of categories specified by their keys. Returns parent lists for each category, starting from the top-level parent down to the direct parent. Categories that don't exist are ignored.

## Request body

- CategoryKeysForm
  - `keys` string[]

## Response `200`

Category hierarchies retrieved successfully

- HierarchyShortCategoriesResponseView
  - `errors` ErrorEntity[]
    - `errorCode` string
    - `message` string
    - `fieldName` string
  - `entity` HierarchyShortCategory[]
    - `inode` string
    - `name` string
    - `key` string
    - `parentList` ShortCategory[]
      - `name` string
      - `inode` string
      - `key` string
  - `messages` MessageEntity[]
    - `message` string
  - `i18nMessagesMap` object
  - `permissions` string[]
  - `pagination` Pagination
    - `currentPage` integer
    - `perPage` integer
    - `totalEntries` integer

## Other responses

- `400` — Bad request - invalid category keys form
- `401` — Unauthorized - user authentication required

---

[API](https://skmtc.dev/jostens/apis/dotcms-rest-api.md) · [All operations](https://skmtc.dev/jostens/apis/dotcms-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/jostens/dotcms-rest-api/revisions/a088fe9f515c/schema)
