Overview
The Sites API allows you to manage camera installation locations (sitios) across different localities. You can create, read, update, and delete site records, as well as export site data to Excel format.List Sites
Retrieve a paginated list of camera sites with search and filtering capabilities.Query Parameters
Search text to filter sites by name, locality, or associated dependency (destino). The search is case-insensitive and uses partial matching.
Response
Returns a paginated list of sites (100 per page) ordered by ID.Unique identifier for the site
Name of the camera site location
Latitude coordinate for the site location
Longitude coordinate for the site location
Locality where the site is located. Valid options:
- Paraná
- Colonia Avellaneda
- Oro Verde
- San Benito
Indicates whether the site has signage (SI/NO converted to true/false)
Indicates whether the site is active
Foreign key reference to the associated dependency (Destino)
Additional notes or observations about the site
Associated dependency object with its details
Example Request
Create Site
Create a new camera site location.Required Permissions
crear-sitio
Request Body
Name of the camera site location
Locality for the site. Must be one of:
- Paraná
- Colonia Avellaneda
- Oro Verde
- San Benito
ID of the associated dependency (must exist in destinos table)
Whether the site is active (true/false or 1/0)
Latitude coordinate for the site location
Longitude coordinate for the site location
Whether the site has signage. Valid values: “SI” or “NO” (converted to boolean)
Additional notes or observations about the site
Example Request
Response
On success, redirects to/sitios (index page).
Error Responses
“ERROR” if the operation fails
Detailed error message describing what went wrong
Edit Site
Retrieve site details for editing.Required Permissions
editar-sitio
Path Parameters
The ID of the site to edit
Update Site
Update an existing camera site location.Required Permissions
editar-sitio
Path Parameters
The ID of the site to update
Request Body
Same parameters as Create Site (all fields can be updated).Name of the camera site location
Locality for the site
ID of the associated dependency
Whether the site is active
Latitude coordinate
Longitude coordinate
Whether the site has signage (“SI” or “NO”)
Additional notes
Example Request
Response
On success, redirects to/sitios (index page).
Delete Site
Delete a camera site location.Required Permissions
borrar-sitio
Path Parameters
The ID of the site to delete
Response
On success, redirects to/sitios (index page).
Deleting a site will also affect related records (cameras, audits) due to foreign key relationships. Ensure you understand the cascade behavior before deleting.
Export Sites to Excel
Export all sites to an Excel file.Response
Downloads an Excel file namedListadoSitios_{timestamp}.xlsx containing all site records.
Example Request
Validation Rules
When creating or updating sites, the following validation rules apply:- nombre: Required string field
- localidad: Required, must be one of the valid localities (not “Seleccionar localidad”)
- destino_id: Required, must reference an existing dependency (not “Seleccionar la dependencia”)
- activo: Required boolean value
- latitud: Optional decimal value
- longitud: Optional decimal value
- cartel: Optional, “SI” or “NO”
- observaciones: Optional text field
Error Codes
Validation failed. Check the error messages for specific field errors.
You don’t have the required permission to perform this action.
Database transaction failed. Returns JSON with error details:
Relationships
Sites have the following relationships:- destino (belongs to): Associated dependency/department
- camaras (has many): Cameras installed at this site
- auditorias (has many): Audit records for this site
Statistics
The index page provides statistics broken down by locality:- Total sites in Paraná
- Total sites in Colonia Avellaneda
- Total sites in San Benito
- Total sites in Oro Verde