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

# Find a Pet by ID

`GET /pets/{id}`

Finds the Pet with the requested ID and returns it.

## Path parameters

- `id` integer, required

## Response `200`

Pet with requested ID was found

- PetRead
  - `name` string, required
  - `nicknames` string[]
  - `age` integer
  - `owner` PetReadOwner
    - `id` integer, required
    - `name` string, required
    - `age` integer, required

## Other responses

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

## Changes

- **2022-01-03** `be4e7ff3034b` — 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** `7dc1aab674b3` — 1 warning
  - removed the optional property `owner/pets` from the response with the `200` status
- **2021-12-21** `de0ebba2e9d9` — 6 breaking, 1 info
  - the `age` response's property type/format changed from `integer`/`int32` to `integer`/`` for status `200`
  - the `owner/age` response's property type/format changed from `integer`/`int32` to `integer`/`` for status `200`
  - the `owner/id` response's property type/format changed from `integer`/`int32` to `integer`/`` for status `200`
  - the `owner/pets/items/age` response's property type/format changed from `integer`/`int32` to `integer`/`` for status `200`
  - …3 more
- …earlier changes not shown

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

---

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