# Litmus Edge Manager 3.0.x - Edge Lifecycle: Events

## Get System Events

**GET** `{{LEM_URL}}/api/v1/logs/company/{{company_name}}?filter=&from=1736409600000&limit=10&projectId={{project_id}}&requestedPage=0&to=1736495999059`

# Get System Events

Returns LEM **system events** for the company. Distinct from device-emitted LE events (see `Get Edge Device Events`) -- these are LEM-internal audit events (cert changes, project edits, login attempts, etc.).
> **Updated in 3.0.** New optional query parameters: `action`, `module`, `origin`.

## Endpoint

```http
GET {{LEM_URL}}/api/v1/logs/company/{{company_name}}?filter=&from=1736409600000&limit=10&projectId={{project_id}}&requestedPage=0&to=1736495999059
```
## Authentication

API key in a request header (case sensitive). The value is the LEM admin API token.

| URL prefix | Auth header |
|---|---|
| `{{LEM_URL}}/api/v1/...` (main fleet API) | `X-AuthToken: <token>` |
| `{{LEM_adminURL}}/admin/v1/...` (admin console, port 8446) | `X-AuthToken: <token>` |
| `{{LEM_URL}}/mpcs/...` (Marketplace Catalog) | `Authorization: <token>` (3.0.x also accepts `X-AuthToken`) |
## Errors

| HTTP status         | When it happens                                                                |
|---------------------|--------------------------------------------------------------------------------|
| `400 Bad Request`   | Missing or malformed query/body parameter.                                     |
| `401 Unauthorized`  | Missing or invalid credentials.                                                |
| `403 Forbidden`     | Token lacks permission for this operation.                                     |
| `404 Not Found`     | Target entity does not exist.                                                  |
| `5xx`               | Service is unreachable, restarting, or internally errored. Inspect device logs under `System > Support`. |

> **TLS note**: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.


### Response

**Status**: 200 OK

```json
{
    "pageNum": 0,
    "pagesCount": 1,
    "size": 3,
    "totalSize": 3,
    "elements": [
        {
            "companyName": "solutions",
            "projectId": "462j1mq70mph31wa100t1yuxa",
            "eventTime": 1736453122000,
            "level": "INFO",
            "username": "system",
            "context": "device-certificate",
            "contextId": "",
            "contextDescription": null,
            "message": "Device SSL certificate changed: deviceId=vkrih85ka6fn7zcofirk20vs; certificate=Certificate(id=null, isValid=false, isWeak=false, issuer=litmus-edge-005056b965c2, notAfter=2032-01-09T20:04:00Z, notBefore=2025-01-08T20:04:00Z, signatureAlgorithm=null, subject=litmus-edge-005056b965c2)",
            "accessLevel": "USER"
        },
        {
            "companyName": "solutions",
            "projectId": "462j1mq70mph31wa100t1yuxa",
            "eventTime": 1736452100000,
            "level": "INFO",
            "username": "system",
            "context": "device-certificate",
            "contextId": "",
            "contextDescription": null,
            "message": "Device SSL certificate changed: deviceId=vkrih85ka6fn7zcofirk20vs; certificate=Certificate(id=null, isValid=false, isWeak=false, issuer=litmus-edge-005056b965c2, notAfter=2032-01-09T19:46:00Z, notBefore=2025-01-08T19:46:00Z, signatureAlgorithm=null, subject=litmus-edge-005056b965c2)",
            "accessLevel": "USER"
        },
        {
            "companyName": "solutions",
            "projectId": "462j1mq70mph31wa100t1yuxa",
            "eventTime": 1736451039000,
            "level": "INFO",
            "username": "system",
            "context": "device-certificate",
            "contextId": "",
            "contextDescription": null,
            "message": "Device SSL certificate changed: deviceId=vkrih85ka6fn7zcofirk20vs; certificate=Certificate(id=null, isValid=false, isWeak=false, issuer=litmus-edge-005056b965c2, notAfter=2032-01-09T19:19:00Z, notBefore=2025-01-08T19:19:00Z, signatureAlgorithm=null, subject=litmus-edge-005056b965c2)",
            "accessLevel": "USER"
        }
    ]
}
```

---

## Action Log Contexts

**GET** `{{LEM_URL}}/api/v1/logs/contexts`

# Action Log Contexts

Lists the contexts (`activation`, `company`, `device`, ...) that system events are tagged with. Use a `code` to filter `Get System Events`.

## Endpoint

```http
GET {{LEM_URL}}/api/v1/logs/contexts
```

## Authentication

API key in a request header (case sensitive). The value is the LEM admin API token.

| URL prefix | Auth header |
|---|---|
| `{{LEM_URL}}/api/v1/...` (main fleet API) | `X-AuthToken: <token>` |
| `{{LEM_adminURL}}/admin/v1/...` (admin console, port 8446) | `X-AuthToken: <token>` |
| `{{LEM_URL}}/mpcs/...` (Marketplace Catalog) | `Authorization: <token>` (3.0.x also accepts `X-AuthToken`) |

## Response

`200 OK`. Array of `{code, description}`. Same list as `GET {{LEM_adminURL}}/admin/v1/logs/contexts`.

## Errors

| HTTP status | When it happens |
|---|---|
| `401` | Missing or invalid `X-AuthToken`. |


> **TLS note**: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.


### Response

**Status**: 200 OK

```json
[
    {
        "code": "activation",
        "description": "Edge device activation"
    },
    {
        "code": "ai-ml-model",
        "description": "AI/ML model"
    },
    {
        "code": "alert-trigger",
        "description": "Alert trigger"
    },
    {
        "code": "api-activity",
        "description": "API activity"
    },
    {
        "code": "asset-hierarchy",
        "description": "Industrial Asset Hierarchy"
    },
    {
        "code": "async-subtask",
        "description": "Async subtask"
    },
    {
        "code": "batch-dm",
        "description": "Batch edge device management"
    },
    {
        "code": "company",
        "description": "Company"
    },
    {
        "code": "deactivation",
        "description": "Edge device deactivation"
    },
    {
        "code": "device",
        "description": "Edge device"
    },
    {
        "code": "device-analytics",
        "description": "Edge device analytics"
    },
    {
        "code": "device-analytics-model",
        "description": "Edge device AI/ML model"
    },
    {
        "code": "device-certificate",
        "description": "Edge device certificate"
    },
    {
        "code": "device-connectivity",
        "description": "Edge device connectivity"
    },
    {
        "code": "device-ha",
        "description": "Edge device high availability"
    },
    {
        "code": "device-license-pool",
        "description": "Edge device license pool"
    },
    {
        "code": "device-log-forwarding",
        "description": "Edge device log forwarding"
    },
    {
        "code": "device-service",
        "description": "Edge device system service"
    },
    {
        "code": "edge-ca-certificate-update",
        "description": "Edge device CA certificate update"
    },
    {
        "code": "edge-oauth-client",
        "description": "Edge device OAuth client"
    },
    {
        "code": "failed-login",
        "description": "Failed login attempt"
    },
    {
        "code": "files",
        "description": "Files"
    },
    {
        "code": "grafana",
        "description": "Grafana"
    },
    {
        "code": "gcp-sa-keys-rotation",
        "description": "GCP SA keys rotation"
    },
    {
        "code": "instance-license",
        "description": "LEM instance license"
    },
    {
        "code": "le-upgrade",
        "description": "LE firmware upgrade"
    },
    {
        "code": "lem-upgrade",
        "description": "LEM self-upgrade"
    },
    {
        "code": "license-generation",
        "description": "Edge license generation"
    },
    {
        "code": "license-provisioning",
        "description": "Edge license provisioning"
    },
    {
        "code": "license-server",
        "description": "License server configuration"
    },
    {
        "code": "login",
        "description": "User login"
    },
    {
        "code": "marketplace-application",
        "description": "Marketplace application"
    },
    {
        "code": "mpcs",
        "description": "MPCS"
    },
    {
        "code": "mqtt-dm-account",
        "description": "MQTT DM account"
    },
    {
        "code": "mqtt-account",
        "description": "MQTT account"
    },
    {
        "code": "notification",
        "description": "Notification"
    },
    {
        "code": "project",
        "description": "Project"
    },
    {
        "code": "grant",
        "description": "Project grant permissions"
    },
    {
        "code": "revoke",
        "description": "Project revoke permissions"
    },
    {
        "code": "report-stats",
        "description": "Report stats"
    },
    {
        "code": "ssl-certificate",
        "description": "SSL certificate"
    },
    {
        "code": "team",
        "description": "Team"
    },
    {
        "code": "team-member",
        "description": "Team member"
    },
    {
        "code": "digital-twins",
        "description": "Digital Twins"
    },
    {
        "code": "audit",
        "description": "Audit"
    },
    {
        "code": "audit-report",
        "description": "Audit Report"
    },
    {
        "code": "audit-settings",
        "description": "Audit Settings"
    },
    {
        "code": "git-sync",
        "description": "Git synchronization"
    },
    {
        "code": "integration",
        "description": "Data pipeline integration configuration"
    },
    {
        "code": "device-events-forwarding",
        "description": "Edge device events forwarding"
    },
    {
        "code": "instance-data-export",
        "description": "Instance configuration export"
    },
    {
        "code": "instance-data-import",
        "description": "Instance configuration import"
    },
    {
        "code": "database-dump-download",
        "description": "Database dump download (sensitive-filtered)"
    },
    {
        "code": "registry-image",
        "description": "Docker registry image"
    },
    {
        "code": "registry-config",
        "description": "Docker registry configuration"
    },
    {
        "code": "data-lifecycle-policy",
        "description": "Data lifecycle (retention/purge) policy"
    },
    {
        "code": "audit-forwarding",
        "description": "Audit log forwarding to remote syslog"
    },
    {
        "code": "template-applied",
        "description": "Template applied"
    },
    {
        "code": "template-updated",
        "description": "Template updated"
    },
    {
        "code": "template-parameterized",
        "description": "Template parameterized"
    },
    {
        "code": "template-variable-mapping-updated",
        "description": "Template variable mapping updated"
    },
    {
        "code": "platform-rule-override",
        "description": "Platform rule override"
    },
    {
        "code": "unauthorized-access",
        "description": "Unauthorized access attempt"
    },
    {
        "code": "system-configuration",
        "description": "System configuration"
    },
    {
        "code": "cloud-credentials",
        "description": "Cloud provider credentials"
    },
    {
        "code": "vpn-configuration",
        "description": "VPN configuration"
    },
    {
        "code": "password-policy",
        "description": "Password policy"
    },
    {
        "code": "experimental-feature",
        "description": "Experimental feature"
    },
    {
        "code": "instance-reboot",
        "description": "Instance reboot"
    },
    {
        "code": "support-bundle",
        "description": "Support bundle"
    },
    {
        "code": "system-backup",
        "description": "System backup"
    },
    {
        "code": "alert-acknowledge",
        "description": "Alert acknowledgement"
    },
    {
        "code": "alert-resolve",
        "description": "Alert resolution"
    },
    {
        "code": "alert-rule",
        "description": "Alert rule"
    },
    {
        "code": "automated-response",
        "description": "Automated response"
    },
    {
        "code": "api-token",
        "description": "API token"
    },
    {
        "code": "user-password",
        "description": "User password"
    },
    {
        "code": "role",
        "description": "Role"
    },
    {
        "code": "user",
        "description": "User"
    },
    {
        "code": "oidc-config",
        "description": "OIDC configuration"
    },
    {
        "code": "identity-provider",
        "description": "Identity provider"
    },
    {
        "code": "logout",
        "description": "User logout"
    }
]
```

---

## Get Edge Device Events

**GET** `{{LEM_URL}}/api/v1/loopedge-events/list/{{project_id}}?limit=10&requestedPage=0`

# Get Edge Device Events

Returns LE events emitted by edge devices in the project. Same shape as `Edge Devices > Device Details > Events > Get Events`.
## Endpoint

```http
GET {{LEM_URL}}/api/v1/loopedge-events/list/{{project_id}}?limit=10&requestedPage=0
```
## Authentication

API key in a request header (case sensitive). The value is the LEM admin API token.

| URL prefix | Auth header |
|---|---|
| `{{LEM_URL}}/api/v1/...` (main fleet API) | `X-AuthToken: <token>` |
| `{{LEM_adminURL}}/admin/v1/...` (admin console, port 8446) | `X-AuthToken: <token>` |
| `{{LEM_URL}}/mpcs/...` (Marketplace Catalog) | `Authorization: <token>` (3.0.x also accepts `X-AuthToken`) |
## Errors

| HTTP status         | When it happens                                                                |
|---------------------|--------------------------------------------------------------------------------|
| `400 Bad Request`   | Missing or malformed query/body parameter.                                     |
| `401 Unauthorized`  | Missing or invalid credentials.                                                |
| `403 Forbidden`     | Token lacks permission for this operation.                                     |
| `404 Not Found`     | Target entity does not exist.                                                  |
| `5xx`               | Service is unreachable, restarting, or internally errored. Inspect device logs under `System > Support`. |

> **TLS note**: edge devices use a self-signed certificate by default. Either install the device CA in your client trust store or disable certificate verification when calling this endpoint directly.


### Response

**Status**: 200 OK

```json
[
    {
        "timeStamp": "2019-08-24T14:15:22Z",
        "deviceId": "string",
        "component": "string",
        "severity": "string",
        "eventId": "string",
        "msg": "string",
        "attrs": "string"
    }
]
```

---

