Overview
The Bodycams API manages body-worn cameras including inventory tracking, states, delivery management, and equipment assignment to personnel. Each bodycam has a unique code, serial number, and tracks its current state (available, delivered, lost, maintenance, or decommissioned).Endpoints
List Bodycams
Retrieve a paginated list of bodycams with filtering options.Search by code, serial number, IMEI, brand, or model
Filter by state: disponible, entregada, perdida, mantenimiento, dada_baja
Page number (10 items per page)
Array of bodycam objects
Create Bodycam
Create a new bodycam record.Unique bodycam code
Unique serial number
Brand/manufacturer
Model name
Initial state: disponible, entregada, perdida, mantenimiento, dada_baja
IMEI number
SD card serial number
Battery serial number
Acquisition date
Additional observations
/bodycams with success message: “Bodycam creada exitosamente”
Validation Rules
codigomust be uniquenumero_seriemust be uniqueestadomust be one of: disponible, entregada, perdida, mantenimiento, dada_baja
Show Bodycam
Retrieve details of a specific bodycam.Bodycam ID
Update Bodycam
Update an existing bodycam record.Bodycam ID to update
codigomust be unique (excluding current record)numero_seriemust be unique (excluding current record)estadomust be one of: disponible, entregada, perdida, mantenimiento, dada_baja
/bodycams with success message: “Bodycam actualizada exitosamente”
Delete Bodycam
Delete a bodycam record.Bodycam ID to delete
/bodycams with success message: “Bodycam eliminada exitosamente”
Bodycam States
The system tracks five possible states for each bodycam:Available for assignment
Delivered to personnel
Lost or missing
Under maintenance or repair
Decommissioned/retired
Model Methods
The Bodycam model provides several helper methods:Check Availability
Change State
Get Formatted Data
Query Scopes
Error Codes
Bad Request - Validation error or missing required fields
Unauthorized - Authentication required
Forbidden - Missing permissions (ver-bodycam, crear-bodycam, editar-bodycam, borrar-bodycam)
Not Found - Bodycam not found
Unprocessable Entity - Duplicate code/serial or invalid state
Related Endpoints
For bodycam delivery management, see:POST /entrega-bodycams- Create deliveryGET /entrega-bodycams/{id}- View deliveryGET /entrega-bodycams/{id}/devolver- Return bodycamsGET /entrega-bodycams/exportar/excel- Export deliveries
Models
Bodycam Model
Represents a body-worn camera device. ConstantsESTADO_DISPONIBLE = 'disponible'ESTADO_ENTREGADA = 'entregada'ESTADO_PERDIDA = 'perdida'ESTADO_MANTENIMIENTO = 'mantenimiento'ESTADO_DADA_BAJA = 'dada_baja'
entregasActuales- BelongsToMany EntregaBodycam (current deliveries)entregasHistoricas- BelongsToMany EntregaBodycam (all deliveries)detalleEntregas- HasMany DetalleEntregaBodycamdetalleDevoluciones- HasMany DetalleDevolucionBodycam
app/Http/Controllers/BodycamController.php:1-114
Model: app/Models/Bodycam.php:1-132