# Watch the licence end date

> See when an eaxPLC licence with an end date (a trial key, for example) ends, in the Studio's Licence & edition view, its status-bar marker and the Diagnostics & Events panel, or through GET /api/licence (expiry_state, days_left, loses); what the PLC keeps and loses after the date, and how to renew.

Product: eaxPLC · Type: How-to guide · Editions: Pro
Source: https://eaxware.com/docs/eaxplc/how-to/watch-the-licence-end-date/
Verified against commit 37ae5fb.

## Goal

You know ahead of time when this PLC's licence ends, what it will no longer do after that date, and you install the renewal before it.

Most eaxPLC licences have no end date (perpetual): nothing on this page applies to them. A licence **with** an end date is, for example, a trial key.

## In the Studio

1. Open **Help > Licence** (the **Licence & edition** view).
2. The **Expires** row shows the end date and the days left:
   - more than 30 days: the days, no warning;
   - 30 days or fewer: an **amber** pill, and a notice naming the date, what the PLC loses after it and what keeps running;
   - after the date: a **rose** pill and notice: the PLC runs eaxPLC Free.
3. **Administrators** also see a marker in the status bar from 14 days before the end and once the licence has ended. It opens **Licence & edition**.

The PLC also raises diagnostic events at 30, 14, 7 and 1 day(s) left (`LICENCE_EXPIRING`, severity `low`, `medium`, `high`, `critical`) and once the date has passed (`LICENCE_EXPIRED`, `critical`). They appear in the **Diagnostics & Events** panel, the audit trail (`DIAGNOSTIC` / `<type>`) and on NATS `plc.<id>.events`. A renewal installed after a warning raises `LICENCE_EXPIRY_CLEARED`. See [Diagnostic events](/docs/eaxplc/reference/diagnostic-events/).

## Through the API

`GET /api/licence` (any signed-in user) returns the licence status under `licence`:

| Field | Meaning |
|---|---|
| `expires_at` | The end date. Absent for a perpetual licence. |
| `expiry_state` | `ok` (perpetual, or more than 30 days left), `expiring` (30 days or fewer), `expired`. |
| `days_left` | Days left, rounded up. Only for a licence with an end date; `0` once expired. |
| `loses` | What the licence's edition adds to eaxPLC Free, so what the PLC loses after the date: `masters` (new EtherNet/IP scanners, EtherCAT and CANopen masters), `mqtt_inputs` (new MQTT and Sparkplug B input buses), `xref_checks`, `dvr`, `rt_tuning`. |

A perpetual licence answers `expiry_state: "ok"` with no `days_left`.

An **expired** licence keeps its verified `id`, `licensee`, `edition`, `nodes` and `expires_at` in the status, so you can see which licence it was. Its `state` stays `invalid` and the PLC runs eaxPLC Free: the licence is shown, never granted.

## What happens at the end date

- **Keeps running:** the program, the scan, the outputs, the watchdog, and the fieldbus buses already applied (their approval stamps stay). Deploys keep working.
- **Lost at the next configuration change and the next start:** what the edition added to eaxPLC Free (the `loses` list above). After a restart the PLC starts as eaxPLC Free.
- The support and security-update dates of a licence raise no event: they do not change what the PLC runs.

## Renew

Install the renewed licence file in **Help > Licence** before the date (Lead Engineer or Administrator; audited). A warning already raised clears at once (`LICENCE_EXPIRY_CLEARED`) when the new licence ends more than 30 days from now or has no end date.
