Quickstart
Try the API playground operations using curl. The examples cover the full range of HTTP methods available in the playground — GET, POST, PUT, and DELETE — all without authentication.
Prerequisites
- curl, Postman, or the API playground
- No API key for these demo calls
OpenAPI description
Download petstore-playground.json — OpenAPI 3.0.3 description of all playground operations.
1. Find pets by status (GET)
curl "https://petstore3.swagger.io/api/v3/pet/findByStatus?status=available"
2. Add a pet (POST)
curl -X POST "https://petstore3.swagger.io/api/v3/pet" \
-H "Content-Type: application/json" \
-d '{"name": "Rex", "photoUrls": ["https://example.com/rex.jpg"], "status": "available"}'
The response includes a server-assigned id. Use it in the next two steps.
3. Update a pet (PUT)
curl -X PUT "https://petstore3.swagger.io/api/v3/pet" \
-H "Content-Type: application/json" \
-d '{"id": 1, "name": "Rex (updated)", "photoUrls": ["https://example.com/rex.jpg"], "status": "pending"}'
4. Delete a pet (DELETE)
curl -X DELETE "https://petstore3.swagger.io/api/v3/pet/1"
5. Log in (GET)
curl "https://petstore3.swagger.io/api/v3/user/login?username=theUser&password=12345"
6. Log out (GET)
curl "https://petstore3.swagger.io/api/v3/user/logout"
Next steps
- Find pets — full reference for
GET /pet/findByStatus - Add a pet — full reference for
POST /pet - Update a pet — full reference for
PUT /pet - Delete a pet — full reference for
DELETE /pet/{petId} - Login and logout — reference for session demo GETs
- Authentication — if you extend beyond the playground
- Error handling — HTTP codes and sample error JSON