Settings
Manage your general account settings including language, timezone, discoverability, and data saver preferences.
account.settings()
Get your current account settings. Uses the v1.1 account/settings endpoint.
const settings = await client.account.settings();
console.log(settings.screen_name);
console.log(settings.language);
console.log(settings.time_zone);account.updateSettings(params?)
Update your account settings. Uses the v1.1 account/settings endpoint (POST).
| Param | Type | Description |
|---|---|---|
params.language | string | Language code (e.g. "en", "ja") |
params.time_zone | string | Timezone name (e.g. "US/Eastern") |
params.sleep_time_enabled | boolean | Enable quiet hours |
params.start_sleep_time | number | Quiet hours start (0–23) |
params.end_sleep_time | number | Quiet hours end (0–23) |
params.trend_location_woeid | number | Trend location WOEID |
params.discoverable_by_email | boolean | Allow others to find you by email |
params.discoverable_by_phone | boolean | Allow others to find you by phone |
await client.account.updateSettings({
language: "en",
time_zone: "America/New_York",
discoverable_by_email: false,
discoverable_by_phone: false,
});Quiet Hours
Suppress notifications during specific hours:
await client.account.updateSettings({
sleep_time_enabled: true,
start_sleep_time: 23,
end_sleep_time: 7,
});account.dataSaverMode(deviceId?)
Get the data saver settings of a device, or null when the device has none. Data saver is per device, and deviceId defaults to "Mac/Chrome". Uses the GraphQL dataUsageSettingsQuery.
const mode = await client.account.dataSaverMode();account.setDataSaver(enabled, opts?)
Turn data saver on or off for a device and set video autoplay. Uses the GraphQL dataUsageSettingsMutation.
| Param | Type | Description |
|---|---|---|
enabled | boolean | Data saver on or off |
opts.deviceId | string | Device ID, defaults to "Mac/Chrome" |
opts.videoAutoplay | string | Autoplay mode, defaults to "WifiOnly" |
await client.account.setDataSaver(true);account.helpSettings()
Get help and support settings. Uses the v1.1 help/settings endpoint.
const help = await client.account.helpSettings();account.rateLimitStatus(params?)
Check your current rate limit status across API endpoints. Uses the v1.1 application/rate_limit_status endpoint.
Deprecated
The web client no longer calls application/rate_limit_status.
| Param | Type | Description |
|---|---|---|
params.resources | string | Comma-separated resource families to check |
// Check all rate limits
const limits = await client.account.rateLimitStatus();
// Check specific resource families
const specific = await client.account.rateLimitStatus({
resources: "statuses,friends,followers",
});account.emailNotificationSettings(settings?)
Update email notification settings. Pass the send_* flags to change. Uses the GraphQL email_notificationsMutation.
await client.account.emailNotificationSettings({ send_twitter_emails: false });account.viewerEmailSettings()
Get the email notification settings as send_* flags. Uses the GraphQL email_notificationsQuery.
const emailSettings = await client.account.viewerEmailSettings();account.multiList()
List all accounts in your multi-account session. Uses the v1.1 account/multi/list endpoint.
const accounts = await client.account.multiList();account.switchAccount(userId)
Switch the multi-account session to another account. Uses the v1.1 account/multi/switch endpoint.
await client.account.switchAccount("1234567890");account.logout()
Log out the current session. Uses the v1.1 account/logout endpoint.
await client.account.logout();account.logoutAll()
Log out every account in the multi-account session. Uses the v1.1 account/multi/logout_all endpoint.
await client.account.logoutAll();About your account
account.aboutYourAccount()
Get the "about your account" settings: how your location shows and your business country. Uses the GraphQL about_your_accountQuery.
account.setAboutYourAccount({ aboutThisAccount?, inferredLocation? })
Update the "about your account" settings. Uses the GraphQL about_your_accountMutation.
await client.account.setAboutYourAccount({ inferredLocation: "Country" });Parody label
account.parodyLabel()
Get your parody, commentary or fan label and whether X lets you change it.
account.setParodyLabel(label)
Set the label to "ParodyAccount", "CommentaryAccount", "FanAccount" or "None". Uses the GraphQL AccountParodyUpdateLabelMutation.
Audience and tagging
account.audienceAndTagging()
Get whether others can download your videos, plus your birthdate. Uses the GraphQL AudienceAndTaggingQuery.
account.setVideoDownloads(isAllowed)
Allow or block downloads of your videos. Uses AudienceAndTaggingAllowVideoDownloadsMutation.
Languages and translation
account.languages()
Get your display language and preferred content languages. Uses the GraphQL languagesQuery.
account.autoTranslate(language?)
Get whether posts in a language are translated automatically. language defaults to "en".
account.setAutoTranslate(language, enable)
Turn automatic translation on or off for a language. Uses the GraphQL autoTranslateSettingsButtonSaveMutation.
Profile customization
account.hideSubscriptions()
Get whether your creator subscriptions are hidden on your profile.
account.setHideSubscriptions(hide)
Hide or show your creator subscriptions on your profile. Uses the GraphQL profile_customizationMutation.
account.setExpandedBioVisibility(sectionId, visibility)
Set who can see a section of your expanded bio: "public", "followers", "following", "mutualfollow" or "self".
Grok
account.grokSettings()
Get your Grok memory, personalization and xAI data sharing settings.
account.setGrokSettings({ allowGrokMemory?, allowXaiDataSharing?, allowXaiPersonalization? })
Update your Grok settings. Uses the GraphQL grokSettingsPreferencesMutation.
Push notifications
Push settings belong to a registered web push device, so both methods take the device's { endpoint, keys, device?, locale? }.
account.pushSettings(device)
Get the device's push settings and the settings template through notifications/settings/checkin.
account.setPushSettings(device, settings)
Save push settings for the device through notifications/settings/save.
const { push_settings } = await client.account.pushSettings(device);
await client.account.setPushSettings(device, { ...push_settings, mentions: "off" });account.deactivate()
Deactivate your account. Uses the v1.1 account/deactivate endpoint.
Danger
This will deactivate your account. You have 30 days to reactivate before permanent deletion.
await client.account.deactivate();Full example
// Check your current settings
const settings = await client.account.settings();
console.log(`Language: ${settings.language}`);
console.log(`Timezone: ${settings.time_zone}`);
// Update language and timezone
await client.account.updateSettings({
language: "en",
time_zone: "America/New_York",
});
// Disable discoverability
await client.account.updateSettings({
discoverable_by_email: false,
discoverable_by_phone: false,
});
// Enable quiet hours overnight
await client.account.updateSettings({
sleep_time_enabled: true,
start_sleep_time: 23,
end_sleep_time: 7,
});
// Toggle data saver mode
const mode = await client.account.dataSaverMode();
await client.account.setDataSaver(true);
// Check rate limits before a batch operation
const limits = await client.account.rateLimitStatus({
resources: "statuses,friends",
});
// Manage email notification preferences
const emailSettings = await client.account.viewerEmailSettings();
await client.account.emailNotificationSettings({
setting: "email_new_follower",
enabled: false,
});
// View all accounts in multi-account session
const accounts = await client.account.multiList();