Skip to content

Licenses

Our service allows you to manage your licenses in other applications by using REST API.


Create

To create a license you need to send a request to the REST API by following instructions.

Body parameters
  • key string required
    Unique identifier for the license.

  • productId long required
    Product ID associated with the license.

  • description long
    Detailed description of the license.

  • clientName long required
    Name of the client who owns the license.

  • email string
    Email address associated with the license.

  • discordId long
    Discord ID linked to the license. (available discord bot integration)

  • addressLimit int
    Maximum number of addresses allowed for this license.

  • addressDuration int
    Duration limit for each address under the license. (in days)

  • assignedAddress string
    Assigned IP address for the license.

  • machineLimit int
    Maximum number of machines allowed under this license.

  • machineDuration int
    Duration limit for each machine under the license. (in days)

  • assignedMachine string
    Assigned machine identifier for the license.

  • duration long
    Total duration of the license in months.

  • deleteAfterExpire boolean
    Whether the license should be automatically deleted after expiration.

  • addons array
    Array of addon IDs associated with the license.

Codes
Status CodeDescription
401You don't have permission to create license.
409License with this key already exists.
423You don't have any plan assigned or you have reached the limit of licenses.
201License created successfully.

Sample request

http
curl -X PUT https://api.mlicense.net/api/v1/licenses \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: {API_KEY}' \
  -d '{
    "key": "IAJAS-ASDAS-ASDAS-ASDAS-ASDAS",
    "productId": 12312,
    "clientName": "mLicense Dev",
    "email": "[email protected]"
  }'

Sample token

text
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Sample response

json
{
  "id": 1,
  "key": "example-key",
  "productId": 123456789,
  "description": "Example license description",
  "clientName": "John Doe",
  "email": "[email protected]",
  "discordId": 987654321,
  "addressLimit": 5,
  "addressDuration": 30,
  "assignedAddress": "192.168.1.1",
  "machineLimit": 3,
  "machineDuration": 60,
  "assignedMachine": "Machine-1234",
  "duration": 365,
  "deleteAfterExpire": true,
  "addons": [111, 222, 333]
}

Update

To update a license you need to send a request to the REST API by following instructions.

Body parameters
  • id long required
    Unique identifier for the license.

  • key string
    Unique identifier for the license.

  • productId long
    Product ID associated with the license.

  • description string
    Detailed description of the license.

  • clientName string
    Name of the client who owns the license.

  • email string
    Email address associated with the license.

  • discordId long
    Discord ID linked to the license. (available discord bot integration)

  • addressLimit int
    Maximum number of addresses allowed for this license.

  • addressDuration int
    Duration limit for each address under the license. (in days)

  • assignedAddress string
    Assigned IP address for the license.

  • machineLimit int
    Maximum number of machines allowed under this license.

  • machineDuration int
    Duration limit for each machine under the license. (in days)

  • assignedMachine string
    Assigned machine identifier for the license.

  • duration int
    Total duration of the license in months.

  • deleteAfterExpire boolean
    Whether the license should be automatically deleted after expiration.

  • addons array
    Array of addon IDs associated with the license.

Codes
Status CodeDescription
401You don't have permission to create license.
404License not found.
409License with this key already exists.
423You don't have any plan assigned or you have reached the limit of licenses.
200License updated successfully.

Sample request

http
curl -X POST https://api.mlicense.net/api/v1/licenses \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: {API_KEY}' \
  -d '{
    "id": 1,
    "key": "HGA!@-ASDAS-ASDAS-ASDAS-ASDAS",
  }'

Sample token

text
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Sample response

json
{
  "id": 1,
  "key": "HGA!@-ASDAS-ASDAS-ASDAS-ASDAS",
  "productId": 123456789,
  "description": "Example license description",
  "clientName": "John Doe",
  "email": "[email protected]",
  "discordId": 987654321,
  "addressLimit": 5,
  "addressDuration": 30,
  "assignedAddress": "192.168.1.1",
  "machineLimit": 3,
  "machineDuration": 60,
  "assignedMachine": "Machine-1234",
  "duration": 365,
  "deleteAfterExpire": true,
  "addons": [111, 222, 333]
}

Get

To get a license you need to send a request to the REST API by following instructions.
Remember get all return JsonArray with all licenses objects.

Request parameter
  • id long required for (licenses/id)
    Unique identifier for the license.

  • key string required for (licenses/key)
    Unique identifier for the license.

Codes
Status CodeDescription
401You don't have permission to view this license.
404License not found.
200Return license.

Sample request for ALL

http
curl -X GET https://api.mlicense.net/api/v1/licenses/all \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: {API_KEY}'

Sample request for ID

http
curl -X GET https://api.mlicense.net/api/v1/licenses/id?id=LICENSE_ID \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: {API_KEY}'

Sample request for KEY

http
curl -X GET https://api.mlicense.net/api/v1/licenses/key?key=LICENSE_KEY \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: {API_KEY}'

Sample token

text
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Sample response

json
{
  "id": 1,
  "key": "HGA!@-ASDAS-ASDAS-ASDAS-ASDAS",
  "productId": 123456789,
  "description": "Example license description",
  "clientName": "John Doe",
  "email": "[email protected]",
  "discordId": 987654321,
  "addressLimit": 5,
  "addressDuration": 30,
  "assignedAddress": "192.168.1.1",
  "machineLimit": 3,
  "machineDuration": 60,
  "assignedMachine": "Machine-1234",
  "duration": 365,
  "deleteAfterExpire": true,
  "addons": [111, 222, 333]
}

Delete

To delete a license you need to send a request to the REST API by following instructions.

Request parameter
  • id long required
    Unique identifier for the license.
Codes
Status CodeDescription
401You don't have permission to delete this license.
404License not found.
204License successfully deleted.

Sample request

http
curl -X DELETE https://api.mlicense.net/api/v1/licenses?id=LICENSE_ID \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: {API_KEY}'

Sample token

text
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c