A fictional dinosaur park: creatures, enclosure capacity, and a breach simulator. Practice CRUD, Bearer auth, nested resources, capacity conflicts (409), pagination and optimistic concurrency.
The Dino Park API runs a park: dinosaurs, the enclosures holding them, and an incident log for when those two facts stop agreeing. Enclosures have capacity and species compatibility rules, so writes are validated against the current state rather than accepted blindly — which makes it a good target for testing business-rule failures rather than schema failures.
Base URL: https://funapi.dev/api/dinopark/v1 · 9 endpoints · OpenAPI 3.1 spec and Postman collection available. New here? Read the getting started guide.
GET https://funapi.dev/api/dinopark/v1/dinosaurs — List dinosaurs (paginated, filter by diet). No token, no signup:
curl -i https://funapi.dev/api/dinopark/v1/dinosaurs
answers 200 OK with:
{
"page": 1,
"pageSize": 4,
"total": 7,
"totalPages": 2,
"data": [
{
"id": 1,
"name": "Rexy",
"species": "Tyrannosaurus rex",
"diet": "carnivore",
"enclosureId": 1,
"dangerLevel": "extreme",
"_v": 1
},
{
"id": 2,
"name": "Blue",
"species": "Velociraptor",
"diet": "carnivore",
"enclosureId": 1,
"dangerLevel": "high",
"_v": 1
},
{
"id": 3,
"name": "Big Eatie",
"species": "Brachiosaurus",
"diet": "herbivore",
"enclosureId": 2,
"dangerLevel": "low",
"_v": 1
},
{
"id": 4,
"name": "Bumpy",
"species": "Ankylosaurus",
"diet": "herbivore",
"enclosureId": 2,
"dangerLevel": "low",
"_v": 1
}
]
}
seven residents, one very hungry rex
GET /dinopark/v1/dinosaurs — List dinosaurs (paginated, filter by diet) · Responds with 200 400 404 Link to this endpointGET /dinopark/v1/dinosaurs/{id} — Get one dinosaur · Responds with 200 404 Link to this endpointGET /dinopark/v1/dinosaurs/{id}/enclosure — Get a dinosaur's enclosure (nested resource) · Responds with 200 404 Link to this endpointPOST /dinopark/v1/dinosaurs — Add a dinosaur (409 if enclosure is at capacity) (requires Bearer auth) · Responds with 201 400 401 409 Link to this endpointPUT /dinopark/v1/dinosaurs/{id} — Update a dinosaur (requires Bearer auth) · Responds with 200 400 401 404 412 Link to this endpointDELETE /dinopark/v1/dinosaurs/{id} — Relocate a dinosaur off-site (requires Bearer auth) · Responds with 204 401 403 404 412 Link to this endpointcapacity matters
GET /dinopark/v1/enclosures — List all enclosures with current occupancy · Responds with 200 Link to this endpointbreach reports, growing list
POST /dinopark/v1/incidents/breach — Simulate a containment breach (random dinosaur & severity) (requires Bearer auth) · Responds with 201 401 Link to this endpointGET /dinopark/v1/incidents — List incident history (empty until you POST a breach) · Responds with 200 Link to this endpointLast updated