Floating licences
Let a customer run your app on any number of devices, but only so many at the same time.
PermitPlane counts the seats in the cloud. Your customer installs and hosts nothing.
1. You: give the licence its seats
- Import the licence with a
concurrent_seatscolumn (CSV), or import Cryptlex floating licences. - Set
concurrent_seatsfrom 1 to 1000. - Set the installation limit separately, up to 10,000. Many machines can be activated, but only the seat count runs at once.
2. You: set the seat rules in the policy
| Policy field | Meaning | Values |
|---|---|---|
lease_ttl_seconds | How long one seat lasts before renewal | 300 to 3600, default 900 (15 minutes) |
max_borrow_hours | Longest offline borrow | 0 to 504, default 0 (off) |
3. Your developer: take, renew and return seats in the app
- Take a seat when the app starts. Activation takes the seat in the same call. With no free seat, activation fails and nothing is created.
- Renew the seat about every half of
lease_ttl_seconds. Repeating the checkout call, or refreshing, also extends an online seat by one TTL. - Return the seat when the app closes. After a crash, the seat frees itself when its time runs out.
The signed licence data carries a lease claim and never outlives the seat.
TypeScript
Use @permitplane/client 0.2.0 or newer.
await client.checkoutSeat(); // or { borrowHours: 48 }
client.seatInfo(); // { kind, expiresAt } or null
await client.renewSeat(); // the heartbeat renews online seats
await client.releaseSeat();- With background refresh on, the client renews an online seat at about half the remaining time. It adds up to 10% jitter.
checkoutSeatthrowsSeatsExhaustedErrorwithretryAfterwhen no seat is free.- It throws
LeaseRequiredErrorafterlease_required. - Both set
statusto'seat_unavailable'. dispose()returns an online seat and keeps a borrowed one.
C and C++
Use permitplane.h.
/* 0 = online seat, 1..504 = borrow in hours */
pp_client_checkout_seat(c, 0);
/* call heartbeat_in_seconds after reading the status */
pp_client_renew_seat(c);
pp_client_release_seat(c);- Call
pp_client_renew_seatfrom your own timer. Arm it withheartbeat_in_secondsfrom the client status, and read the status again after each call. - On
PP_ERR_API, read the server code andretry_afterfrompp_client_last_error. - In C++, use
checkout_seat,renew_seatandrelease_seat.
Go, Java, Kotlin, PHP and Rust
Call the renew method from your own timer, at about half the seat time.
| Client | Take, renew, return |
|---|---|
| Go | CheckoutSeat(ctx, hours), RenewSeat(ctx), ReleaseSeat(ctx) |
| Java and Kotlin | checkoutSeat(hours), renewSeat(), releaseSeat() |
| PHP | checkoutSeat($hours), renewSeat(), releaseSeat() |
| Rust | checkout_seat(hours), renew_seat(), release_seat() |
Pass 0 for an online seat (PHP: null, Rust: None). Pass 1 to 504 hours to borrow.
Setup: TypeScript, Go, Java, PHP, Rust and C and C++ quickstarts.
C# and .NET
The client renews an online seat for you. Call CheckoutSeatAsync() to take one and ReleaseSeatAsync() to return it. Pass borrowHours: 1 to 504 to borrow. Setup: C# and .NET quickstart.
Without an SDK
- Take or renew a seat with
POST /api/v1/activations/{id}/lease. - Return it with
DELETEon the same path. - Read the usual refresh fields plus
lease: { id, kind, expires_at }.kindisonlineorborrow.
4. Your customer: work offline with a borrowed seat
- Take the seat with
borrow_hours, a whole number from 1 to 504. - Stay within the policy's
max_borrow_hours. Asking for more is refused with422 validation_failed.
| Rule | Detail |
|---|---|
| Latest end | The licence's offline limit (paid_offline_days, 21 at most) or the end of paid coverage |
| Seat use | Counts against the seat limit until it expires |
| Early return | Releasing or re-taking fails with lease_borrowed |
| Releasing the device | Leaves a live borrow in place until it expires |
| Freeing it early | Only you, through the management API |
Offline licence files and request files are for licences locked to devices. For a floating licence they answer not_floating. See Unattended and offline activation.
5. Your developer: handle seat errors
All are 409.
| Code | When | What to do |
|---|---|---|
seats_exhausted | Every seat is in use. | Wait for Retry-After (1 to 3600 seconds). details has seats_limit, seats_in_use and next_expiry. |
lease_required | A refresh with no live seat. | Take a seat first. |
lease_borrowed | Releasing or checking out online during a borrow. | Wait for the borrow to expire, or ask the vendor to release it. |
not_floating | A seat call on a licence that is not floating. | Use normal activation and refresh. |
6. You: watch and free seats
- Log in at app.permitplane.com and open the licence page (app.permitplane.com/ops/vendor/licenses/…).
- Read Floating seats for seats in use. Each installation shows its seat.
- To free a stuck online seat, open Recover this installation. Click Release installation. A live borrow stays until it expires.
With the management API:
| Operation | Permission | Purpose |
|---|---|---|
| List the seats of a licence | licenses.read | Returns kind, state (active, released, expired), created_at, expires_at and released_at. |
| Release a seat | devices.release | Frees a stuck seat, including a borrow. Needs a reason and an Idempotency-Key. The installation keeps its activation and checks out again. |
Releasing a seat on a licence that is not floating answers not_floating. Paths and schemas are in the API reference.
7. You: track seat use
The metrics guide (for signed-in users) and the Prometheus export have three gauges. Each is per product and policy version.
| Gauge | Counts |
|---|---|
leases_active | Live seats on active floating licences |
leases_limit | Concurrent seats summed over active floating licences |
leases_borrowed | Live seats of kind borrow |