Skip to main content

Overview

The Assets API provides endpoints for managing physical assets, locations, categories, and equipment hierarchies. All endpoints require authentication. Base Path: /activos/

Search Assets

Search for assets by name, code, serial number, or description.
GET /activos/api/buscar-activos-json/
q
string
Search query to match against asset name, internal code, description, or serial number
cat_id
integer
Filter by category ID
loc_id
integer
Filter by location ID

Response

results
array
Array of matching assets (limited to 50 results)
fetch('/activos/api/buscar-activos-json/?q=pump&cat_id=5', {
  credentials: 'same-origin'
})
.then(res => res.json())
.then(data => console.log(data.results));

Search Models

Search for asset models and manufacturers.
GET /activos/api/buscar-modelos-json/
q
string
required
Search query to match against model name or manufacturer name

Response

results
array
Array of matching models (limited to 50 results)
fetch('/activos/api/buscar-modelos-json/?q=ABB+motor', {
  credentials: 'same-origin'
})
.then(res => res.json())
.then(data => console.log(data.results));

Pin Management

Save Asset Pin

Create or update a pin on a floor plan viewer.
POST /activos/api/guardar-pin/
id
integer
Pin ID (null or omit for new pin)
visor_id
integer
required
Floor plan viewer ID
activo_id
integer
Asset ID to pin
aviso_id
integer
Maintenance notice ID to pin
actividad_id
integer
Project activity ID to pin
ubicacion_id
integer
Location/zone ID to pin
x
float
required
X coordinate on the floor plan
y
float
required
Y coordinate on the floor plan
color
string
default:"#FF0000"
Pin color (hex format)
nota
string
Optional note for the pin
ancho
float
Width for area pins
alto
float
Height for area pins

Response

status
string
“success” or “error”
pin_id
integer
ID of created/updated pin
activo_id
integer
Linked asset ID
nombre_activo
string
Asset or item name
icono
string
Icon identifier for the pin
fotos
array
Array of photo URLs
fetch('/activos/api/guardar-pin/', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-CSRFToken': csrfToken
  },
  credentials: 'same-origin',
  body: JSON.stringify({
    visor_id: 1,
    activo_id: 123,
    x: 150.5,
    y: 200.3,
    color: '#2563eb',
    nota: 'Main circulation pump'
  })
});

Delete Pin

Remove a pin from a floor plan.
POST /activos/api/eliminar-pin/{pin_id}/
pin_id
integer
required
ID of the pin to delete
fetch('/activos/api/eliminar-pin/456/', {
  method: 'POST',
  headers: {
    'X-CSRFToken': csrfToken
  },
  credentials: 'same-origin'
});

Location Hierarchy

Get Root Locations

Retrieve top-level locations.
GET /activos/api/ubicaciones-root/

Response

results
array
Array of root location objects

Get Child Locations

Retrieve child locations for a parent.
GET /activos/api/ubicaciones-children/{parent_id}/
parent_id
integer
required
Parent location ID

Location Details

Get Location Details

Retrieve detailed information about a location including all assets.
GET /activos/api/ubicacion-detalle/{ubicacion_id}/
ubicacion_id
integer
required
Location ID

Response

ubicacion
object
total_activos
integer
Total number of assets in location and descendants
activos_operativos
integer
Number of operational assets
categorias
array
Array of asset categories with grouped assets
fetch('/activos/api/ubicacion-detalle/12/', {
  credentials: 'same-origin'
})
.then(res => res.json())
.then(data => console.log(data));

Asset Details

Get Asset Details

Retrieve detailed information about a specific asset.
GET /activos/api/activo-detalle/{activo_id}/
activo_id
integer
required
Asset ID

Response

id
integer
Asset ID
nombre
string
Asset name
codigo_interno
string
Internal asset code
serie
string
Serial number
estado
string
Asset state code
estado_display
string
Human-readable state
marca
string
Manufacturer name
modelo
string
Model name
categoria
string
Category name
ubicacion
string
Full location path
responsable
string
Responsible person’s name
fecha_compra
string
Purchase date (DD/MM/YYYY format)
costo
string
Asset cost
descripcion
string
Asset description
foto_url
string
Photo URL

Import Progress

Get Import Progress

Check the progress of an asset import task.
GET /activos/api/import-progress/{task_id}/
task_id
string
required
Celery task ID

Response

state
string
Task state (PENDING, PROGRESS, SUCCESS, FAILURE)
current
integer
Current progress value
total
integer
Total items to process
status
string
Status message
percent
integer
Percentage complete (0-100)
const taskId = 'abc123-def456-ghi789';

setInterval(() => {
  fetch(`/activos/api/import-progress/${taskId}/`)
    .then(res => res.json())
    .then(data => {
      console.log(`Progress: ${data.percent}%`);
      if (data.state === 'SUCCESS') {
        console.log('Import complete!');
      }
    });
}, 2000);

Explorer API

Search Explorer

Global search across assets, locations, and categories.
GET /activos/api/explorer-search/?q=search_term
q
string
required
Search term (minimum 2 characters)

Response

Returns HTML fragments with search results grouped by type (Categories, Locations, Assets).

Get Explorer Level

Load children for a specific node in the hierarchy explorer.
GET /activos/api/explorer-level/
id
integer
required
Parent node ID
type
string
required
Node type: “ubicacion”, “activo”, or “categoria”
cat_id
integer
Category filter context

Next Steps

Maintenance API

Work orders and maintenance operations

Documents API

Document management and search

Build docs developers (and LLMs) love