> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.rhombus.community/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitoreo de alarmas

> Crea integraciones de monitoreo de alarmas con la API de Rhombus: rastrea ubicaciones, despacha respondedores y administra casos de amenaza en tiempo real.

<Note>
  Esta página fue traducida automáticamente. Si encuentra errores o tiene sugerencias, [contáctenos](mailto:support@rhombus.com).
</Note>

## Descripción general

El monitoreo de alarmas de Rhombus ofrece una administración centralizada de seguridad para tus ubicaciones. A través de la API, puedes habilitar o deshabilitar el monitoreo por ubicación, responder a casos de amenaza en tiempo real, administrar PINs de teclado y obtener alertas de políticas. Esto es especialmente útil para construir paneles de seguridad personalizados, automatizar flujos de respuesta ante alarmas o integrar las alarmas de Rhombus en una plataforma de monitoreo de terceros.

Cuando el monitoreo está habilitado para una ubicación, las cámaras y sensores de Rhombus detectan eventos de seguridad y generan casos de amenaza. Tu aplicación puede entonces obtener, escalar, descartar o cancelar esos casos de amenaza de forma programática.

## Requisitos previos

<Note>
  Antes de comenzar, asegúrate de tener:

  * Una **API key de Rhombus** con permisos de monitoreo de alarmas (generada en la Consola de Rhombus en Settings > API)
  * Una **licencia de monitoreo de alarmas** activa en tu organización
  * Al menos una **ubicación configurada** con cámaras o sensores inscritos en monitoreo de alarmas
</Note>

## Verificar el estado del monitoreo

Usa el endpoint de estado a nivel de organización para ver qué ubicaciones tienen el monitoreo habilitado, o consulta una ubicación específica directamente.

### Estado a nivel de organización

<CodeGroup>
  ```python Python theme={null}
  import requests

  headers = {
      "x-auth-scheme": "api-token",
      "x-auth-apikey": "YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  response = requests.post(
      "https://api2.rhombussystems.com/api/alertmonitoring/orgStatus",
      headers=headers,
      json={}
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api2.rhombussystems.com/api/alertmonitoring/orgStatus', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-auth-scheme': 'api-token',
      'x-auth-apikey': 'YOUR_API_KEY'
    },
    body: JSON.stringify({})
  });
  const data = await response.json();
  console.log(data);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api2.rhombussystems.com/api/alertmonitoring/orgStatus \
    -H "Content-Type: application/json" \
    -H "x-auth-scheme: api-token" \
    -H "x-auth-apikey: YOUR_API_KEY" \
    -d '{}'
  ```
</CodeGroup>

### Estado por ubicación específica

<CodeGroup>
  ```python Python theme={null}
  import requests

  headers = {
      "x-auth-scheme": "api-token",
      "x-auth-apikey": "YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  response = requests.post(
      "https://api2.rhombussystems.com/api/alertmonitoring/locationStatus",
      headers=headers,
      json={
          "locationUuid": "YOUR_LOCATION_UUID"
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api2.rhombussystems.com/api/alertmonitoring/locationStatus', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-auth-scheme': 'api-token',
      'x-auth-apikey': 'YOUR_API_KEY'
    },
    body: JSON.stringify({
      locationUuid: 'YOUR_LOCATION_UUID'
    })
  });
  const data = await response.json();
  console.log(data);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api2.rhombussystems.com/api/alertmonitoring/locationStatus \
    -H "Content-Type: application/json" \
    -H "x-auth-scheme: api-token" \
    -H "x-auth-apikey: YOUR_API_KEY" \
    -d '{"locationUuid": "YOUR_LOCATION_UUID"}'
  ```
</CodeGroup>

También puedes obtener la configuración completa del monitoreo de alarmas para una ubicación, incluyendo el estado de armado y los horarios configurados:

<CodeGroup>
  ```python Python theme={null}
  import requests

  headers = {
      "x-auth-scheme": "api-token",
      "x-auth-apikey": "YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  response = requests.post(
      "https://api2.rhombussystems.com/api/alertmonitoring/getAlertMonitoringSettingsForLocation",
      headers=headers,
      json={
          "locationUuid": "YOUR_LOCATION_UUID"
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api2.rhombussystems.com/api/alertmonitoring/getAlertMonitoringSettingsForLocation', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-auth-scheme': 'api-token',
      'x-auth-apikey': 'YOUR_API_KEY'
    },
    body: JSON.stringify({
      locationUuid: 'YOUR_LOCATION_UUID'
    })
  });
  const data = await response.json();
  console.log(data);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api2.rhombussystems.com/api/alertmonitoring/getAlertMonitoringSettingsForLocation \
    -H "Content-Type: application/json" \
    -H "x-auth-scheme: api-token" \
    -H "x-auth-apikey: YOUR_API_KEY" \
    -d '{"locationUuid": "YOUR_LOCATION_UUID"}'
  ```
</CodeGroup>

## Habilitar y deshabilitar el monitoreo

Activa o desactiva el monitoreo de alarmas para una ubicación específica. Cuando habilitas el monitoreo, el sistema comienza a vigilar eventos de seguridad en esa ubicación. Cuando lo deshabilitas, la generación de casos de amenaza se detiene.

### Habilitar el monitoreo

<CodeGroup>
  ```python Python theme={null}
  import requests

  headers = {
      "x-auth-scheme": "api-token",
      "x-auth-apikey": "YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  response = requests.post(
      "https://api2.rhombussystems.com/api/alertmonitoring/enableMonitoringForLocation",
      headers=headers,
      json={
          "locationUuid": "YOUR_LOCATION_UUID"
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api2.rhombussystems.com/api/alertmonitoring/enableMonitoringForLocation', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-auth-scheme': 'api-token',
      'x-auth-apikey': 'YOUR_API_KEY'
    },
    body: JSON.stringify({
      locationUuid: 'YOUR_LOCATION_UUID'
    })
  });
  const data = await response.json();
  console.log(data);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api2.rhombussystems.com/api/alertmonitoring/enableMonitoringForLocation \
    -H "Content-Type: application/json" \
    -H "x-auth-scheme: api-token" \
    -H "x-auth-apikey: YOUR_API_KEY" \
    -d '{"locationUuid": "YOUR_LOCATION_UUID"}'
  ```
</CodeGroup>

### Deshabilitar el monitoreo

<CodeGroup>
  ```python Python theme={null}
  import requests

  headers = {
      "x-auth-scheme": "api-token",
      "x-auth-apikey": "YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  response = requests.post(
      "https://api2.rhombussystems.com/api/alertmonitoring/disableMonitoringForLocation",
      headers=headers,
      json={
          "locationUuid": "YOUR_LOCATION_UUID"
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api2.rhombussystems.com/api/alertmonitoring/disableMonitoringForLocation', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-auth-scheme': 'api-token',
      'x-auth-apikey': 'YOUR_API_KEY'
    },
    body: JSON.stringify({
      locationUuid: 'YOUR_LOCATION_UUID'
    })
  });
  const data = await response.json();
  console.log(data);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api2.rhombussystems.com/api/alertmonitoring/disableMonitoringForLocation \
    -H "Content-Type: application/json" \
    -H "x-auth-scheme: api-token" \
    -H "x-auth-apikey: YOUR_API_KEY" \
    -d '{"locationUuid": "YOUR_LOCATION_UUID"}'
  ```
</CodeGroup>

<Tip>
  Puedes automatizar los horarios de monitoreo habilitándolo y deshabilitándolo en momentos específicos mediante un cron job o un scheduler en tu aplicación.
</Tip>

## Administrar casos de amenaza

Los casos de amenaza representan eventos de seguridad detectados que requieren respuesta. Cuando una cámara o sensor detecta actividad sospechosa en una ubicación monitoreada, el sistema crea un caso de amenaza. Posteriormente puedes obtener, escalar, descartar o cancelar estos casos a través de la API.

### Obtener casos de amenaza

Obtén casos de amenaza dentro de un rango de tiempo. Usa parámetros de paginación para manejar conjuntos grandes de resultados.

<CodeGroup>
  ```python Python theme={null}
  import requests
  import time

  headers = {
      "x-auth-scheme": "api-token",
      "x-auth-apikey": "YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  # Get threat cases from the last 24 hours
  now_ms = int(time.time() * 1000)
  one_day_ago_ms = now_ms - (24 * 60 * 60 * 1000)

  response = requests.post(
      "https://api2.rhombussystems.com/api/event/getAlertMonitoringThreatCases",
      headers=headers,
      json={
          "afterTimestampMs": one_day_ago_ms,
          "beforeTimestampMs": now_ms
      }
  )
  data = response.json()

  for case in data.get("threatCases", []):
      print(f"Threat Case: {case['uuid']} - Status: {case['status']}")
  ```

  ```javascript JavaScript theme={null}
  const now = Date.now();
  const oneDayAgo = now - (24 * 60 * 60 * 1000);

  const response = await fetch('https://api2.rhombussystems.com/api/event/getAlertMonitoringThreatCases', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-auth-scheme': 'api-token',
      'x-auth-apikey': 'YOUR_API_KEY'
    },
    body: JSON.stringify({
      afterTimestampMs: oneDayAgo,
      beforeTimestampMs: now
    })
  });
  const data = await response.json();

  for (const threatCase of data.threatCases || []) {
    console.log(`Threat Case: ${threatCase.uuid} - Status: ${threatCase.status}`);
  }
  ```

  ```bash cURL theme={null}
  # Replace timestamps with current epoch millisecond values
  curl -X POST https://api2.rhombussystems.com/api/event/getAlertMonitoringThreatCases \
    -H "Content-Type: application/json" \
    -H "x-auth-scheme: api-token" \
    -H "x-auth-apikey: YOUR_API_KEY" \
    -d '{
      "afterTimestampMs": 1712620800000,
      "beforeTimestampMs": 1712707200000
    }'
  ```
</CodeGroup>

### Responder a casos de amenaza

Cuando un caso de amenaza está activo, tienes tres opciones de respuesta según la situación.

<Tabs>
  <Tab title="Escalar a alarm">
    Escala un caso de amenaza a una alarm completa cuando se confirma la amenaza y se requiere respuesta inmediata de seguridad o autoridades.

    <CodeGroup>
      ```python Python theme={null}
      import requests

      headers = {
          "x-auth-scheme": "api-token",
          "x-auth-apikey": "YOUR_API_KEY",
          "Content-Type": "application/json"
      }

      response = requests.post(
          "https://api2.rhombussystems.com/api/alertmonitoring/escalateThreatCaseToAlarm",
          headers=headers,
          json={
              "uuid": "YOUR_THREAT_CASE_ID"
          }
      )
      print(response.json())
      ```

      ```javascript JavaScript theme={null}
      const response = await fetch('https://api2.rhombussystems.com/api/alertmonitoring/escalateThreatCaseToAlarm', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'x-auth-scheme': 'api-token',
          'x-auth-apikey': 'YOUR_API_KEY'
        },
        body: JSON.stringify({
          uuid: 'YOUR_THREAT_CASE_ID'
        })
      });
      const data = await response.json();
      console.log(data);
      ```

      ```bash cURL theme={null}
      curl -X POST https://api2.rhombussystems.com/api/alertmonitoring/escalateThreatCaseToAlarm \
        -H "Content-Type: application/json" \
        -H "x-auth-scheme: api-token" \
        -H "x-auth-apikey: YOUR_API_KEY" \
        -d '{"uuid": "YOUR_THREAT_CASE_ID"}'
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Descartar">
    Descarta un caso de amenaza cuando lo hayas revisado y determinado que no requiere acción (por ejemplo, un falso positivo).

    <CodeGroup>
      ```python Python theme={null}
      import requests

      headers = {
          "x-auth-scheme": "api-token",
          "x-auth-apikey": "YOUR_API_KEY",
          "Content-Type": "application/json"
      }

      response = requests.post(
          "https://api2.rhombussystems.com/api/alertmonitoring/dismissThreatCase",
          headers=headers,
          json={
              "uuid": "YOUR_THREAT_CASE_ID"
          }
      )
      print(response.json())
      ```

      ```javascript JavaScript theme={null}
      const response = await fetch('https://api2.rhombussystems.com/api/alertmonitoring/dismissThreatCase', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'x-auth-scheme': 'api-token',
          'x-auth-apikey': 'YOUR_API_KEY'
        },
        body: JSON.stringify({
          uuid: 'YOUR_THREAT_CASE_ID'
        })
      });
      const data = await response.json();
      console.log(data);
      ```

      ```bash cURL theme={null}
      curl -X POST https://api2.rhombussystems.com/api/alertmonitoring/dismissThreatCase \
        -H "Content-Type: application/json" \
        -H "x-auth-scheme: api-token" \
        -H "x-auth-apikey: YOUR_API_KEY" \
        -d '{"uuid": "YOUR_THREAT_CASE_ID"}'
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Cancelar">
    Cancela un caso de amenaza para evitar que avance. Úsalo cuando la situación se haya resuelto antes de que sea necesario escalarla.

    <CodeGroup>
      ```python Python theme={null}
      import requests

      headers = {
          "x-auth-scheme": "api-token",
          "x-auth-apikey": "YOUR_API_KEY",
          "Content-Type": "application/json"
      }

      response = requests.post(
          "https://api2.rhombussystems.com/api/alertmonitoring/cancelThreatCase",
          headers=headers,
          json={
              "uuid": "YOUR_THREAT_CASE_ID"
          }
      )
      print(response.json())
      ```

      ```javascript JavaScript theme={null}
      const response = await fetch('https://api2.rhombussystems.com/api/alertmonitoring/cancelThreatCase', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'x-auth-scheme': 'api-token',
          'x-auth-apikey': 'YOUR_API_KEY'
        },
        body: JSON.stringify({
          uuid: 'YOUR_THREAT_CASE_ID'
        })
      });
      const data = await response.json();
      console.log(data);
      ```

      ```bash cURL theme={null}
      curl -X POST https://api2.rhombussystems.com/api/alertmonitoring/cancelThreatCase \
        -H "Content-Type: application/json" \
        -H "x-auth-scheme: api-token" \
        -H "x-auth-apikey: YOUR_API_KEY" \
        -d '{"uuid": "YOUR_THREAT_CASE_ID"}'
      ```
    </CodeGroup>
  </Tab>
</Tabs>

## Administrar PINs de ubicación

Los PINs permiten que los usuarios armen y desarmen el monitoreo de alarmas en una ubicación usando un teclado de Rhombus. Puedes crear y eliminar PINs para cada ubicación a través de la API.

### Crear un PIN

<CodeGroup>
  ```python Python theme={null}
  import requests

  headers = {
      "x-auth-scheme": "api-token",
      "x-auth-apikey": "YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  response = requests.post(
      "https://api2.rhombussystems.com/api/alertmonitoring/createCustomPinForLocation",
      headers=headers,
      json={
          "locationUuid": "YOUR_LOCATION_UUID",
          "pin": "4829",
          "name": "Front Desk Staff"
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api2.rhombussystems.com/api/alertmonitoring/createCustomPinForLocation', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-auth-scheme': 'api-token',
      'x-auth-apikey': 'YOUR_API_KEY'
    },
    body: JSON.stringify({
      locationUuid: 'YOUR_LOCATION_UUID',
      pin: '4829',
      name: 'Front Desk Staff'
    })
  });
  const data = await response.json();
  console.log(data);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api2.rhombussystems.com/api/alertmonitoring/createCustomPinForLocation \
    -H "Content-Type: application/json" \
    -H "x-auth-scheme: api-token" \
    -H "x-auth-apikey: YOUR_API_KEY" \
    -d '{
      "locationUuid": "YOUR_LOCATION_UUID",
      "pin": "4829",
      "name": "Front Desk Staff"
    }'
  ```
</CodeGroup>

### Eliminar un PIN

<CodeGroup>
  ```python Python theme={null}
  import requests

  headers = {
      "x-auth-scheme": "api-token",
      "x-auth-apikey": "YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  response = requests.post(
      "https://api2.rhombussystems.com/api/alertmonitoring/deletePinForLocation",
      headers=headers,
      json={
          "locationUuid": "YOUR_LOCATION_UUID",
          "pin": "4829"
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api2.rhombussystems.com/api/alertmonitoring/deletePinForLocation', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-auth-scheme': 'api-token',
      'x-auth-apikey': 'YOUR_API_KEY'
    },
    body: JSON.stringify({
      locationUuid: 'YOUR_LOCATION_UUID',
      pin: '4829'
    })
  });
  const data = await response.json();
  console.log(data);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api2.rhombussystems.com/api/alertmonitoring/deletePinForLocation \
    -H "Content-Type: application/json" \
    -H "x-auth-scheme: api-token" \
    -H "x-auth-apikey: YOUR_API_KEY" \
    -d '{
      "locationUuid": "YOUR_LOCATION_UUID",
      "pin": "4829"
    }'
  ```
</CodeGroup>

<Warning>
  La eliminación de un PIN tiene efecto inmediato. Asegúrate de que el PIN ya no se necesite antes de eliminarlo, ya que los usuarios que dependen de él perderán la capacidad de armar o desarmar el sistema desde el teclado.
</Warning>

## Trabajar con alertas de políticas

Las alertas de políticas se disparan cuando políticas de detección configuradas (como detección de movimiento o de personas) se activan en ubicaciones monitoreadas. Usa estos endpoints para obtener alertas recientes y descartarlas tras revisarlas.

### Obtener alertas de políticas

<CodeGroup>
  ```python Python theme={null}
  import requests

  headers = {
      "x-auth-scheme": "api-token",
      "x-auth-apikey": "YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  response = requests.post(
      "https://api2.rhombussystems.com/api/event/getPolicyAlerts",
      headers=headers,
      json={}
  )
  data = response.json()

  for alert in data.get("policyAlerts", []):
      print(f"Alert: {alert['uuid']} - Type: {alert.get('type', 'N/A')}")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api2.rhombussystems.com/api/event/getPolicyAlerts', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-auth-scheme': 'api-token',
      'x-auth-apikey': 'YOUR_API_KEY'
    },
    body: JSON.stringify({})
  });
  const data = await response.json();

  for (const alert of data.policyAlerts || []) {
    console.log(`Alert: ${alert.uuid} - Type: ${alert.type || 'N/A'}`);
  }
  ```

  ```bash cURL theme={null}
  curl -X POST https://api2.rhombussystems.com/api/event/getPolicyAlerts \
    -H "Content-Type: application/json" \
    -H "x-auth-scheme: api-token" \
    -H "x-auth-apikey: YOUR_API_KEY" \
    -d '{}'
  ```
</CodeGroup>

### Descartar una alerta de política

<CodeGroup>
  ```python Python theme={null}
  import requests

  headers = {
      "x-auth-scheme": "api-token",
      "x-auth-apikey": "YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  response = requests.post(
      "https://api2.rhombussystems.com/api/event/dismissPolicyAlertV2",
      headers=headers,
      json={
          "alertUuid": "YOUR_POLICY_ALERT_UUID"
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api2.rhombussystems.com/api/event/dismissPolicyAlertV2', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-auth-scheme': 'api-token',
      'x-auth-apikey': 'YOUR_API_KEY'
    },
    body: JSON.stringify({
      alertUuid: 'YOUR_POLICY_ALERT_UUID'
    })
  });
  const data = await response.json();
  console.log(data);
  ```

  ```bash cURL theme={null}
  curl -X POST https://api2.rhombussystems.com/api/event/dismissPolicyAlertV2 \
    -H "Content-Type: application/json" \
    -H "x-auth-scheme: api-token" \
    -H "x-auth-apikey: YOUR_API_KEY" \
    -d '{"alertUuid": "YOUR_POLICY_ALERT_UUID"}'
  ```
</CodeGroup>

## Próximos pasos

<CardGroup cols={2}>
  <Card title="Notificaciones por webhook" icon="webhook" href="/es/webhooks">
    Recibe notificaciones en tiempo real cuando ocurran eventos de alarm para que tu aplicación responda de inmediato
  </Card>

  <Card title="Referencia de la API" icon="code" href="/api-reference/overview">
    Explora la referencia completa de la API con esquemas de solicitud y respuesta para todos los endpoints de monitoreo de alarmas
  </Card>
</CardGroup>
