Esta página requiere el encabezado X-Api-Key y el parámetro ?companyId= descritos en la descripción general de la API REST para desarrolladores.
Lista todas las Empresas de su tenant. No se necesita el parámetro companyId.
curl -s "https://acme.activohq.cloud/api/v1/companies" \
-H "X-Api-Key: $ACTIVOHQ_API_KEY"
Respuesta:
{
"items": [
{ "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "Acme Corp" }
],
"total": 1,
"skip": 0,
"take": 50
}
Lista paginada de Activos. Opcionalmente filtre con search (coincide con AssetCode, Name o RFID EPC).
curl -s "https://acme.activohq.cloud/api/v1/assets?companyId=3fa85f64-5717-4562-b3fc-2c963f66afa6&search=laptop&skip=0&take=20" \
-H "X-Api-Key: $ACTIVOHQ_API_KEY"
Los elementos de la respuesta incluyen el AssetDto completo (ver más abajo).
Recupera un único activo por su GUID.
curl -s "https://acme.activohq.cloud/api/v1/assets/f47edba8-67fe-42ce-8209-0e20e1abc17e?companyId=3fa85f64-5717-4562-b3fc-2c963f66afa6" \
-H "X-Api-Key: $ACTIVOHQ_API_KEY"
Los campos de la respuesta incluyen accumulatedDepreciation y netBookValue (solo lectura, calculados).
Los registros vinculados (categoría, ubicación, custodio, etc.) se devuelven como objetos { "id", "code", "name" }.
Crea un activo. Devuelve 201 Created con un encabezado Location que apunta al nuevo recurso.
curl -s -X POST "https://acme.activohq.cloud/api/v1/assets?companyId=3fa85f64-5717-4562-b3fc-2c963f66afa6" \
-H "X-Api-Key: $ACTIVOHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"assetCode": "LAP-0042",
"name": "Dell Latitude 5540",
"categoryId": "b1e2c3d4-e5f6-7890-abcd-ef1234567890",
"acquisitionDate": "2024-01-15",
"acquisitionCost": 1250.00,
"salvageValue": 100.00,
"usefulLifeMonths": 60,
"depreciationMethod": "StraightLine",
"status": "Active",
"availability": "Available"
}'
Si se alcanza el límite de Activos de su plan, la API devuelve
400con{"error":"Asset limit reached -- upgrade your plan."}.
Actualiza un activo existente. Devuelve 200 OK con el activo actualizado.
curl -s -X PUT "https://acme.activohq.cloud/api/v1/assets/f47edba8-67fe-42ce-8209-0e20e1abc17e?companyId=3fa85f64-5717-4562-b3fc-2c963f66afa6" \
-H "X-Api-Key: $ACTIVOHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"assetCode": "LAP-0042",
"name": "Dell Latitude 5540 (updated)",
"categoryId": "b1e2c3d4-e5f6-7890-abcd-ef1234567890",
"acquisitionDate": "2024-01-15",
"acquisitionCost": 1250.00
}'
Todos los campos son JSON en camelCase. Inclúyalos al crear o actualizar un activo.
| Campo | Tipo | Requerido | Notas |
|---|---|---|---|
assetCode |
string | Sí | Código único dentro de la empresa. |
name |
string | Sí | Nombre de visualización. |
rfidEpc |
string | No | Código electrónico de producto RFID. |
description |
string | No | Descripción en texto libre. |
serialNumber |
string | No | Número de serie del fabricante. |
categoryId |
guid | Sí | Use GET /api/v1/categories para listar los ids. |
locationId |
guid | No | Use GET /api/v1/locations. |
costCenterId |
guid | No | Use GET /api/v1/cost-centers. |
custodianId |
guid | No | Use GET /api/v1/custodians. |
depreciationBookId |
guid | No | Use GET /api/v1/depreciation-books. |
assignedEmployeeId |
guid | No | Use GET /api/v1/employees. |
acquisitionDate |
fecha (ISO) | Sí | Ej. "2024-01-15". |
inServiceDate |
fecha (ISO) | No | Fecha en que el activo fue puesto en servicio. |
acquisitionCost |
decimal | Sí | Costo original de adquisición. |
salvageValue |
decimal | No | Valor residual al final de la vida útil. |
usefulLifeMonths |
entero | No | Se usa para los métodos de línea recta y saldo decreciente. |
totalEstimatedUnits |
entero | No | Se usa únicamente para el método UnitsOfProduction. |
depreciationMethod |
string | No | StraightLine, DecliningBalance, o UnitsOfProduction. |
status |
string | No | Draft, Active, u otros estados definidos. |
availability |
string | No | Available o CheckedOut. |
El AssetDto devuelto por GET y POST/PUT incluye estos campos calculados adicionales:
| Campo | Notas |
|---|---|
accumulatedDepreciation |
Total de depreciación registrada hasta la fecha. |
netBookValue |
acquisitionCost - accumulatedDepreciation. |
Was this page helpful?