API Documentation

Complete reference for the Licence Server Public API.

GET

/api/check

Validates a licence key and returns associated details and files.

Parameters

NameTypeRequiredDescription
keystringYesThe licence key to validate.
hoststringNoClient hostname (auto-detected if omitted).
userstringNoUser identifier.

Response

{
  "valid": true,
  "licence": {
    "id": "uuid...",
    "key": "XXXX-XXXX",
    "isActive": true,
    "user": "User Name",
    "files": [
      {
        "id": "file-uuid...",
        "name": "plugin.zip",
        "version": "1.0.0"
      }
    ]
  }
}

Example Request

curl "http://localhost:3000/api/check?key=YOUR-KEY&host=example.com"
GET

/api/serve/[fileId]

Downloads a file associated with a valid licence.

Parameters

NameTypeRequiredDescription
fileIdpathYesUUID of the file to download.
keyqueryYesValid licence key.

Response

Binary file stream

Example Request

curl -O -J "http://localhost:3000/api/serve/FILE-UUID?key=YOUR-KEY"
POST

/api/auth/login

Authenticates a user and sets a session cookie.

Parameters

NameTypeRequiredDescription
usernamebodyYesUser email or username.
passwordbodyYesUser password.

Response

{
  "success": true,
  "user": {
    "id": "uuid...",
    "username": "admin"
  }
}

Example Request

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

/api/auth/logout

Clears the session cookie.

Response

{ "success": true }

Example Request

curl -X POST http://localhost:3000/api/auth/logout