Skip to main content

Create licenses

POST
Create one or more license keys for an application.

Request body

FieldTypeRequiredDescription
appIdstringYesThe application to issue licenses for
quantityintegerNoNumber of licenses to create (1–100, default 1)
expiresAtstring | nullNoISO 8601 expiration date, or null for lifetime
maxHwidSlotsintegerNoMax devices per license (1–10, default 1)
labelstringNoOptional label for your records (max 128 chars)

Example: minimal

curl -X POST https://api.authforge.cc/v1/licenses \
  -H "Authorization: Bearer af_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"appId": "YOUR_APP_ID", "quantity": 1}'

Example: all options

curl -X POST https://api.authforge.cc/v1/licenses \
  -H "Authorization: Bearer af_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "appId": "YOUR_APP_ID",
    "quantity": 5,
    "expiresAt": "2026-12-31T23:59:59Z",
    "maxHwidSlots": 2,
    "label": "Stripe order #12345"
  }'

Response (201)

{
  "licenses": [
    {
      "licenseKey": "A3K9-BFWX-7NP2-QHDT",
      "appId": "YOUR_APP_ID",
      "status": "active",
      "expiresAt": "2026-12-31T23:59:59Z",
      "maxHwidSlots": 2,
      "createdAt": "2026-04-09T22:00:00.000Z"
    }
  ]
}

Errors

HTTPCodeCause
400bad_requestInvalid or missing parameters
402no_creditsInsufficient credits
403forbiddenThe app doesn’t belong to your account

List licenses

GET
List all licenses for an application with cursor-based pagination.

Query parameters

ParamTypeRequiredDescription
appIdstringYesThe application to list licenses for
limitintegerNoResults per page (1–200, default 50)
cursorstringNoPagination cursor from a previous response

Example

curl "https://api.authforge.cc/v1/licenses?appId=YOUR_APP_ID&limit=50" \
  -H "Authorization: Bearer af_live_your_key"

Response (200)

{
  "licenses": [
    {
      "licenseKey": "A3K9-BFWX-7NP2-QHDT",
      "appId": "YOUR_APP_ID",
      "status": "active",
      "expiresAt": "2026-12-31T23:59:59Z",
      "maxHwidSlots": 2,
      "hwidList": [],
      "createdAt": "2026-04-09T22:00:00.000Z"
    }
  ],
  "cursor": null
}

Pagination

If cursor is non-null, more results are available. Pass it as a query parameter in the next request:
# First page
curl "https://api.authforge.cc/v1/licenses?appId=YOUR_APP_ID&limit=100" \
  -H "Authorization: Bearer af_live_your_key"

# Next page (use cursor from previous response)
curl "https://api.authforge.cc/v1/licenses?appId=YOUR_APP_ID&limit=100&cursor=eyJsaW..." \
  -H "Authorization: Bearer af_live_your_key"

Get a license

GET
Get full details for a single license including HWID bindings and label.

Example

curl "https://api.authforge.cc/v1/licenses/A3K9-BFWX-7NP2-QHDT" \
  -H "Authorization: Bearer af_live_your_key"

Response (200)

{
  "licenseKey": "A3K9-BFWX-7NP2-QHDT",
  "appId": "YOUR_APP_ID",
  "status": "active",
  "expiresAt": "2026-12-31T23:59:59Z",
  "maxHwidSlots": 2,
  "hwidList": ["abc123-hwid-fingerprint"],
  "hwid": null,
  "label": "Stripe order #12345",
  "createdAt": "2026-04-09T22:00:00.000Z"
}

Errors

HTTPCodeCause
403forbiddenThe license’s app doesn’t belong to your account
404not_foundLicense key doesn’t exist

Update a license

PUT
Perform an action on a license: revoke, activate, extend expiration, or reset HWID bindings.

Request body

FieldTypeRequiredDescription
actionstringYesOne of: revoke, activate, extend, reset-hwid
expiresAtstringFor extendNew ISO 8601 expiration date (required when action is extend)

Revoke a license

Immediately disables the license. End users will fail validation on their next heartbeat or login attempt.
curl -X PUT https://api.authforge.cc/v1/licenses/A3K9-BFWX-7NP2-QHDT \
  -H "Authorization: Bearer af_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"action": "revoke"}'

Re-activate a revoked license

Restores a previously revoked license back to active status.
curl -X PUT https://api.authforge.cc/v1/licenses/A3K9-BFWX-7NP2-QHDT \
  -H "Authorization: Bearer af_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"action": "activate"}'

Extend expiration

Sets a new expiration date. Use for subscription renewals or granting additional time.
curl -X PUT https://api.authforge.cc/v1/licenses/A3K9-BFWX-7NP2-QHDT \
  -H "Authorization: Bearer af_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"action": "extend", "expiresAt": "2027-06-30T23:59:59Z"}'

Reset HWID bindings

Clears all bound hardware IDs, allowing the license to be activated on new devices.
curl -X PUT https://api.authforge.cc/v1/licenses/A3K9-BFWX-7NP2-QHDT \
  -H "Authorization: Bearer af_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"action": "reset-hwid"}'

Response (200)

{
  "ok": true,
  "license": {
    "licenseKey": "A3K9-BFWX-7NP2-QHDT",
    "appId": "YOUR_APP_ID",
    "status": "revoked",
    "expiresAt": "2026-12-31T23:59:59Z",
    "maxHwidSlots": 2,
    "hwidList": [],
    "createdAt": "2026-04-09T22:00:00.000Z"
  }
}

Delete a license

DELETE
Permanently delete a license. This cannot be undone.

Example

curl -X DELETE https://api.authforge.cc/v1/licenses/A3K9-BFWX-7NP2-QHDT \
  -H "Authorization: Bearer af_live_your_key"

Response (200)

{ "ok": true }

Errors

HTTPCodeCause
403forbiddenThe license’s app doesn’t belong to your account
404not_foundLicense key doesn’t exist