Skip to main content
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).
species
integer
Filter by species ID.
habitat
integer
Filter by habitat ID.
conservation_status
integer
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

id
integer
required
Unique identifier for the animal.
name
string
required
Common name of the animal. Maximum 30 characters. Animals are ordered alphabetically by name.
age
integer
required
Age of the animal in years. Must be a positive integer.
species
integer
required
Foreign key referencing the Species resource. Deleting a species cascades to its animals.
conservation_status
integer
required
Foreign key referencing the ConservationStatus resource.
habitat
integer
required
Foreign key referencing the Habitats resource.

Create animal

Requires admin authentication.
name
string
required
Common name of the animal. Maximum 30 characters.
age
integer
required
Age in years. Must be greater than or equal to zero.
species
integer
required
ID of an existing species record.
conservation_status
integer
required
ID of an existing conservation status record.
habitat
integer
required
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

id
integer
required
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.
id
integer
required
Primary key of the animal to update.
name
string
required
Updated common name. Maximum 30 characters.
age
integer
required
Updated age in years.
species
integer
required
Updated species ID.
conservation_status
integer
required
Updated conservation status ID.
habitat
integer
required
Updated habitat 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.
id
integer
required
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

id
integer
required
Unique identifier for the species.
name
string
required
Common name of the species. Maximum 30 characters. Must be unique across all species records. Ordered alphabetically.
description
string
Free-text description of the species. Optional.
img
string
Relative URL to the uploaded image. Files are stored under media/species/. Returns null when no image has been uploaded.
scientific_name
string
Binomial scientific name, up to 100 characters. Optional.

Create species

Requires admin authentication.
name
string
required
Common name of the species. Maximum 30 characters. Must be unique.
description
string
Free-text description. Optional.
img
file
Image file to upload. Stored under media/species/. Optional.
scientific_name
string
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

id
integer
required
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.
id
integer
required
Primary key of the species to update.
name
string
required
Updated common name. Maximum 30 characters.
description
string
Updated description. Optional.
img
file
Replacement image. Optional.
scientific_name
string
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.
id
integer
required
Primary key of the species to delete.
curl --request DELETE \
  --url https://api.parquemarino.org/api/species/6/delete/ \
  --header 'Authorization: Bearer <token>'
{}

Build docs developers (and LLMs) love