Skip to content

Licensing API

DRAFT — Internal Developer Use Only

This API reference is for internal development teams.

Overview

What it is: The Licensing API provides complete license lifecycle management for Hydden Discovery, including reading license status, creating and activating licenses, managing license registrations, generating one-time passwords for activation, and retrieving license server information.

Source: src/license/rest/rest.go

Base Path

/internal/v1/license

Authentication

All endpoints require JWT cookie or API token authentication.

Endpoints

MethodPathDescription
GET/internal/v1/licenseGet current license information
POST/internal/v1/licenseCreate/register a new license
PATCH/internal/v1/licenseUpdate/patch an existing license
POST/internal/v1/license/storeStore/persist a license token
GET/internal/v1/license/otpGet license OTP (current tenant)
GET/internal/v1/license/otp/:tidGet license OTP for a specific tenant
GET/internal/v1/license/recordGet license record information
DELETE/internal/v1/license/recordDelete the license record
GET/internal/v1/license/serverGet license server address
POST/internal/v1/license/registrationCreate a new license registration
PATCH/internal/v1/license/registrationRefresh an existing license registration
GET/internal/v1/license/requestGenerate a new license request

GET /internal/v1/license

Get the current license status and details. Returns a trial license if no valid license is found.

Request:

http
GET /internal/v1/license
Authorization: Bearer <token>

Response (200):

json
{
  "status": "active",
  "plan": "enterprise",
  "expiresAt": "2027-02-12T00:00:00Z",
  "features": ["ai-assistant", "attestation", "automation", "universal-collector"],
  "limits": {
    "maxAccounts": 100000,
    "maxDataSources": 200
  }
}

Fallback: If the stored license cannot be parsed, a trial license is returned instead.


POST /internal/v1/license

Create or register a new license from a license registration string.

Request:

http
POST /internal/v1/license
Content-Type: application/json
Authorization: Bearer <token>
json
"license-registration-string"

Note: The request body is a plain JSON string (quoted), not a JSON object.

Response (200): Raw license bytes (binary token).


PATCH /internal/v1/license

Update or patch an existing license.

Request:

http
PATCH /internal/v1/license
Content-Type: application/json
Authorization: Bearer <token>
json
"updated-license-string"

Response (200): Raw license bytes (binary token).


POST /internal/v1/license/store

Persist a license token to the registry storage.

Request:

http
POST /internal/v1/license/store
Content-Type: application/json
Authorization: Bearer <token>

Request body contains the license token string.

Response (200): License token bytes confirming storage.


GET /internal/v1/license/otp/:tid

Get a one-time password for license activation. The OTP is used during the initial license registration handshake.

Request:

http
GET /internal/v1/license/otp/:tid
Authorization: Bearer <token>

Path parameters:

ParameterDescription
tidTenant ID (optional — use /otp without the parameter for current tenant)

Response (200):

json
{
  "otp": "ABC123-DEF456",
  "expiresAt": "2026-02-12T01:00:00Z"
}

GET /internal/v1/license/record

Get the license record containing registration and activation metadata.

Request:

http
GET /internal/v1/license/record
Authorization: Bearer <token>

Query parameters:

ParameterTypeDescription
tenantstringOptional tenant ID override

Response (200):

json
{
  "id": "record-uuid",
  "tenantId": "tenant-uuid",
  "registrationDate": "2026-01-15T00:00:00Z",
  "lastRefresh": "2026-02-12T00:00:00Z"
}

DELETE /internal/v1/license/record

Delete the license record. This effectively deactivates the license for the tenant.

Request:

http
DELETE /internal/v1/license/record
Authorization: Bearer <token>

Response (200): Returns the deleted LicenseRecord.


GET /internal/v1/license/server

Get the configured license server address.

Request:

http
GET /internal/v1/license/server
Authorization: Bearer <token>

Response (200): Plain text string containing the license server URL.

https://license.hydden.com

POST /internal/v1/license/registration

Create a new license registration with the license server.

Request:

http
POST /internal/v1/license/registration
Content-Type: application/json
Authorization: Bearer <token>
json
{
  "tenantId": "tenant-uuid",
  "registrationCode": "REG-CODE-123"
}

Response (200): Raw response bytes from the license server.


PATCH /internal/v1/license/registration

Refresh an existing license registration to renew or update the license.

Request:

http
PATCH /internal/v1/license/registration
Authorization: Bearer <token>

No request body required.

Response (200): Raw response bytes from the license server.


GET /internal/v1/license/request

Generate a new license request that can be submitted to the license server for offline activation.

Request:

http
GET /internal/v1/license/request
Authorization: Bearer <token>

Response (200): Raw license request bytes (for offline submission).


Error Responses

StatusDescription
400Invalid license string or registration data
403Authentication failed or insufficient permissions
404License or license record not found
500Internal server error or license server unreachable

Hydden Documentation and Training Hub