REST API Endpoints

Complete API specification for license verification, authentication, and heartbeat endpoints.

Overview

Base URL: https://iamgravity.eu/api

All endpoints accept and return JSON. Authentication via Bearer token (session token from login).

License API

Verify License

POST /license/verify

POST /api/license/verify
Content-Type: application/json

{
  "licenseKey": "GRAV-XXXX-XXXX-XXXX-XXXX",
  "machineId": "sha256-hash",
  "machineName": "DESKTOP-ABC123",
  "appVersion": "1.2.3"
}

Response:

{
  "valid": true,
  "license": { "plan": "Pro", "maxMachines": 3, "expiresAt": "..." },
  "machine": { "id": "...", "name": "...", "activatedAt": "..." },
  "gracePeriodDays": 7
}

List Activations (Admin)

GET /api/license/activations?licenseKey=... - Requires admin API key

Revoke Machine (Admin)

DELETE /api/license/activations/{machineId}?licenseKey=... - Requires admin API key

Auth API

Login

POST /api/auth/login

POST /api/auth/login
Content-Type: application/json

{
  "email": "[email protected]",
  "password": "...",
  "machineId": "sha256-hash",
  "machineName": "DESKTOP-ABC123",
  "appVersion": "1.2.3"
}

Response:

{
  "sessionToken": "eyJhbGciOiJIUzI1NiIs...",
  "expiresAt": "2025-01-15T10:30:00Z",
  "license": { "plan": "Pro", "maxMachines": 3 }
}

Logout

POST /api/auth/logout - Requires Authorization: Bearer {sessionToken}

Heartbeat API

Send Heartbeat

POST /api/auth/heartbeat - Requires Authorization: Bearer {sessionToken}

POST /api/auth/heartbeat
Authorization: Bearer {sessionToken}
Content-Type: application/json

{
  "machineId": "sha256-hash",
  "appVersion": "1.2.3"
}

Response:

{
  "valid": true,
  "license": { "plan": "Pro", "maxMachines": 3 },
  "serverTime": "2025-01-15T10:30:00Z"
}