API Endpoints

LexFloatServer exposes HTTP API endpoints to get information about the server, the products it serves, their licenses, and the floating clients that hold a seat.

The endpoints are under /api/v4 and work for one product or several. To find a product's ID, call Getting the list of products.

The examples use http://localhost:8090. If server.port is set to another port, use that port instead.

Authentication

Every endpoint on this page requires authentication, and so do the activation and deactivation endpoints. Authenticate in one of these ways:

  • API key: send it in the X-API-Key header. The key is auth.apiKey in config.yml, so set it before you call the endpoints. Use the API key for scripts and tools.
  • Access token: send it in the Authorization: Bearer ACCESS_TOKEN header. See Getting an access token.
# With the API key
curl -H "X-API-Key: YOUR_API_KEY" http://localhost:8090/api/v4/products

# With an access token
curl -H "Authorization: Bearer ACCESS_TOKEN" http://localhost:8090/api/v4/products

Getting an access token

POST /api/v4/auth/login

Log in with the username and password of a user in the auth.admins list in config.yml:

curl -X POST http://localhost:8090/api/v4/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "YOUR_PASSWORD"}'

The response contains the access token:

{ "accessToken": "eyJhbGciOiJIUzI1NiIs..." }

An access token is valid for 60 minutes. After it expires, log in again to get a new one. A wrong username or password returns 401.

Getting server stats

GET /api/v4/server/stats

Authentication: Required

Returns the LexFloatServer version, the number of products it serves, and the seats currently leased, added up across all products. For the seats of one product, see Getting a product.

{
"version": "4.24.0", // LexFloatServer version
"totalProducts": 2,
"totalFloatingClients": 14,
"totalOfflineFloatingClients": 2 // seats borrowed off the network (offline leases)
}

Getting server configuration

GET /api/v4/server/config

Authentication: Required

The server-wide configuration from config.yml, including productDefaults. The API key is shown only as configured or not, and local dashboard users only by username.

{
"server": { "port": 8090, "enableIpv6": false, "cryptlexHost": "", "blockedIps": [], "allowedClockOffset": 60, "leaseDurationGracePeriod": 0 },
"ssl": { "enabled": false },
"proxy": { "trustedProxies": [] },
"auth": { "apiKeyConfigured": true, "admins": ["admin"] },
"logging": { "logLevel": 1, "console": { "enabled": true, "noColor": false }, "file": { "enabled": true, "directory": "./logs", "maxSize": 1, "maxBackups": 10 } },
"productDefaults": { "leaseDuration": 60, "maxOfflineLeaseDuration": 30, "allowedOfflineFloatingClients": 0 }
}

Getting the list of products

GET /api/v4/products

Authentication: Required

Every product in config.yml, with its license status, lease settings, and seat usage.

[
{
"id": "2a6f7c1e-4b8d-4e0f-9c3a-1d2e3f4a5b6c",
"displayName": "Product A",
"enabled": true,
"status": "ok",
"leaseDuration": 1800,
"maxOfflineLeaseDuration": 604800,
"allowedOfflineFloatingClients": 5,
"totalFloatingClients": 9,
"totalOfflineFloatingClients": 2
}
]
  • status is one of ok, not_activated, expired, suspended, grace_period_over, or disabled.
  • leaseDuration, maxOfflineLeaseDuration, and allowedOfflineFloatingClients are the values the product enforces, after the license's settings are applied to those in config.yml.
  • A disabled product has null seat counts.

For the license key, seats, and expiry date, see Getting the list of licenses.

Getting a product

GET /api/v4/products/{productId}

Authentication: Required

One product, in the same format as Getting the list of products. An unknown product ID returns 404 with the code PRODUCT_NOT_FOUND.

Getting the list of licenses

GET /api/v4/licenses

Authentication: Required

The license of each activated product, with its meter attributes and feature entitlements. A product that is not activated or is disabled has no entry.

[
{
"productId": "2a6f7c1e-4b8d-4e0f-9c3a-1d2e3f4a5b6c",
"key": "AAAAAA-AAAAAA-AAAAAA-AAAAAA-AAAAAA",
"allowedFloatingClients": 25,
"leasingStrategy": "per-machine",
"createdAt": 1735689600,
"activatedAt": 1736294400,
"expiresAt": 1798761600,
"serverSyncGracePeriodExpiresAt": 1767225600,
"activationMode": { "initial": "online", "current": "online" },
"entitlementSet": { "name": "pro", "displayName": "Pro", "tier": 2 },
"user": { "name": "Jane Doe", "email": "jane@example.com", "company": "Example Inc" },
"organization": null,
"meterAttributes": [
{ "id": "6e1d3c2b-...", "name": "exports", "allowedUses": 1000, "totalUses": 312, "grossUses": 340, "floating": true }
],
"featureEntitlements": [
{ "featureName": "export_pdf", "featureDisplayName": "Export to PDF", "value": "true", "baseValue": "true", "expiresAt": 0 }
]
}
]
  • The license status is on the product, not here. See Getting the list of products.
  • entitlementSet, user, and organization are null when the license has none.
  • Timestamps are in Unix seconds. An expiresAt of 0 means no expiry.

Getting the list of floating clients

GET /api/v4/floating-clients

Authentication: Required

The floating clients that currently hold a seat, across all products.

[
{
"id": "c0a8012e-5d1b-4f3a-9e7c-2b6d8f0a1c3e",
"productId": "2a6f7c1e-4b8d-4e0f-9c3a-1d2e3f4a5b6c",
"productDisplayName": "Product A",
"hostname": "LAB-PC-07",
"ip": "10.0.4.17",
"username": "jdoe",
"os": "windows",
"osVersion": "10.0.22631",
"clientVersion": "4.12.0",
"offline": false,
"createdAt": 1767000000,
"updatedAt": 1767003600,
"expiresAt": 1767003900,
"metadata": [{ "key": "department", "value": "engineering" }],
"meterAttributes": [{ "name": "exports", "uses": 3 }]
}
]
  • offline: true marks a seat borrowed off the network.
  • meterAttributes is this client's own usage. For the license's allowed and total uses, see Getting the list of licenses.

Getting a floating client

GET /api/v4/floating-clients/{id}

Authentication: Required

One floating client, in the same format as Getting the list of floating clients. An unknown ID returns 404 with the code FLOATING_CLIENT_NOT_FOUND.

Pagination

Getting the list of products, Getting the list of licenses, and Getting the list of floating clients return results in pages of 20 by default. Use limit to set the page size, up to 100, and page to choose the page, starting at 1. The response headers describe the page:

  • Pagination-Count: the total number of results.
  • Pagination-Page: the current page.
  • Pagination-Limit: the page size.

Errors

An error returns an HTTP status code and a JSON body with a code and a message. Use code to handle the error. The message explains it, can be empty, and can change between versions.

{ "code": "INVALID_QUERY_PARAMETER", "message": "Description of the error." }
StatusCodeCause
400INVALID_QUERY_PARAMETERA query parameter is unknown or has an invalid value.
400INVALID_PRODUCT_IDThe productId does not match a product in config.yml.
401UNAUTHORIZEDThe API key or access token is missing or wrong.
404PRODUCT_NOT_FOUNDNo product has this ID.
404FLOATING_CLIENT_NOT_FOUNDNo floating client has this ID.
Config ReferenceLicensing via Web API
Last updated: