Add a new pet to the store.
POST/pets
Add a new pet to the store.
Body ParametersJSON
name: string
photoUrls: array of string
id: optional number
formatint64
Returns
Add a new pet to the store.
curl http://localhost:4000/api/v3/pets \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $BARKEND_BEARER_TOKEN" \
-d '{
"name": "doggie",
"photoUrls": [
"string"
],
"id": 10
}'{
"id": 10,
"name": "doggie",
"photoUrls": [
"https://example.com/dog.jpg"
],
"category": {
"id": 1,
"name": "Dogs"
},
"tags": [
{
"id": 1,
"name": "friendly"
}
],
"status": "available"
}{
"error": {
"id": "invalid_input",
"message": "Invalid input - name and photoUrls required"
}
}{
"error": {
"id": "duplicate_name",
"message": "A pet with this name already exists"
}
}Returns Examples
{
"id": 10,
"name": "doggie",
"photoUrls": [
"https://example.com/dog.jpg"
],
"category": {
"id": 1,
"name": "Dogs"
},
"tags": [
{
"id": 1,
"name": "friendly"
}
],
"status": "available"
}{
"error": {
"id": "invalid_input",
"message": "Invalid input - name and photoUrls required"
}
}{
"error": {
"id": "duplicate_name",
"message": "A pet with this name already exists"
}
}