Skip to content
pets

Create a pet

On this page
POST /pets
Production: https://petstore.example.com/v1Sandbox: https://sandbox.petstore.example.com/v1Live demo on docvia.dev; accepts any token: /api/petstore/v1

Lists a new pet for adoption. The pet starts as available.

curl https://petstore.example.com/v1/pets \
  --request POST \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Rex",
  "species": "dog",
  "birthDate": "2023-04-12",
  "tags": [
    "friendly"
  ]
}'
Try it Sent from your browser; this site proxies the spec's own servers. Open in workspace
POST /api/petstore/v1/pets

/api/petstore/v1

Kept in memory for this visit and used on every page of this API; never saved.

Authorization

bearerAuth JWT bearer token in the Authorization header

A token from the dashboard's API keys page.

Request body

required
Body application/json
name string required

Display name.

min length 1max length 64
species string required
One of dog cat bird rabbit
birthDate string<date>
tags array<string>
microchip Microchip | null

Identification, when the pet has one.

Exactly one of

id string required

The 15-digit ISO 11784 number.

pattern ^[0-9]{15}$
vendor string
{
  "name": "Rex",
  "species": "dog",
  "birthDate": "2023-04-12",
  "tags": [
    "friendly"
  ]
}

Responses

The pet was created.

Response application/json
id integer<int64> required read-only
status string required
One of available pending adopted archived
createdAt string<date-time> required read-only
name string required

Display name.

min length 1max length 64
species string required
One of dog cat bird rabbit
birthDate string<date>
tags array<string>
microchip Microchip | null

Identification, when the pet has one.

Exactly one of

id string required

The 15-digit ISO 11784 number.

pattern ^[0-9]{15}$
vendor string
Example
{
  "id": 1042,
  "status": "available",
  "createdAt": "2024-01-01T12:00:00Z",
  "name": "Rex",
  "species": "dog",
  "birthDate": "2024-01-01",
  "tags": [
    "string"
  ],
  "microchip": {
    "id": "string",
    "vendor": "string"
  }
}