Skip to main content

RG_LIVE Endpoints

These are the only public routes intended for external tools using rg_live_* keys.

POST /api/keys/create

Creates a new key for a script.

Auth

Use one of:
  • x-api-key: rg_live_...
  • Authorization: Bearer rg_live_...
  • body field apiKey or api_key

Body

{
  "scriptId": "00000000-0000-0000-0000-000000000000",
  "type": "temporary",
  "duration": 1440,
  "note": "Premium User",
  "prefix": "PREM"
}

Notes

  • scriptId required
  • type: permanent or temporary
  • duration used for temporary keys (minutes)
  • prefix optional, sanitized to alphanumeric/-/_

Success (200)

{
  "success": true,
  "key": {
    "key": "PREM_xxxxxxxxxxxxxxxx",
    "script_id": "00000000-0000-0000-0000-000000000000",
    "type": "temporary",
    "expires_at": "2026-05-03T12:30:00.000Z"
  }
}

Errors

  • 400 invalid JSON, missing scriptId, invalid prefix
  • 401 invalid API key
  • 500 internal error

POST /api/keys/verify

Validates whether a key exists for a script and is currently valid.

Auth

Use one of:
  • x-api-key: rg_live_...
  • Authorization: Bearer rg_live_...

Body

{
  "scriptId": "00000000-0000-0000-0000-000000000000",
  "key": "Key_xxxxxxxxxxxxx"
}

Valid (200)

{
  "valid": true,
  "type": "permanent",
  "expires_at": null
}

Invalid (200)

{
  "valid": false,
  "reason": "not_found"
}
{
  "valid": false,
  "reason": "expired",
  "expires_at": "2026-05-01T10:00:00.000Z"
}

Errors

  • 400 missing scriptId or key
  • 401 missing/invalid API key
  • 500 database/internal failure