The Animals and Species resources let you catalog the marine creatures housed at Parque Marino del Pacífico Sur. Each animal belongs to exactly one species, one habitat, and carries a conservation status.
Write operations (POST, PUT, DELETE) require an authenticated admin session. GET endpoints are publicly accessible.
Animals
List animals
Filter by animal name (case-insensitive partial match).
Filter by conservation status ID.
curl --request GET \
--url https://api.parquemarino.org/api/animals/
[
{
"id": 1,
"name": "Tortuga Verde",
"age": 12,
"species": 3,
"conservation_status": 2,
"habitat": 1
},
{
"id": 2,
"name": "Tiburón Ballena",
"age": 7,
"species": 5,
"conservation_status": 3,
"habitat": 2
}
]
Response fields
Unique identifier for the animal.
Common name of the animal. Maximum 30 characters. Animals are ordered alphabetically by name.
Age of the animal in years. Must be a positive integer.
Foreign key referencing the Species resource. Deleting a species cascades to its animals.
Foreign key referencing the Habitats resource.
Create animal
Requires admin authentication.
Common name of the animal. Maximum 30 characters.
Age in years. Must be greater than or equal to zero.
ID of an existing species record.
ID of an existing conservation status record.
ID of an existing habitat record.
curl --request POST \
--url https://api.parquemarino.org/api/animals/create/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Delfín Nariz de Botella",
"age": 5,
"species": 2,
"conservation_status": 1,
"habitat": 3
}'
{
"id": 7,
"name": "Delfín Nariz de Botella",
"age": 5,
"species": 2,
"conservation_status": 1,
"habitat": 3
}
Retrieve animal
Primary key of the animal.
curl --request GET \
--url https://api.parquemarino.org/api/animals/1/
{
"id": 1,
"name": "Tortuga Verde",
"age": 12,
"species": 3,
"conservation_status": 2,
"habitat": 1
}
Update animal
Requires admin authentication. Use PUT to replace all fields; PATCH is not exposed by the router.
Primary key of the animal to update.
Updated common name. Maximum 30 characters.
Updated conservation status ID.
curl --request PUT \
--url https://api.parquemarino.org/api/animals/1/update/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Tortuga Verde",
"age": 13,
"species": 3,
"conservation_status": 2,
"habitat": 1
}'
{
"id": 1,
"name": "Tortuga Verde",
"age": 13,
"species": 3,
"conservation_status": 2,
"habitat": 1
}
Delete animal
Requires admin authentication.
Primary key of the animal to delete.
curl --request DELETE \
--url https://api.parquemarino.org/api/animals/1/delete/ \
--header 'Authorization: Bearer <token>'
Species
A species is a taxonomic classification that groups animals of the same kind. Each species record can include a scientific name, descriptive text, and a representative image.
List species
curl --request GET \
--url https://api.parquemarino.org/api/species/
[
{
"id": 1,
"name": "Chelonia mydas",
"description": "Sea turtle species found throughout tropical and subtropical oceans.",
"img": "/media/species/chelonia-mydas.jpg",
"scientific_name": "Chelonia mydas"
},
{
"id": 2,
"name": "Delfín",
"description": null,
"img": null,
"scientific_name": "Tursiops truncatus"
}
]
Response fields
Unique identifier for the species.
Common name of the species. Maximum 30 characters. Must be unique across all species records. Ordered alphabetically.
Free-text description of the species. Optional.
Relative URL to the uploaded image. Files are stored under media/species/. Returns null when no image has been uploaded.
Binomial scientific name, up to 100 characters. Optional.
Create species
Requires admin authentication.
Common name of the species. Maximum 30 characters. Must be unique.
Free-text description. Optional.
Image file to upload. Stored under media/species/. Optional.
Binomial scientific name. Maximum 100 characters. Optional.
curl --request POST \
--url https://api.parquemarino.org/api/species/create/ \
--header 'Authorization: Bearer <token>' \
--form 'name=Tiburón Martillo' \
--form 'scientific_name=Sphyrna lewini' \
--form 'description=Hammerhead shark native to tropical coastlines.' \
--form '[email protected]'
{
"id": 6,
"name": "Tiburón Martillo",
"description": "Hammerhead shark native to tropical coastlines.",
"img": "/media/species/hammerhead.jpg",
"scientific_name": "Sphyrna lewini"
}
Retrieve species
Primary key of the species.
curl --request GET \
--url https://api.parquemarino.org/api/species/1/
{
"id": 1,
"name": "Chelonia mydas",
"description": "Sea turtle species found throughout tropical and subtropical oceans.",
"img": "/media/species/chelonia-mydas.jpg",
"scientific_name": "Chelonia mydas"
}
Update species
Requires admin authentication. The
<int:pk>/update/ route also exposes DELETE — see
Delete species.
Primary key of the species to update.
Updated common name. Maximum 30 characters.
Updated description. Optional.
Replacement image. Optional.
Updated scientific name. Optional.
curl --request PUT \
--url https://api.parquemarino.org/api/species/6/update/ \
--header 'Authorization: Bearer <token>' \
--form 'name=Tiburón Martillo' \
--form 'scientific_name=Sphyrna lewini' \
--form 'description=Updated description.'
{
"id": 6,
"name": "Tiburón Martillo",
"description": "Updated description.",
"img": "/media/species/hammerhead.jpg",
"scientific_name": "Sphyrna lewini"
}
Delete species
Deleting a species cascades to all animals that reference it. This action cannot be undone.
Requires admin authentication.
Primary key of the species to delete.
curl --request DELETE \
--url https://api.parquemarino.org/api/species/6/delete/ \
--header 'Authorization: Bearer <token>'