API Reference
Pet
API endpoints for Pet
Creates a new pet resource in the store.
Request Body
application/jsonidoptionalintegerPet ID (auto-generated on creation)
namerequiredstringPet name
photoUrlsrequiredstringPhoto URL (comma-separated for multiple)
statusoptional”available” | “pending” | “sold”Pet status in the store
Values:
available pending soldResponses
200Pet created
Example Response
{
"id": 10,
"name": "string",
"photoUrls": "string",
"status": "available"
}405Invalid input
Request Example
curl -X POST 'https://petstore.swagger.io/v2/pet' \
-H 'Content-Type: application/json' \
-d '{"id":10,"name":"string","photoUrls":"string","status":"available"}'POST
https://petstore.swagger.io/v2/petcurl -X POST 'https://petstore.swagger.io/v2/pet' \
-H 'Content-Type: application/json' \
-d '{
"id": 10,
"name": "string",
"photoUrls": "string",
"status": "available"
}'Updates a pet in the store with form data.
Request Body
application/jsonidoptionalintegerPet ID (auto-generated on creation)
namerequiredstringPet name
photoUrlsrequiredstringPhoto URL (comma-separated for multiple)
statusoptional”available” | “pending” | “sold”Pet status in the store
Values:
available pending soldResponses
200Pet updated
Example Response
{
"id": 10,
"name": "string",
"photoUrls": "string",
"status": "available"
}400Invalid ID supplied
404Pet not found
405Validation exception
Request Example
curl -X PUT 'https://petstore.swagger.io/v2/pet' \
-H 'Content-Type: application/json' \
-d '{"id":10,"name":"string","photoUrls":"string","status":"available"}'PUT
https://petstore.swagger.io/v2/petcurl -X PUT 'https://petstore.swagger.io/v2/pet' \
-H 'Content-Type: application/json' \
-d '{
"id": 10,
"name": "string",
"photoUrls": "string",
"status": "available"
}'Multiple status values can be provided with comma separated strings.
Parameters
statusrequired”available” | “pending” | “sold”Status values that need to be considered for filter
Values:
available pending soldResponses
200Successful operation
Example Response
[
{
"id": 10,
"name": "string",
"photoUrls": "string",
"status": "available"
}
]400Invalid status value
Request Example
curl -X GET 'https://petstore.swagger.io/v2/pet/findByStatus'GET
https://petstore.swagger.io/v2/pet/findByStatuscurl -X GET 'https://petstore.swagger.io/v2/pet/findByStatus'Multiple tags can be provided with comma separated strings.
Parameters
tagsrequiredstringTags to filter by
Responses
200Successful operation
Example Response
[
{
"id": 10,
"name": "string",
"photoUrls": "string",
"status": "available"
}
]400Invalid tag value
Request Example
curl -X GET 'https://petstore.swagger.io/v2/pet/findByTags'GET
https://petstore.swagger.io/v2/pet/findByTagscurl -X GET 'https://petstore.swagger.io/v2/pet/findByTags'Returns a single pet by its numeric ID.
Parameters
petIdrequiredintegerID of pet to return
Responses
200Successful operation
Example Response
{
"id": 10,
"name": "string",
"photoUrls": "string",
"status": "available"
}400Invalid ID supplied
404Pet not found
Request Example
curl -X GET 'https://petstore.swagger.io/v2/pet/{petId}'GET
https://petstore.swagger.io/v2/pet/{petId}curl -X GET 'https://petstore.swagger.io/v2/pet/{petId}'Deletes a pet by its numeric ID. Optionally pass an api_key header.
Parameters
petIdrequiredintegerPet id to delete
api_keyoptionalstringAPI key for authorization
Responses
200Pet deleted
400Invalid ID supplied
404Pet not found
Request Example
curl -X DELETE 'https://petstore.swagger.io/v2/pet/{petId}'DELETE
https://petstore.swagger.io/v2/pet/{petId}curl -X DELETE 'https://petstore.swagger.io/v2/pet/{petId}'