Skip to content

Authorization API

Authorization APIs are called through Command WS. auth.create_session is anonymous; all other methods require a valid session on the current connection.

Methods

MethodParametersResponse dataNotes
auth.create_sessiontoken: string requiredsession_token: string, expires_in: number, auth_context: AuthContextCreates a connection-bound session from an API key.
auth.get_contextnonesession_token: string, auth_context: AuthContextReads current connection auth context.
auth.refresh_sessionnonesession_token, expires_in, auth_contextRefreshes current connection session.
auth.activate_offlineauth_code: string requiredsession_token, expires_in, auth_contextActivates the current machine and session with an offline device activation code.
auth.destroy_sessionnonedestroyed: booleanDestroys the session and cleans streams/devices opened by the current connection.

AuthContext

FieldTypeNotes
is_validbooleanWhether auth is valid.
account_typestringvip, svip, svip_plus, custom, trial, or unknown.
account_type_codenumberNumeric account type.
auth_scenestringAuth scene.
license_modestringonline_api_key or offline_api_key.
entitlement_statestringEntitlement state.
machine_codestringCurrent machine code; used for offline activation.
device_scope[]array{ vid: number, pid: number }.
expires_atnumberExpiration timestamp; 0 means not set.
capabilities[]string[]Methods callable by the current session.
quota_buckets[]arrayQuota bucket with bucket, methods, limit, remaining, and enforcement.

Before calling quota-limited methods, clients must use the quota_buckets[].limit and quota_buckets[].remaining values returned by the server and must not assume a fixed quota locally.

Example

json
{
  "request_id": "req-auth-001",
  "method": "auth.create_session",
  "params": {
    "token": "sk-sq-v1-..."
  }
}

CZUR Open Platform Documentation