Skip to main content

Modelos Vehiculos API

Manage vehicle models. Each model belongs to a specific vehicle make (marca).

Vehicle Model Object

id_modelo
integer
required
Unique identifier for the vehicle model (auto-generated primary key)
id_marca
integer
required
Foreign key reference to MarcasVehiculos (the make/brand this model belongs to)
nombre
string
required
Name of the vehicle model (max 30 characters)
estado
string
Status of the model (default: “Activo”)

GET /api/modelosvehiculos

Retrieve a list of all vehicle models.

Query Parameters

id_marca
integer
Filter models by vehicle make ID
nombre
string
Filter by model name
estado
string
Filter by status

Response

[
  {
    "id_modelo": 1,
    "id_marca": 1,
    "nombre": "Corolla",
    "estado": "Activo"
  },
  {
    "id_modelo": 2,
    "id_marca": 1,
    "nombre": "Camry",
    "estado": "Activo"
  },
  {
    "id_modelo": 3,
    "id_marca": 1,
    "nombre": "RAV4",
    "estado": "Activo"
  },
  {
    "id_modelo": 4,
    "id_marca": 2,
    "nombre": "Civic",
    "estado": "Activo"
  },
  {
    "id_modelo": 5,
    "id_marca": 2,
    "nombre": "Accord",
    "estado": "Activo"
  }
]

POST /api/modelosvehiculos

Create a new vehicle model.

Request Body

id_marca
integer
required
ID of the vehicle make this model belongs to
nombre
string
required
Name of the vehicle model (max 30 characters)
estado
string
Status of the model (defaults to “Activo” if not provided)

Request Example

{
  "id_marca": 1,
  "nombre": "Prius",
  "estado": "Activo"
}

Response

{
  "id_modelo": 6,
  "id_marca": 1,
  "nombre": "Prius",
  "estado": "Activo"
}

GET /api/modelosvehiculos/

Retrieve a specific vehicle model by ID.

Path Parameters

id_modelo
integer
required
The ID of the vehicle model

Response

{
  "id_modelo": 1,
  "id_marca": 1,
  "nombre": "Corolla",
  "estado": "Activo"
}

GET /api/marcasvehiculos//modelos

Retrieve all models for a specific vehicle make.

Path Parameters

id_marca
integer
required
The ID of the vehicle make

Response

[
  {
    "id_modelo": 1,
    "id_marca": 1,
    "nombre": "Corolla",
    "estado": "Activo"
  },
  {
    "id_modelo": 2,
    "id_marca": 1,
    "nombre": "Camry",
    "estado": "Activo"
  },
  {
    "id_modelo": 3,
    "id_marca": 1,
    "nombre": "RAV4",
    "estado": "Activo"
  }
]

PUT /api/modelosvehiculos/

Update an existing vehicle model.

Path Parameters

id_modelo
integer
required
The ID of the vehicle model to update

Request Body

id_marca
integer
Updated make ID
nombre
string
Updated model name
estado
string
Updated status

Request Example

{
  "nombre": "Corolla Cross",
  "estado": "Activo"
}

Response

{
  "id_modelo": 1,
  "id_marca": 1,
  "nombre": "Corolla Cross",
  "estado": "Activo"
}

DELETE /api/modelosvehiculos/

Delete a vehicle model.

Path Parameters

id_modelo
integer
required
The ID of the vehicle model to delete

Response

{
  "message": "Vehicle model deleted successfully"
}

Make-Model Relationship

Vehicle models are always associated with a specific make. For example:
  • Toyota (make) → Corolla, Camry, RAV4 (models)
  • Honda (make) → Civic, Accord, CR-V (models)
  • Ford (make) → F-150, Mustang, Explorer (models)
When creating a vehicle, you must specify both the make (id_marca) and model (id_modelo).

Build docs developers (and LLMs) love