API Reference
Complete REST API documentation for Authon. All endpoints, request/response formats, and error codes.
Endpoints
Authentication
Client API uses appId + apiKey in the request body. Admin, Auth, and Builder APIs use Bearer token authentication.
Include appId + apiKey in JSON bodyAuthorization: Bearer <access_token>Client API
All client operations go through POST /v1 with a JSON body. The type field determines the operation.
/v1type: "init"Initialize your application. Must be called before any other client request.
{
"type": "init",
"appId": "your-app-id",
"apiKey": "your-api-key"
}{
"success": true,
"message": "App initialized",
"data": {
"name": "My App",
"version": "1.0.0",
"updateUrl": null
}
}/v1type: "login"Authenticate a user with username, password, and optional HWID. Returns a session token.
{
"type": "login",
"appId": "your-app-id",
"apiKey": "your-api-key",
"username": "testuser",
"password": "securepass",
"hwid": "HWID-A1B2C3D4"
}{
"success": true,
"message": "Login successful",
"data": {
"username": "testuser",
"level": 1,
"expiresAt": "2025-12-31T23:59:59.000Z",
"sessionToken": "sess_abc123def456..."
}
}/v1type: "register"Register a new user with a valid license key. Activates the license and creates the user.
{
"type": "register",
"appId": "your-app-id",
"apiKey": "your-api-key",
"username": "newuser",
"password": "securepass",
"licenseKey": "AUTH-XXXX-XXXX-XXXX",
"hwid": "HWID-A1B2C3D4"
}{
"success": true,
"message": "Registration successful",
"data": {
"username": "newuser",
"level": 1,
"expiresAt": "2025-12-31T23:59:59.000Z"
}
}/v1type: "license"Authenticate with license key only (no username/password needed). Activates unused keys automatically.
{
"type": "license",
"appId": "your-app-id",
"apiKey": "your-api-key",
"licenseKey": "AUTH-XXXX-XXXX-XXXX",
"hwid": "HWID-A1B2C3D4"
}{
"success": true,
"message": "License activated",
"data": {
"level": 1,
"expiresAt": "2025-12-31T23:59:59.000Z"
}
}/v1type: "check"Verify if a session token is still valid. Updates the heartbeat timestamp.
{
"type": "check",
"appId": "your-app-id",
"apiKey": "your-api-key",
"sessionToken": "sess_abc123..."
}{
"success": true,
"message": "Session valid",
"data": {
"username": "testuser",
"level": 1,
"expiresAt": "2025-12-31T23:59:59.000Z"
}
}/v1type: "var"Get an application-level variable by key. Requires a valid session.
{
"type": "var",
"appId": "your-app-id",
"apiKey": "your-api-key",
"sessionToken": "sess_abc123...",
"key": "download_url"
}{
"success": true,
"data": {
"key": "download_url",
"value": "https://example.com/latest.zip"
}
}/v1type: "setvar"Set a user-level variable. Each user can have their own set of key-value pairs.
{
"type": "setvar",
"appId": "your-app-id",
"apiKey": "your-api-key",
"sessionToken": "sess_abc123...",
"key": "settings",
"value": "dark_mode=true"
}{
"success": true,
"message": "Variable set"
}/v1type: "getvar"Get a user-level variable by key. Returns the value set by the current user.
{
"type": "getvar",
"appId": "your-app-id",
"apiKey": "your-api-key",
"sessionToken": "sess_abc123...",
"key": "settings"
}{
"success": true,
"data": {
"key": "settings",
"value": "dark_mode=true"
}
}/v1type: "file"Get file info and download URL for authenticated users. Checks user level against file minimum level.
{
"type": "file",
"appId": "your-app-id",
"apiKey": "your-api-key",
"sessionToken": "sess_abc123...",
"fileId": "abc123"
}{
"success": true,
"data": {
"name": "module.exe",
"size": 524288,
"downloadUrl": "/v1/files/download/abc123?token=sess_abc123..."
}
}/v1type: "log"Record a custom log message. Useful for tracking user actions in your application.
{
"type": "log",
"appId": "your-app-id",
"apiKey": "your-api-key",
"sessionToken": "sess_abc123...",
"message": "User opened settings panel"
}{
"success": true,
"message": "Log recorded"
}Auth API
Seller/developer authentication endpoints. Used to get access tokens for the Admin API.
/v1/auth/registerCreate a new seller/developer account.
{
"email": "dev@example.com",
"password": "securepass123",
"name": "John Developer"
}{
"success": true,
"message": "Account created successfully",
"data": {
"id": "seller_abc123",
"email": "dev@example.com",
"name": "John Developer",
"plan": "FREE",
"accessToken": "eyJhbG...",
"refreshToken": "uuid-refresh-token"
}
}/v1/auth/loginLogin to your seller/developer account. Returns access + refresh tokens.
{
"email": "dev@example.com",
"password": "securepass123"
}{
"success": true,
"message": "Login successful",
"data": {
"id": "seller_abc123",
"email": "dev@example.com",
"name": "John Developer",
"plan": "DEVELOPER",
"accessToken": "eyJhbG...",
"refreshToken": "uuid-refresh-token"
}
}/v1/auth/refreshRefresh your access token using a valid refresh token.
{
"refreshToken": "uuid-refresh-token"
}{
"success": true,
"data": {
"accessToken": "eyJhbG...(new)",
"refreshToken": "uuid-new-refresh-token"
}
}/v1/auth/profileGet your seller profile. Requires Bearer token.
// Headers:
// Authorization: Bearer <accessToken>{
"success": true,
"data": {
"id": "seller_abc123",
"email": "dev@example.com",
"name": "John Developer",
"plan": "DEVELOPER",
"createdAt": "2024-01-15T12:00:00.000Z"
}
}Admin API
Manage your applications, users, licenses, files, webhooks, and more. All admin endpoints require Bearer token authentication.
All Admin API endpoints require: Authorization: Bearer <access_token>
Applications
/v1/admin/appsCreate a new application. Returns the app with a generated API key.
{
"name": "My New App"
}{
"success": true,
"data": {
"id": "app_abc123",
"name": "My New App",
"apiKey": "as_...",
"version": "1.0.0",
"status": "ACTIVE"
}
}/v1/admin/appsList all your applications with user and license counts.
{
"success": true,
"data": [{
"id": "app_abc123",
"name": "My App",
"apiKey": "as_...",
"version": "1.0.0",
"status": "ACTIVE",
"_count": { "appUsers": 150, "licenses": 200 }
}]
}/v1/admin/apps/:appIdUpdate application settings.
{
"name": "Updated Name",
"version": "2.0.0",
"status": "ACTIVE"
}{
"success": true,
"data": { "id": "app_abc123", "name": "Updated Name", "version": "2.0.0" }
}/v1/admin/apps/:appIdDelete an application and all its data.
{
"success": true,
"message": "Application deleted"
}/v1/admin/apps/:appId/regenerate-keyRegenerate the API key for an application. Old key becomes invalid immediately.
{
"success": true,
"data": { "apiKey": "as_new_key_here..." }
}Licenses
/v1/admin/apps/:appId/licensesGenerate license keys in bulk (up to 100 at a time).
{
"count": 10,
"durationType": "30d",
"level": 1,
"maxDevices": 1,
"prefix": "VIP",
"note": "Giveaway batch"
}{
"success": true,
"data": [
{ "id": "lic_1", "key": "VIP-XXXX-XXXX-XXXX", "status": "UNUSED", "durationType": "30d" },
...
]
}/v1/admin/apps/:appId/licensesList licenses with pagination and status filter.
// Query params: ?status=UNUSED&page=1&limit=20{
"success": true,
"data": [...],
"pagination": { "page": 1, "limit": 20, "total": 150 }
}/v1/admin/apps/:appId/licenses/:licenseId/banBan a license key. Prevents any further use.
{ "success": true, "message": "License banned" }/v1/admin/apps/:appId/licenses/:licenseIdPermanently delete a license key.
{ "success": true, "message": "License deleted" }Users
/v1/admin/apps/:appId/usersList application users with search and filters.
// Query params: ?search=john&status=ACTIVE&page=1&limit=20{
"success": true,
"data": [{
"id": "usr_123",
"username": "john",
"hwid": "HWID-...",
"ip": "192.168.1.1",
"level": 1,
"status": "ACTIVE",
"lastLogin": "2025-06-15T12:00:00Z",
"expiresAt": "2025-12-31T23:59:59Z"
}],
"pagination": { "page": 1, "limit": 20, "total": 50 }
}/v1/admin/apps/:appId/users/:userId/banBan a user and terminate all their active sessions.
{ "reason": "Terms violation" }{ "success": true, "message": "User banned" }/v1/admin/apps/:appId/users/:userId/unbanUnban a previously banned user.
{ "success": true, "message": "User unbanned" }/v1/admin/apps/:appId/users/:userId/reset-hwidReset a user's hardware ID lock so they can login from a new device.
{ "success": true, "message": "HWID reset" }/v1/admin/apps/:appId/users/:userId/extendExtend a user's subscription by a number of days.
{ "days": 30 }{
"success": true,
"message": "Subscription extended by 30 days",
"data": { "expiresAt": "2026-01-30T23:59:59Z" }
}/v1/admin/apps/:appId/users/:userIdPermanently delete a user.
{ "success": true, "message": "User deleted" }Files
/v1/admin/apps/:appId/filesRegister a file for distribution. Files are encrypted server-side.
{
"name": "module.exe",
"size": 524288,
"minLevel": 1
}{
"success": true,
"data": {
"id": "abc123",
"name": "module.exe",
"path": "/uploads/app_id/abc123_module.exe",
"minLevel": 1
}
}/v1/admin/apps/:appId/filesList all files for an application.
{
"success": true,
"data": [{ "id": "abc123", "name": "module.exe", "size": 524288, "minLevel": 1 }]
}Webhooks
/v1/admin/apps/:appId/webhooksCreate a webhook to receive event notifications.
{
"url": "https://discord.com/api/webhooks/...",
"events": ["user.login", "user.register", "license.activate"]
}{
"success": true,
"data": {
"id": "wh_123",
"url": "https://discord.com/api/webhooks/...",
"events": ["user.login", "user.register", "license.activate"],
"secret": "whsec_..."
}
}/v1/admin/apps/:appId/webhooks/:webhookId/testSend a test ping to verify your webhook endpoint is working.
{
"success": true,
"message": "Test ping sent",
"data": { "statusCode": 200, "ok": true }
}Blacklist
/v1/admin/apps/:appId/blacklistAdd an IP, HWID, or username to the blacklist.
{
"type": "HWID",
"value": "HWID-A1B2C3D4",
"reason": "License sharing detected"
}{
"success": true,
"data": { "id": "bl_123", "type": "HWID", "value": "HWID-A1B2C3D4", "reason": "..." }
}/v1/admin/apps/:appId/blacklistGet all blacklist entries for an application.
{
"success": true,
"data": [{ "id": "bl_123", "type": "HWID", "value": "HWID-A1B2C3D4", "reason": "..." }]
}/v1/admin/apps/:appId/blacklist/:idRemove a blacklist entry.
{ "success": true, "message": "Blacklist entry removed" }Variables
/v1/admin/apps/:appId/variablesCreate an application-level variable accessible to all authenticated users.
{
"key": "latest_version",
"value": "2.1.0",
"readOnly": true
}{
"success": true,
"data": { "id": "var_123", "key": "latest_version", "value": "2.1.0", "readOnly": true }
}/v1/admin/apps/:appId/variablesList all application variables.
{
"success": true,
"data": [{ "key": "latest_version", "value": "2.1.0", "readOnly": true }]
}Sessions
/v1/admin/apps/:appId/sessionsList all active sessions for an application.
{
"success": true,
"data": [{
"id": "sess_123",
"token": "...",
"ip": "192.168.1.1",
"hwid": "HWID-...",
"appUser": { "username": "john" },
"createdAt": "2025-06-15T12:00:00Z"
}]
}/v1/admin/apps/:appId/sessions/:sessionIdKill a specific session (force logout).
{ "success": true, "message": "Session killed" }Reseller API
Endpoints for resellers to login, generate license keys, and check their balance. Resellers authenticate with app credentials + reseller login.
/v1/reseller/loginAuthenticate as a reseller. Returns a JWT token valid for 24 hours.
{
"appId": "your-app-id",
"apiKey": "your-api-key",
"username": "reseller1",
"password": "resellerpass"
}{
"success": true,
"data": {
"token": "eyJhbG...",
"username": "reseller1",
"balance": 50
}
}/v1/reseller/licensesGenerate license keys (deducts from reseller balance). Max 50 per request.
{
"count": 5,
"durationType": "30d",
"level": 1,
"maxDevices": 1,
"prefix": "RESELL"
}{
"success": true,
"data": [
{ "key": "RESELL-XXXX-XXXX-XXXX", "durationType": "30d", "status": "UNUSED" }
],
"balance": 45
}/v1/reseller/licensesList all licenses generated by this reseller.
{
"success": true,
"data": [
{ "key": "RESELL-XXXX-XXXX-XXXX", "status": "USED", "durationType": "30d", "createdAt": "..." }
]
}/v1/reseller/balanceCheck remaining reseller balance (credits).
{
"success": true,
"data": { "balance": 45 }
}Builder API
Build custom loader executables with your app credentials baked in. Requires seller authentication.
/v1/builder/statusCheck if the builder service is ready and templates are available.
{
"success": true,
"templates": { "loader_cpp.exe": true }
}/v1/builder/buildBuild a loader EXE with your credentials embedded. Returns the binary file as download.
{
"appId": "your-app-id",
"language": "cpp",
"fileId": "optional-file-id",
"title": "My App Loader",
"authType": "both"
}// Returns binary file (application/octet-stream)
// Content-Disposition: attachment; filename="My_App_Loader_loader.exe"
// authType options: "login", "license", "both"Error Codes
All errors follow a consistent format with HTTP status codes and descriptive messages.
Error Response Format
{
"success": false,
"message": "Error description here"
}| Code | Description |
|---|---|
| 400 | Bad request - missing required fields or invalid data |
| 401 | Unauthorized - invalid credentials, API key, or session token |
| 403 | Forbidden - HWID mismatch, banned user, paused app, or expired subscription |
| 404 | Not found - resource doesn't exist or doesn't belong to you |
| 409 | Conflict - username or email already exists |
| 429 | Rate limited - too many requests, slow down |
| 500 | Internal server error - contact support |