Summary

The updateSettings() mutation sets flags for user interface states and help messages for the current user. Use it to persist UI preferences such as the active theme, default time zone, event list order, and which onboarding messages to dismiss. To read the current values before updating, use the viewer() query.

Syntax

graphql
updateSettings(
      isWelcomeMessageDismissed: Boolean,
      isGettingStartedMessageDismissed: Boolean,
      isCommunityMessageDismissed: Boolean,
      isPackageDocsMessageDismissed: Boolean,
      isEventListOrderedWithNewestAtBottom: Boolean,
      isFieldPanelOpenByDefault: Boolean,
      automaticallySearch: Boolean,
      automaticallyHighlighting: Boolean,
      uiTheme: UiTheme,
      isDarkModeMessageDismissed: Boolean,
      isResizableQueryFieldMessageDismissed: Boolean,
      featureAnnouncementsToDismiss: [FeatureAnnouncement!],
      defaultTimeZone: String
   ): UserSettings!

All parameters are optional. Supply any combination to update the corresponding settings for the current user. The mutation returns a non-null UserSettings object reflecting the updated state. The featureAnnouncementsToDismiss parameter accepts a list of non-null FeatureAnnouncement enum values. The uiTheme parameter accepts a UiTheme enum value.

Example

Raw
graphql
mutation {
  updateSettings( 
    defaultTimeZone: "UTC-5"
  ) 
  { defaultTimeZone }
}
Mac OS or Linux (curl)
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  updateSettings( 
    defaultTimeZone: \"UTC-5\"
  ) 
  { defaultTimeZone }
}"
}
EOF
Mac OS or Linux (curl) One-line
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  updateSettings( 
    defaultTimeZone: \"UTC-5\"
  ) 
  { defaultTimeZone }
}"
}
EOF
Windows Cmd and curl
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json" ^
    -d @'{"query" : "mutation { ^
  updateSettings(  ^
    defaultTimeZone: \"UTC-5\" ^
  )  ^
  { defaultTimeZone } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  updateSettings( 
    defaultTimeZone: \"UTC-5\"
  ) 
  { defaultTimeZone }
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $query = "mutation {
  updateSettings( 
    defaultTimeZone: \"UTC-5\"
  ) 
  { defaultTimeZone }
}";
$query =~ s/\n/ /g;
my $json = sprintf('{"query" : "%s"}',$query);
my $req = HTTP::Request->new("POST", $uri );

$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");

$req->content( $json );

my $lwp = LWP::UserAgent->new;

my $result = $lwp->request( $req );

print $result->{"_content"},"\n";
Python
python
#! /usr/local/bin/python3

import requests

url = '$YOUR_LOGSCALE_URL/graphql'
mydata = r'''{"query" : "mutation {
  updateSettings( 
    defaultTimeZone: \"UTC-5\"
  ) 
  { defaultTimeZone }
}"
}'''

resp = requests.post(url,
                     data = mydata,
                     headers = {
   "Authorization" : "Bearer $TOKEN",
   "Content-Type" : "application/json"
}
)

print(resp.text)
Node.js
javascript
const https = require('https');

const data = JSON.stringify(
    {"query" : "mutation {
  updateSettings( 
    defaultTimeZone: \"UTC-5\"
  ) 
  { defaultTimeZone }
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL',
  path: 'graphql',
  port: 443,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Authorization: 'BEARER ' + process.env.TOKEN,
    'User-Agent': 'Node',
  },
};

const req = https.request(options, (res) => {
  let data = '';
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    data += d;
  });
  res.on('end', () => {
    console.log(JSON.parse(data).data);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();
Example Responses
Success (HTTP Response Code 200 OK)
json
{
  "data": {
    "updateSettings": {
      "defaultTimeZone": "UTC-2"
    }
  }
}

Input Parameters

All parameters are optional. Omitting a parameter leaves the corresponding setting unchanged. The table below describes each available parameter.

Table: Input Parameters and Datatypes

Parameter Type Required Default Description
This table contains all input parameters for this mutation. Additional tables for the special datatypes follow.
isWelcomeMessageDismissed Boolean     Set to true to mark the welcome message as dismissed. The welcome message does not appear again after dismissal.
isGettingStartedMessageDismissed Boolean     Set to true to mark the getting started message as dismissed.
isCommunityMessageDismissed Boolean     Set to true to mark the community message as dismissed.
isPackageDocsMessageDismissed Boolean     Deprecated. This parameter has no effect and will be removed from version 1.225 at the earliest.
isEventListOrderedWithNewestAtBottom Boolean     Set to true to display events in the event list with the newest event at the bottom. Set to false to display the newest event at the top.
isFieldPanelOpenByDefault Boolean     Set to true to open the field panel automatically when a search loads.
automaticallySearch Boolean     Set to true to run a search automatically when you open a repository or change the time range.
automaticallyHighlighting Boolean     Set to true to enable automatic syntax highlighting in the query editor.
uiTheme UiTheme     The user interface theme to apply. For available values, see ???.
isDarkModeMessageDismissed Boolean     Deprecated. This parameter has no effect and will be removed from version 1.225 at the earliest.
isResizableQueryFieldMessageDismissed Boolean     Deprecated. This parameter has no effect and will be removed from version 1.225 at the earliest.
featureAnnouncementsToDismiss [FeatureAnnouncement!]     A list of feature announcements to mark as dismissed. Each element must be a non-null FeatureAnnouncement enum value. For available values, see ???.
defaultTimeZone String     The default time zone for the user. Enter a valid IANA time zone identifier, for example America/New_York or UTC.

The featureAnnouncementsToDismiss parameter accepts an enumerated list of FeatureAnnouncement identifiers:

The uiTheme parameter accepts a UiTheme enum value:

Returned Values

The mutation returns a non-null UserSettings object. The returned object reflects the user's full settings state after the update, including UI theme, default time zone, event list order, field panel state, and dismissed message flags.

Table: UserSettings Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
defaultTimeZoneString  Long-Term Default timezone preference for user. If not set, the default timezone is no longer taken from the organization.
featureAnnouncementsToShowFeatureAnnouncementyes Short-Term List of feature announcements to show. See FeatureAnnouncement. This is a preview and subject to change.
isAutomaticHighlightingEnabledBooleanyes Short-Term Whether automatic highlighting on the search page is enabled. This is a preview and subject to change.
isAutomaticSearchEnabledBooleanyes Short-Term Whether the automatic search been enabled.
isCommunityMessageDismissedBooleanyes Short-Term Whether the community message has been dismissed.
isDarkModeMessageDismissedBooleanyes Short-Termdeprecated in 1.225Whether the dark-mode message has been dismissed.
isEventListOrderedWithNewestAtBottomBooleanyes Short-Term Whether there is an event list, ordered with newest last.
isFieldPanelOpenByDefaultBooleanyes Short-Term Whether the field panel is open by default.
isGettingStartedMessageDismissedBooleanyes Short-Term Whether the 'Getting Started' message has been dismissed.
isPackageDocsMessageDismissedBooleanyes Short-Termdeprecated in 1.225Whether the package documentation message has been dismissed.
isQuickStartCompletedBooleanyes Long-Term Whether the quick start has been completed.
isWelcomeMessageDismissedBooleanyes Short-Term Whether the welcome message has been dismissed.
starredDashboardsStringyes Long-Term List of dashboards that have been marked with a star.
starredSearchDomainsStringyes Long-Term List of searchdomains that have been marked with a star.
uiThemeUiThemeyes Long-Term The user interface theme choice. See UiTheme.