# router logs — NCM API

Device event logs that routers have uploaded to NetCloud Manager. Read-only, a single list call, filtered by device and time. This is the device's own log stream; for NCM-side API activity see the audit log.

Base URL: https://www.cradlepointecm.com/api/v2

### GET /router_logs/

Get information about router_logs

<p>Use the GET method on this endpoint to retrieve router_logs records. Use the available filtering fields to narrow or broaden your search.</p> <p><strong>Note:</strong> To receive router logs, you must enable them on the <strong>Groups</strong> page in NCM using the <strong>Settings</strong> dialog and selecting the <strong>Enable Log Reporting</strong> option. Enabling device logs can significantly increase the NCM network traffic from the device to the server depending on how quickly the device is generating log events.</p>

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| X-ECM-API-ID | header | string | yes | <strong>ECM API app Id</strong> |
| X-ECM-API-KEY | header | string | yes | <strong>ECM API app key</strong> |
| X-CP-API-ID | header | string | yes | <strong>Cradlepoint API app Id</strong> |
| X-CP-API-KEY | header | string | yes | <strong>Cradlepoint API access key</strong> |
| router | query | in: int<br />out: url | yes | ID of the Router to retrieve logs from |
| created_at | query | timestamp | no | Timestamp for when the router_logs record was created |
| created_at__lt | query | timestamp | no | Filter for created_at is less than |
| created_at__gt | query | timestamp | no | Filter for created_at is greater than |
| created_at_timeuuid | query | timeuuid | no | A unique ID (timeuuid) associated with the created_at timestamp |
| created_at_timeuuid__in | query | timeuuid | no | Filter for created_at_timeuuid in - a comma-separated list of timeuuids for router_logs records |
| created_at_timeuuid__gt | query | timeuuid | no | Filter for created_at_timeuuid is greater than |
| created_at_timeuuid__gte | query | timeuuid | no | Filter for created_at_timeuuid is greater than or equal to |
| created_at_timeuuid__lt | query | timeuuid | no | Filter for created_at_timeuuid is less than |
| created_at_timeuuid__lte | query | timeuuid | no | Filter for created_at_timeuuid is less than or equal |
| order_by | query | string | no | Specifies the sort order for response data |
| limit | query | integer | no | Restricts the number of records returned in a recordset to this value. Max value is 500. |
| offset | query | integer | no | Specifies where (an index) in a recordset to begin returning records. |

**Example request**

```bash
curl "https://www.cradlepointecm.com/api/v2/router_logs/" \
  -H "X-CP-API-ID: <cp-api-id>" \
  -H "X-CP-API-KEY: <cp-api-key>" \
  -H "X-ECM-API-ID: <ecm-api-id>" \
  -H "X-ECM-API-KEY: <ecm-api-key>"
```

**Response 200** — Example response.

```json
{
  "data": [
    {
      "created_at": "2021-02-09T22:37:07.590858+00:00",
      "created_at_timeuuid": "2021-02-09T22:37:07.590858_0",
      "exception": null,
      "level": "INFO",
      "message": "Checking upgrade server for pkg: 24.01.521_Verizon,2013, fw_info path: ['status', 'wan', 'devices', 'mdm-11eec444e', 'ob_upgrade', 'fw_info_verizon']",
      "reported_at": "2021-02-09T17:05:12+00:00",
      "router": "https://www.cradlepointecm.com/api/v1/routers/2162719/",
      "sequence": 0,
      "source": "upgrade"
    },
    {
      "created_at": "2021-02-09T22:37:07.590858+00:00",
      "created_at_timeuuid": "2021-02-09T22:37:07.590858_1",
      "exception": null,
      "level": "INFO",
      "message": "Found file on server; version: 24.01.546_ATT,4028",
      "reported_at": "2021-02-09T17:05:12+00:00",
      "router": "https://www.cradlepointecm.com/api/v1/routers/2162719/",
      "sequence": 1,
      "source": "upgrade"
    }
  ],
  "meta": {
    "count": 20,
    "limit": 20,
    "next": "https://www.cradlepointecm.com/api/v2/router_logs/?router=2162719&limit=20&offset=20",
    "offset": 0,
    "previous": null
  }
}
```
