Skip to content

Account and preferences

GET/userReturn the account associated with the token

The user model includes login, email, balance in cents, port usage and limit, discount percentage, and connection preferences.

Terminal window
curl "https://api.ltesocks.io/v2/user" \
-H "Authorization: Bearer ${LTESOCKS_API_TOKEN}"
import { LTESocksClient } from '@ltesocks/sdk';
const client = LTESocksClient.withBearerToken(
process.env.LTESOCKS_API_TOKEN,
{ language: 'en' },
);
const user = await client.user.get();
console.log(user.login);
POST/user/preferencesUpdate connection defaults

Preferences control the default VPN host, proxy host, and proxy protocol used by account tools:

{
"vpnServer": "vpn1.ltesocks.io",
"proxyServer": "ap1.ltesocks.io",
"proxyProtocol": "socks5"
}

Allowed proxy protocols in the v2 contract are http, https, and socks5. Obtain current hosts from GET /servers; do not assume the example hosts are available to every account.

const user = await client.user.updatePreferences({
body: {
vpnServer: 'vpn1.ltesocks.io',
proxyServer: 'ap1.ltesocks.io',
proxyProtocol: 'socks5',
},
});

The successful response is the updated user object. When updating preferences, send a complete set of values your integration intends to own and verify the returned object.