---
title: "Find a Category by ID"
method: GET
path: "/categories/{id}"
tags: ["Category"]
---

# Find a Category by ID

`GET /categories/{id}`

Finds the Category with the requested ID and returns it.

## Path parameters

- `id` integer, required

## Response `200`

Category with requested ID was found

- Category
  - `id` integer, required
  - `name` string, required
  - `readonly` string, required
  - `pets` Pet[]
    - `id` integer, required
    - `name` string, required
    - `nicknames` string[]
    - `age` integer
    - `categories` Category[]
    - `owner` User
      - `id` integer, required
      - `name` string, required
      - `age` integer, required
      - `pets` Pet[]
    - `friends` Pet[]

## Other responses

- `400` — invalid input, data invalid
- `404` — resource not found
- `409` — conflicting resources
- `500` — unexpected error

## Changes

> 13 revisions in range; 1 could not be searched.

- **2022-03-18** `6078f3637405` — 1 info
  - added the required property `readonly` to the response with the `200` status
- **2022-01-03** `d1d141e66c09` — 3 breaking, 7 info
  - the `code` response's property type/format changed from `integer`/`int32` to `integer`/`` for status `400`
  - the `code` response's property type/format changed from `integer`/`int32` to `integer`/`` for status `404`
  - the `code` response's property type/format changed from `integer`/`int32` to `integer`/`` for status `500`
  - added the non-success response with the status `409`
  - …6 more
- **2021-12-21** `41f59b033280` — 5 breaking, 1 info
  - the `id` response's property type/format changed from `integer`/`int32` to `integer`/`` for status `200`
  - the `pets/items/age` response's property type/format changed from `integer`/`int32` to `integer`/`` for status `200`
  - the `pets/items/id` response's property type/format changed from `integer`/`int32` to `integer`/`` for status `200`
  - the `pets/items/owner/age` response's property type/format changed from `integer`/`int32` to `integer`/`` for status `200`
  - …2 more
- …earlier changes not shown

[Full history](https://skmtc.dev/ent/apis/my-simple-api/changes/categories/:id/get.md)

---

[API](https://skmtc.dev/ent/apis/my-simple-api.md) · [All operations](https://skmtc.dev/ent/apis/my-simple-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ent/my-simple-api/revisions/f1e79a433c8f/schema)
