API Stability Long-Term

The renameWidget() GraphQL mutation may be used to rename a widget in LogScale.

For more information on dashboard widgets, see the Manage Widgets documentation page.

Syntax

Below is the syntax for the renameWidget() mutation field:

graphql
renameWidget(
     id: string!
     widgetId: string!
     title: string!
   ): Dashboard!

The id is the unique identifier for the dashboard containing the widget. The title is the new name for the widget. Below is an example of how this mutation field might be used:

Raw
graphql
mutation {
  renameWidget(
       id: "54WuhNYKS9FvFom4aNopeaMhPR96uQQO",
       widgetId: "e0d50a4a-dd8c-4516-9576-9ed9ee2ac7eb"
       title: "CPU Usage Percentage"
  )
  { name }
}
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 {
  renameWidget(
       id: \"54WuhNYKS9FvFom4aNopeaMhPR96uQQO\",
       widgetId: \"e0d50a4a-dd8c-4516-9576-9ed9ee2ac7eb\"
       title: \"CPU Usage Percentage\"
  )
  { name }
}"
}
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 {
  renameWidget(
       id: \"54WuhNYKS9FvFom4aNopeaMhPR96uQQO\",
       widgetId: \"e0d50a4a-dd8c-4516-9576-9ed9ee2ac7eb\"
       title: \"CPU Usage Percentage\"
  )
  { name }
}"
}
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 { ^
  renameWidget( ^
       id: \"54WuhNYKS9FvFom4aNopeaMhPR96uQQO\", ^
       widgetId: \"e0d50a4a-dd8c-4516-9576-9ed9ee2ac7eb\" ^
       title: \"CPU Usage Percentage\" ^
  ) ^
  { name } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  renameWidget(
       id: \"54WuhNYKS9FvFom4aNopeaMhPR96uQQO\",
       widgetId: \"e0d50a4a-dd8c-4516-9576-9ed9ee2ac7eb\"
       title: \"CPU Usage Percentage\"
  )
  { name }
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $INGEST_TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $json = '{"query" : "mutation {
  renameWidget(
       id: \"54WuhNYKS9FvFom4aNopeaMhPR96uQQO\",
       widgetId: \"e0d50a4a-dd8c-4516-9576-9ed9ee2ac7eb\"
       title: \"CPU Usage Percentage\"
  )
  { name }
}"
}';
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 {
  renameWidget(
       id: \"54WuhNYKS9FvFom4aNopeaMhPR96uQQO\",
       widgetId: \"e0d50a4a-dd8c-4516-9576-9ed9ee2ac7eb\"
       title: \"CPU Usage Percentage\"
  )
  { name }
}"
}'''

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 {
  renameWidget(
       id: \"54WuhNYKS9FvFom4aNopeaMhPR96uQQO\",
       widgetId: \"e0d50a4a-dd8c-4516-9576-9ed9ee2ac7eb\"
       title: \"CPU Usage Percentage\"
  )
  { name }
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL/graphql',
  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": {
    "renameWidget": {
      "name": "Hosts"
    }
  }
}

Returned Datatypes

Dashboard has several parameters. Below is a list of them along with a description of each:

Table: Dashboard

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Mar 28, 2025
allowedActions[AssetAction]yes PreviewThe allowed asset actions. See AssetAction Table). This is feature is a preview and may be changed.
defaultFilterDashboardFilter  Long-TermThe default filter used with the dashboard (see DashboardFilter Table).
defaultSharedTimeEnabledbooleanyes Long-TermWhether the shared time by default is enabled.
defaultSharedTimeEndstringyes Long-TermThe default shared ending time.
defaultSharedTimeStartstringyes Long-TermThe default shared starting time.
descriptionstring  Long-TermA description of the dashboard.
displayNamestringyes Long-TermThe display name of the dashboard.
filters[DashboardFilter]yes Long-TermThe filters used with the dashboard. See DashboardFilter.
idstringyes Long-TermThe unique identifier for the dashboard.
isStarredbooleanyes Long-TermWhether the dashboard is marked with a star.
labels[string]yes Long-TermAny labels associated with the dashboard.
namestringyes Long-TermThe name of the dashboard.
packagePackageInstallationyes Long-TermThe package, if there is one, in which the dashboard is included (see PackageInstallation Table).
packageIdVersionedPackageSpecifieryes Long-TermThe unique identifiers of the package. VersionedPackageSpecifier is a scalar.
parameters[DashboardParameter]yes Long-TermList of dashboard parameters (see DashboardParameter Table).
readOnlyTokens[DashboardLink]yes Long-TermList of tokens used to access the dashboard without logging in. Useful for wall mounted dashboards or public dashboards. See DashboardLink.
resourcestringyes Short-TermThe resource identifier for this dashboard.
searchDomainSearchDomainyes Long-TermThe search domain for the dashboard. See SearchDomain.
sections[Section]yes Long-TermThe sections for the dashboard. See Section.
yamlTemplatestringyes Long-TermA YAML formatted string that describes the dashboard. It does not contain links or permissions, and is safe to share and use for making copies of a dashboard. This replaced templateYaml starting in LogScale version 1.165.
timeJumpSizeInMsinteger  Long-TermThe skip time in milliseconds for the dashboard.
updateFrequencyDashboardUpdateFrequencyTypeyes Long-TermThe frequency in which dashboard is updated. See the explanations under the DashboardParameter.
widgets[Widget]yes Long-TermWidgets for the dashboard (see Widget Table).