> ## 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.

# Enviar comando

> Envía un comando al dispositivo (por GSM o SMS según el tipo de comando)

## 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>

<ParamField path="command" type="uuid" required>
  ID del comando
</ParamField>

## Body

Parámetros del comando (varía por comando):

<ParamField body="param1" type="string">
  Parámetro del comando
</ParamField>

<ParamField body="param2" type="string">
  Parámetro del comando
</ParamField>

<RequestExample>
  ```json Comando simple theme={null}
  {}
  ```

  ```json Comando con parámetros theme={null}
  {
    "apn": "internet.movistar.mx",
    "user": "movistar",
    "password": "movistar"
  }
  ```
</RequestExample>

## Comportamiento

* **Comandos GSM:** Se parsea la plantilla del comando con los parámetros y se envía al dispositivo
* **Comandos SMS:** Se parsea la plantilla SMS, se fusionan los parámetros con la configuración del modelo y se envía vía SMS

<ResponseExample>
  ```json 200 theme={null}
  {
    "status": "sent",
    "command_id": "550e8400-e29b-41d4-a716-446655440000",
    "method": "gsm"
  }
  ```
</ResponseExample>

## Errores

| Código | Descripción                         |
| ------ | ----------------------------------- |
| `404`  | Dispositivo o comando no encontrado |
| `500`  | Error al enviar el comando          |
