# Limited and HWID links

> Subscription links with a device limit, or for a single device by HWID, where the user never sees the subscription address.

A **limited link** lets the subscription be added to at most N devices. A **HWID link** works for only one device
with the given HWID.

## Create a link

1. Cabinet → “Links” → “New link”: the subscription address (on your [verified domain](https://flowlock.cc/en/docs/domains.md)), the device
   limit (1 to 1000), a note for yourself, and an expiry date. For a HWID link, also the device's HWID (the limit is
   then 1).
2. You get two links to the same thing:

```
flowlock://install/a7k2m9x4q8b3n6p5
https://flowlock.cc/i/a7k2m9x4q8b3n6p5
```

The second one is handy for messengers: the page opens FlowLock or offers to download it. The cabinet also shows a QR
code of this link.

## How it works

- The subscription address is stored encrypted on the FlowLock server and handed to the app only while the link has
  places left. A device that already got the link gets it again without using up a place (for a reinstall).
- The app asks the person: “Add a subscription from the provider “My VPN”?” Nothing is added silently.
- The user doesn't see the subscription address: it can't be copied, shown as a QR code or shared. To their other
  devices the user carries the link itself, not the address, and each device takes its own place.
- No places left: the app says “The subscription administrator has limited the number of devices” and shows your
  contacts.
- For a HWID link the app asks the person whether it may send the HWID if they have “Send HWID” turned off. A
  different HWID means the link won't work.

## Management

The link list shows how many places are taken. For each link you can:

- see its devices and **unlink** any of them, which frees the place;
- change the limit (no lower than the number of devices on the link) and the note;
- turn it off and on again;
- delete it.

> **Unlinking doesn't revoke access.** The subscription address already handed out keeps working. To close access,
> change the subscription token in your panel.

This protects against accidental sharing, not against a determined person: on their own computer the address can be
intercepted.

## Through the API

```sh
# limited link for 3 devices
curl -s -X POST https://api.flowlock.cc/v1/provider/installs -H "Authorization: Bearer $FLOWLOCK_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"url": "https://sub.example.com/abc123", "limit": 3, "note": "user 1042"}'

# HWID link
curl -s -X POST https://api.flowlock.cc/v1/provider/installs -H "Authorization: Bearer $FLOWLOCK_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"url": "https://sub.example.com/abc123", "limit": 1, "hwid": "5f0c…"}'
```

The other calls are in the [API reference](https://flowlock.cc/en/docs/api.md#links). Up to 5000 links per cabinet.
