Licenses

Create license

Create a new license.

POST
/api/v1/licenses
AuthorizationBearer <token>

Your API key.

In: header

productIdstring

The product ID for which to create the license.

typestring

The type of the license. Can be perpetual or timed.

Value in"perpetual" | "timed"
expiresAt?string

The date when the license expires. Must be null for perpetual licenses.

maxDevicesinteger

The maximum number of devices that can activate this license.

email?string

The email associated with the license.

Response Body

application/json

curl -X POST "https://keyforge.dev/api/v1/licenses" \  -H "Content-Type: application/json" \  -d '{    "productId": "p_123456",    "type": "perpetual",    "maxDevices": 5  }'
{
  "key": "ABCDE-ABCDE-ABCDE-ABCDE-ABCDE",
  "userId": "05d27bfb-61c7-45f7-9d07-09a41defc88a",
  "productId": "p_123456",
  "type": "perpetual",
  "expiresAt": null,
  "revoked": false,
  "email": "[email protected]",
  "maxDevices": 5,
  "activeDevices": [
    {
      "identifier": "some_device_id",
      "name": "My computer name",
      "activationDate": "2024-05-19T18:39:33.000Z"
    }
  ],
  "createdAt": "2024-05-19T18:39:33.000Z"
}