# Licence and activation

Lumate runs with a licence from OXS. A licence belongs to an OXS account and its plan, and it is made for one install:
a production install or a test install, Lumate Local or Lumate Server. It says what the install may use: how many people,
desk seats (people who take transferred calls in Lumate Desk), agents and companies, and which features (voice, the call
center, WhatsApp, calls through WhatsApp, the desk phone, phone numbers, the office browser, endpoints).

The licence is checked on the install itself, on every request. Nothing a company keeps in Lumate ever goes to OXS (see
[What we send](/docs/licensing#what-we-send)).

## The states of an install

| State | What works |
|---|---|
| **Not activated** (a fresh install) | Signing in, the first account, the Local wizard and activating. Everything else waits. |
| **In transition** (an install that already ran before licensing arrived) | Everything, for 30 days from its first start with licensing. Owners and admins see the date. Activating at any time keeps every row. |
| **Active** | Everything the plan includes, up to its limits. |
| **Ended** (the subscription stopped, or no check-in for 14 days) | Read-only: signing in, Settings → Licence, Export all data and updates. Inbound WhatsApp messages are still stored; inbound calls are declined; no agent wakes and no call starts. Nothing is deleted. |
| **Clock behind** (the computer's clock is more than an hour behind the latest time Lumate has seen) | Like Ended, until the next check-in with OXS Cloud confirms the time (offline: a new licence file from the portal); set the right date and time. |

A locked install answers `402` to the API, with the reason. The app shows the reason and **Export all data**; to the person
who set Lumate up also the ways to activate, a link to renew in the OXS portal and, on Lumate Local, its updates (a newer
Lumate may be what is needed). Anyone can sign out from there.

## Activating

The person who set Lumate up activates it, in the setup's Activate step (Lumate Local's wizard, right after the
company; on a server, right after the first account) or in **Settings → Licence**. Three ways:

1. **With your OXS account (recommended), in Lumate itself (from 2.3.0).** Enter your email and password (and, the first
   time, your name and company) and accept the terms; OXS emails a 6-digit code; enter it in Lumate. A new address gets
   its account and a 14-day trial (no card); an address that already has an account signs in to it (its own password;
   a wrong one is said only after the code proved the address). The same email and password open the customer portal:
   there is nothing else to sign up for. On Lumate Local the first-run form asks for them once: they are also the
   email and password that open Lumate in another browser. The code works once, for 15 minutes; **Send a new code**
   starts again. Five wrong codes spend it.

   **Approve this PC in the browser instead** still works: Lumate shows a code such as `BCDF-GHJK`; open the
   activation page, sign in, check the install and approve. While the code waits, Lumate keeps asking (also through a
   dropped connection) until the code expires.
2. **With a licence key.** In the portal, **Keys** shows the account's key once (`axk_…`); paste it into Lumate.
   Spaces, line breaks and dashes are forgiven; a mistyped key is caught before anything is sent. Rotating the key in the
   portal stops the old one for new activations; installs already running keep working.
3. **Offline (Enterprise).** For an install that never reaches the internet: download its request file in Settings →
   Licence → Offline, upload it in the portal, download the licence file and upload it into Lumate. An offline licence
   lasts to the subscription's end plus 7 days, at most a year, and never checks in.

Choose **Production install** or **Test install**: the plan counts them apart (the trial has one of each).

## Check-ins

Every 12 hours (plus up to 30 minutes, so installs do not all knock at once) Lumate checks in with OXS Cloud and gets
its licence back, valid for 14 more days while the subscription runs.

- If OXS Cloud cannot be reached, Lumate tries again after 5, 10, 20, 40 and then every 60 minutes, and keeps working
  until the licence's last day. After 3 days without a check-in, owners and admins see a line about it.
- When a subscription stops (not paid after 7 days of grace, cancelled at its period's end, or suspended), the next
  check-in ends the licence.
- An ended or clock-behind install asks again every 5 minutes; **Check again** on the lock page asks now.
- **Settings → Licence → Check now** checks in at once.

## What we send

A check-in carries counts and codes only. The exact fields (the cloud refuses any other):

| Field | What it is |
|---|---|
| `version`, `channel`, `edition`, `mode`, `os` | Lumate's version and update channel, Local or Server, how it was installed, the operating system's name and version |
| `packs`, `companies` | The sectors in use (for example `real-estate`) and how many companies |
| `users.seats_used`, `users.desk_seats_used`, `users.active_7d` | How many people and desk seats, and how many people used Lumate in 7 days |
| `agents`, `apps` | How many working agents and apps |
| `usage_24h.*` | In the last 24 hours: agent runs, voice minutes, calls, WhatsApp messages in and out, emails sent |
| `db_mb`, `errors_24h`, `update_state` | The database's size, failed runs and calls in 24 hours, how the last update went |
| `fingerprint`, `clock` | A hash of a random id kept on this machine (it tells a copy of the install from the original), and the install's time |

Never: company or person names, phone numbers, emails, messages, transcripts, files, app records, prompts.
**Settings → Licence → What we send** shows the last check-in exactly as it was sent.

## Limits

Adding past a limit is refused with a sentence (for example "Your licence allows 5 people; 5 are in use"): a new member
or an accepted invitation, a new desk seat, a hired or imported agent, a new company. A person in two companies takes one
seat. What already exists keeps working: if more is in use than the licence allows (after a plan change), owners and
admins see a line about it, and only adding waits.

A feature the plan does not include is hidden: its pages leave the menu, its tools leave the agents, and its API answers
`403` with the feature.

## Updating an install from 1.x

The first start of the licensing release on an install that already has a company starts its **30-day transition**:
everything keeps working, and owners and admins see the last day. Activate it any time before that day. OXS can set up an
account and its licence by hand (invoice or wire); the key then comes from OXS.

## Moving to another machine, restoring a backup

- **A backup restored on the same machine** checks in as before.
- **A copy on another machine** (a database copied, or restored elsewhere) is a new machine to OXS Cloud: while the original
  still checks in, the copy is told to activate again (with a free slot of the licence), and the original keeps working.
  A copy without the original's secrets key cannot check in at all: Settings → Licence says so, and its licence lasts
  only to its last day (14 days at most) unless the key is restored or it is activated again.
- To move an install for good: **Settings → Licence → Deactivate** on the old machine (it frees the slot at once), then
  activate the new one. Deactivating stops Lumate on that machine until it is activated again.

## Export all data

**Export all data** (Settings → Licence, and the lock page) downloads one zip: a consistent copy of the database and every
shared file. It never holds the vault, the secrets key or the machine id, nor anyone's password hash or the licence's
token (people choose new passwords wherever the data is opened). It works in every state, also after the licence
ended. The install's administrator can always take it; a company's owner or admin only while the install holds that one
company (the zip holds every company).

## For IT

- OXS Cloud's address is the `CLOUD_URL` setting; release builds carry `https://api.lumate.io` (before 2.19.0,
  `https://ax-api.oxsbilisim.com`), so a firewall lets Lumate reach that host on port 443. The check-in is an HTTPS
  request through the computer's proxy, trusting the Windows certificate store on Lumate Local.
- An Anthropic API key or a Claude account's token runs Claude Code; that is apart from the licence (see
  [First setup](/docs/first-setup)).
