Pets

Pets endpoint for Pet Adoption

These endpoints allow you to create, read, update and delete pets.

These endpoints support pagination and sorting. Read more about these features here.

The Pet model

PropTypeDefault
id
string
-
name
string
-
species
string
-
breed
string
-
age
number
-
gender
string
-
size
string
-
color
string
-
description
string
-
adoptionStatus
string
Available
location
string
-
image
object
-
created
Date
-
updated
Date
-
owner
Profile
-

All pets

GET/pets

Retrieve all pets.

Response
{
  "data": [
    {
      "id": "string",
      "name": "string",
      "species": "string",
      "breed": "string",
      "age": 0,
      "gender": "string",
      "size": "string",
      "color": "string",
      "description": "string",
      "adoptionStatus": "string",
      "location": "string",
      "image": {
        "url": "string",
        "alt": "string"
      },
      "created": "2025-01-01T12:00:00.000Z",
      "updated": "2025-01-01T12:00:00.000Z",
      "owner": {
        "name": "string",
        "email": "string",
        "bio": "string",
        "avatar": {
          "url": "string",
          "alt": "string"
        },
        "banner": {
          "url": "string",
          "alt": "string"
        }
      }
    },
    {
      "id": "string",
      "name": "string",
      "species": "string",
      "breed": "string",
      "age": 0,
      "gender": "string",
      "size": "string",
      "color": "string",
      "description": "string",
      "adoptionStatus": "string",
      "location": "string",
      "image": {
        "url": "string",
        "alt": "string"
      },
      "created": "2025-01-01T12:00:00.000Z",
      "updated": "2025-01-01T12:00:00.000Z",
      "owner": {
        "name": "string",
        "email": "string",
        "bio": "string",
        "avatar": {
          "url": "string",
          "alt": "string"
        },
        "banner": {
          "url": "string",
          "alt": "string"
        }
      }
    }
    // ...
  ],
  "meta": {
    "isFirstPage": true,
    "isLastPage": true,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": null,
    "pageCount": 1,
    "totalCount": 2
  }
}

Single pet

GET/pets/<id>

Retrieve a single pet by its id.

Response
{
  "data": {
    "id": "string",
    "name": "string",
    "species": "string",
    "breed": "string",
    "age": 0,
    "gender": "string",
    "size": "string",
    "color": "string",
    "description": "string",
    "adoptionStatus": "string",
    "location": "string",
    "image": {
      "url": "string",
      "alt": "string"
    },
    "created": "2025-01-01T12:00:00.000Z",
    "updated": "2025-01-01T12:00:00.000Z",
    "owner": {
      "name": "string",
      "email": "string",
      "bio": "string",
      "avatar": {
        "url": "string",
        "alt": "string"
      },
      "banner": {
        "url": "string",
        "alt": "string"
      }
    }
  },
  "meta": {}
}

Create pet

POST/pets

Create a new pet.

Please note that the image.url property must be a fully formed URL that links to a live and publicly accessible image. The API will check the provided URL and if it cannot be accessed publicly you will receive a 400 Bad Request error response.

Request
{
  "name": "string",
  "species": "string",
  "breed": "string",
  "age": 0,
  "gender": "string",
  "size": "string",
  "color": "string",
  "description": "string",
  "adoptionStatus": "string", // Optional. Defaults to "Available".
  "location": "string",
  "image": {
    "url": "string",
    "alt": "string"
  }
}
Response
{
  "data": {
    "id": "string",
    "name": "string",
    "species": "string",
    "breed": "string",
    "age": 0,
    "gender": "string",
    "size": "string",
    "color": "string",
    "description": "string",
    "adoptionStatus": "string",
    "location": "string",
    "image": {
      "url": "string",
      "alt": "string"
    },
    "created": "2025-01-01T12:00:00.000Z",
    "updated": "2025-01-01T12:00:00.000Z",
    "owner": {
      "name": "string",
      "email": "string",
      "bio": "string",
      "avatar": {
        "url": "string",
        "alt": "string"
      },
      "banner": {
        "url": "string",
        "alt": "string"
      }
    }
  },
  "meta": {}
}

Update pet

PUT/pets/<id>

Update a pet by its id. This endpoint returns the updated pet.

Please note that the image.url property must be a fully formed URL that links to a live and publicly accessible image. The API will check the provided URL and if it cannot be accessed publicly you will receive a 400 Bad Request error response.

Request
// You can update any amount of the properties of the pet.
{
  "adoptionStatus": "Pending",
  "image": {
    "url": "https://example.com/image.jpg",
    "alt": "string"
  }
}
Response
{
  "data": {
    "id": "string",
    "name": "string",
    "species": "string",
    "breed": "string",
    "age": 0,
    "gender": "string",
    "size": "string",
    "color": "string",
    "description": "string",
    "adoptionStatus": "string",
    "location": "string",
    "image": {
      "url": "string",
      "alt": "string"
    },
    "created": "2025-01-01T12:00:00.000Z",
    "updated": "2025-01-01T12:00:00.000Z",
    "owner": {
      "name": "string",
      "email": "string",
      "bio": "string",
      "avatar": {
        "url": "string",
        "alt": "string"
      },
      "banner": {
        "url": "string",
        "alt": "string"
      }
    }
  },
  "meta": {}
}

Delete pet

DELETE/pets/<id>

Delete a pet by its id.

Returns an empty 204 No Content response on success.

On this page