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

# Historial de ruta

> Obtiene la ruta recorrida por el dispositivo en un rango de tiempo

## Authorization

<ParamField header="Authorization" type="string" required default="Bearer ">
  API Key. Formato: `Bearer lbt_•••`
</ParamField>

## Path Parameters

<ParamField path="id" type="uuid" required>
  ID del dispositivo
</ParamField>

## Query Parameters

<ParamField query="from" type="integer" required>
  Timestamp Unix de inicio
</ParamField>

<ParamField query="to" type="integer" required>
  Timestamp Unix de fin
</ParamField>

<ParamField query="stop_threshold_time" type="integer">
  Duración mínima de parada (segundos)
</ParamField>

<Note>
  También disponible en `GET /devices/{id}/route`
</Note>

## Respuesta

Puntos de ruta, paradas y resumen del recorrido.

<ResponseExample>
  ```json 200 theme={null}
  {
    "points": [
      {
        "latitude": 19.4326,
        "longitude": -99.1332,
        "speed": 45,
        "timestamp": 1710756000
      },
      {
        "latitude": 19.4330,
        "longitude": -99.1340,
        "speed": 50,
        "timestamp": 1710756060
      }
    ],
    "stops": [
      {
        "latitude": 19.4350,
        "longitude": -99.1360,
        "duration": 1800,
        "start": 1710757000,
        "end": 1710758800
      }
    ],
    "total_distance": 15.5,
    "total_duration": 3600
  }
  ```
</ResponseExample>

## Errores

| Código | Descripción                |
| ------ | -------------------------- |
| `400`  | Parámetros inválidos       |
| `404`  | Dispositivo no encontrado  |
| `500`  | Error interno del servidor |
