---
title: "Get a category by ID or key"
method: GET
path: "/api/v1/categories/{idOrKey}"
tags: ["Categories"]
---

# Get a category by ID or key

`GET /api/v1/categories/{idOrKey}`

Retrieves a single category by either its inode (ID) or its unique key. First attempts to find by inode; if not found, searches by key.

## Path parameters

- `idOrKey` string, required

## Query parameters

- `showChildrenCount` boolean

## Response `200`

Category retrieved successfully

- ResponseEntityCategoryView
  - `errors` ErrorEntity[]
    - `errorCode` string
    - `message` string
    - `fieldName` string
  - `entity` CategoryView
    - `inode` string
    - `parent` string
    - `description` string
    - `keywords` string
    - `key` string
    - `categoryName` string
    - `active` boolean
    - `sortOrder` integer
    - `categoryVelocityVarName` string
    - `modDate` string, date-time
  - `messages` MessageEntity[]
    - `message` string
  - `i18nMessagesMap` object
  - `permissions` string[]
  - `pagination` Pagination
    - `currentPage` integer
    - `perPage` integer
    - `totalEntries` integer

## Other responses

- `400` — Bad request — idOrKey is required
- `401` — Authentication required
- `404` — Category not found

---

[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)
