Skip to main content
Variables are key-value pairs delivered to SDK clients during authentication. App variables go to every user; license variables go to a specific license holder. Limits: Max 50 keys, 4 KB total JSON size, flat values only (string, number, boolean). Key max length: 64 characters.

Get app variables

GET
Retrieve all variables for an application.

Path parameters

ParamTypeDescription
appIdstringThe application ID

Example

curl https://api.authforge.cc/v1/apps/YOUR_APP_ID/variables \
  -H "Authorization: Bearer af_live_your_key"

Response (200)

{
  "maintenanceMode": false,
  "maxUploadSizeMb": 50,
  "motd": "Welcome to v2.0!",
  "minVersion": "1.5.0"
}
Returns an empty object {} if no variables are set.

Set app variables

PUT
Replace all variables for an application. This is a full replacement — omitted keys are removed.

Path parameters

ParamTypeDescription
appIdstringThe application ID

Request body

A JSON object of key-value pairs. Values must be strings, numbers, or booleans.
curl -X PUT https://api.authforge.cc/v1/apps/YOUR_APP_ID/variables \
  -H "Authorization: Bearer af_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "maintenanceMode": false,
    "maxUploadSizeMb": 100,
    "motd": "New features available!",
    "minVersion": "2.0.0"
  }'

Response (200)

{
  "maintenanceMode": false,
  "maxUploadSizeMb": 100,
  "motd": "New features available!",
  "minVersion": "2.0.0"
}

Errors

HTTPCodeCause
400bad_requestInvalid body, too many keys (>50), exceeds 4 KB, or invalid value type
403forbiddenThe app doesn’t belong to your account

Clearing all variables

Send an empty object to remove all variables:
curl -X PUT https://api.authforge.cc/v1/apps/YOUR_APP_ID/variables \
  -H "Authorization: Bearer af_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{}'

Get license variables

GET
Retrieve all variables for a specific license.

Path parameters

ParamTypeDescription
licenseKeystringThe license key (URL-encoded if needed)

Example

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

Response (200)

{
  "plan": "pro",
  "maxProjects": 10,
  "customerName": "Acme Corp"
}

Set license variables

PUT
Replace all variables for a specific license. Full replacement — omitted keys are removed.

Path parameters

ParamTypeDescription
licenseKeystringThe license key

Request body

A JSON object of key-value pairs.
curl -X PUT https://api.authforge.cc/v1/licenses/A3K9-BFWX-7NP2-QHDT/variables \
  -H "Authorization: Bearer af_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "plan": "enterprise",
    "maxProjects": 50,
    "customerName": "Acme Corp",
    "features": "export,api,priority-support,sso"
  }'

Response (200)

{
  "plan": "enterprise",
  "maxProjects": 50,
  "customerName": "Acme Corp",
  "features": "export,api,priority-support,sso"
}

Errors

HTTPCodeCause
400bad_requestInvalid body, too many keys (>50), exceeds 4 KB, or invalid value type
403forbiddenThe license’s app doesn’t belong to your account
404not_foundLicense key doesn’t exist

Validation rules

RuleConstraint
Max keys50 per variable set
Max total JSON size4,096 bytes
Key max length64 characters
Allowed value typesstring, number, boolean
NestingNot allowed (flat values only)
Arrays, objects as valuesNot allowed