Back
AuthorizedAuthorizedDocs
POST

Initialize License

Validates a license key and creates an authenticated session. This is the first call you make when a user starts your application.

POST/api/v1/init

Request Body

api_keyrequired
string
Your application API key from the dashboard
license_keyrequired
string
The user's license key
hwid
string
Hardware ID of the device. On first use, binds the license to this device.

Response

json
{
  "success": true,
  "message": "Authentication successful",
  "session_token": "abc123...",
  "expires_at": "2025-01-18T13:00:00Z",
  "license_expires_at": "2025-02-18T12:00:00Z",
  "license_key": "XXXX-XXXX-XXXX",
  "username": "john_doe",
  "hwid": "abc123...",
  "is_first_activation": false,
  "product_id": "uuid",
  "product_name": "Pro Plan",
  "product": {
    "id": "uuid",
    "product_name": "Pro Plan",
    "product_slug": "pro-plan"
  }
}

Python

python
import requests, hashlib, platform

def get_hwid():
    return hashlib.sha256(platform.node().encode()).hexdigest()

response = requests.post("https://authorized.lol/api/v1/init", json={
    "api_key": "your_api_key",
    "license_key": "XXXXX-XXXXX-XXXXX",
    "hwid": get_hwid()
})

data = response.json()
if data["success"]:
    session_token = data["session_token"]
else:
    print("Error:", data["message"])

C++

cpp
// See the full C++ ImGui example at:
// https://github.com/authorized-lol/C-ImGui-Example

std::string session = Authorized.Init(api_key, license_key, hwid);

C#

csharp
var response = await client.PostAsync("https://authorized.lol/api/v1/init",
    new StringContent(JsonSerializer.Serialize(new {
        api_key = "your_api_key",
        license_key = "XXXXX-XXXXX-XXXXX",
        hwid = GetHWID()
    }), Encoding.UTF8, "application/json"));

var data = JsonSerializer.Deserialize<JsonElement>(
    await response.Content.ReadAsStringAsync());
string sessionToken = data.GetProperty("session_token").GetString();
Note:The session token expires after 60 minutes. Use the Heartbeat endpoint to keep it alive.