Petstore API
The canonical Swagger Petstore spec rendered as a second API alongside the Mock API. Demonstrates multi-API support — each spec gets its own sidebar, search index, and URL prefix.
Pick any operation from the sidebar and hit Try-It — requests go to petstore3.swagger.io, CORS is open.
pet
POST/pet
Add a new pet to the store
Add a new pet to the store.
ReturnsPet
AcceptsPet
Response examples
200Successful operation
{
"name": "doggie",
"photoUrls": [
"string"
]
}PUT/pet
Update an existing pet
Update an existing pet by Id.
ReturnsPet
AcceptsPet
Response examples
200Successful operation
{
"name": "doggie",
"photoUrls": [
"string"
]
}GET/pet/{petId}
Find pet by ID
Returns a single pet.
Parameters 1
| Name | Type | Description |
|---|---|---|
petIdrequired | path · integer | ID of pet to return |
ReturnsPet
Response examples
200successful operation
{
"name": "doggie",
"photoUrls": [
"string"
]
}POST/pet/{petId}
Updates a pet in the store with form data
Updates a pet resource based on the form data.
Parameters 3
| Name | Type | Description |
|---|---|---|
petIdrequired | path · integer | ID of pet that needs to be updated |
name | query · string | Name of pet that needs to be updated |
status | query · string | Status of pet that needs to be updated |
ReturnsPet
Response examples
200successful operation
{
"name": "doggie",
"photoUrls": [
"string"
]
}DELETE/pet/{petId}
Deletes a pet
Delete a pet.
Parameters 2
| Name | Type | Description |
|---|---|---|
api_key | header · string | |
petIdrequired | path · integer | Pet id to delete |
POST/pet/{petId}/uploadImage
Uploads an image
Upload image of the pet.
Parameters 2
| Name | Type | Description |
|---|---|---|
petIdrequired | path · integer | ID of pet to update |
additionalMetadata | query · string | Additional Metadata |
ReturnsApiResponse
Response examples
200successful operation
{
"code": 0,
"type": "string",
"message": "string"
}GET/pet/findByStatus
Finds Pets by status
Multiple status values can be provided with comma separated strings.
Parameters 1
| Name | Type | Description |
|---|---|---|
statusrequired | query · string | Status values that need to be considered for filter |
ReturnsPet
Response examples
200successful operation
[
{
"name": "doggie",
"photoUrls": [
"string"
]
}
]GET/pet/findByTags
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Parameters 1
| Name | Type | Description |
|---|---|---|
tagsrequired | query · array | Tags to filter by |
ReturnsPet
Response examples
200successful operation
[
{
"name": "doggie",
"photoUrls": [
"string"
]
}
]store
GET/store/inventory
Returns pet inventories by status
Returns a map of status codes to quantities.
Response examples
200successful operation
{}POST/store/order
Place an order for a pet
Place a new order in the store.
ReturnsOrder
AcceptsOrder
Response examples
200successful operation
{
"id": 10,
"petId": 198772,
"quantity": 7,
"shipDate": "2024-01-15T09:30:00Z"
}GET/store/order/{orderId}
Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
Parameters 1
| Name | Type | Description |
|---|---|---|
orderIdrequired | path · integer | ID of order that needs to be fetched |
ReturnsOrder
Response examples
200successful operation
{
"id": 10,
"petId": 198772,
"quantity": 7,
"shipDate": "2024-01-15T09:30:00Z"
}DELETE/store/order/{orderId}
Delete purchase order by identifier
For valid response try integer IDs with value < 1000. Anything above 1000 or non-integers will generate API errors.
Parameters 1
| Name | Type | Description |
|---|---|---|
orderIdrequired | path · integer | ID of the order that needs to be deleted |
user
POST/user
Create user
This can only be done by the logged in user.
ReturnsUser
AcceptsUser
Response examples
200successful operation
{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James"
}GET/user/{username}
Get user by user name
Get user detail based on username.
Parameters 1
| Name | Type | Description |
|---|---|---|
usernamerequired | path · string | The name that needs to be fetched. Use user1 for testing |
ReturnsUser
Response examples
200successful operation
{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James"
}PUT/user/{username}
Update user resource
This can only be done by the logged in user.
Parameters 1
| Name | Type | Description |
|---|---|---|
usernamerequired | path · string | name that need to be deleted |
AcceptsUser
DELETE/user/{username}
Delete user resource
This can only be done by the logged in user.
Parameters 1
| Name | Type | Description |
|---|---|---|
usernamerequired | path · string | The name that needs to be deleted |
POST/user/createWithList
Creates list of users with given input array
Creates list of users with given input array.
ReturnsUser
AcceptsUser
Response examples
200Successful operation
{
"id": 10,
"username": "theUser",
"firstName": "John",
"lastName": "James"
}GET/user/login
Logs user into the system
Log into the system.
Parameters 2
| Name | Type | Description |
|---|---|---|
username | query · string | The user name for login |
password | query · string | The password for login in clear text |
Response examples
200successful operation
"string"GET/user/logout
Logs out current logged in user session
Log user out of the system.