The updatePersistedAggregationMetadata() GraphQL mutation is used to update metadata of an existing persisted aggregation (e.g., name, description, labels).

To create a new persisted aggregation, use the createPersistedAggregation() mutation. To enable and disable a persisted aggregation, use the enablePersistedAggregation() and disablePersistedAggregation() mutations. To make changes to a persisted aggregation, use updatePersistedAggregation(). To delete one, use deletePersistedAggregation(). To get a list of all persisted aggregations accessible, use the persistedAggregations() query.

Stability Level Preview

Syntax

graphql
updatePersistedAggregationMetadata(
     input: UpdatePersistedAggregationMetadataInput!
   ): PersistedAggregation!

For the input, you'll have to give the unique identifier of the persisted aggregation to change (use persistedAggregations() to get the identifier). You'll also have to enter what you want to change: the name, descripton, or all of the labels. See the Given Datatype section for details.

For the results, you can get the name, description, and the labels — the values you may have or didn't change — as well as a few other items. See the Returned Datatype section. It returns FieldValidationException on validation errors.

Example

Raw
graphql
mutation {
  updatePersistedAggregationMetadata(
    input: { id: "abc123",
             name: "per-sister" }
  ) { id }
}
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 {
  updatePersistedAggregationMetadata(
    input: { id: \"abc123\",
             name: \"per-sister\" }
  ) { id }
}"
}
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 {
  updatePersistedAggregationMetadata(
    input: { id: \"abc123\",
             name: \"per-sister\" }
  ) { id }
}"
}
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 { ^
  updatePersistedAggregationMetadata( ^
    input: { id: \"abc123\", ^
             name: \"per-sister\" } ^
  ) { id } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  updatePersistedAggregationMetadata(
    input: { id: \"abc123\",
             name: \"per-sister\" }
  ) { id }
}"
}'
    "$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 {
  updatePersistedAggregationMetadata(
    input: { id: \"abc123\",
             name: \"per-sister\" }
  ) { id }
}";
$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 {
  updatePersistedAggregationMetadata(
    input: { id: \"abc123\",
             name: \"per-sister\" }
  ) { id }
}"
}'''

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 {
  updatePersistedAggregationMetadata(
    input: { id: \"abc123\",
             name: \"per-sister\" }
  ) { id }
}"
}
);


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": {
    "updatePersistedAggregationMetadata": {
      "id": "abc123"
    }
  }
}

Given Datatype

For the input datatype, you'll have to provide the unique identifier of the persisted aggregation to change. You can first use the persistedAggregations() query to get the identifier. You'll also have to enter what you want to change: the name, descripton, or labels. Whatever you don't enter, won't be changed. As for labels, to make a change, you have to give a complete list; you can't add or delete one and leave the others in place.

Table: UpdatePersistedAggregationMetadataInput

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For return datatypes, this indicates that you must specify which fields you want returned in the results.
Table last updated: Apr 6, 2026
descriptionstring  PreviewA new description with a maximum of 1024 characters. If not provided, the description is unchanged.
idstringyes PreviewThe unique identifier of the persisted aggregation to change.
labels[string]  PreviewA list of replacement labels, which are non-empty, contain only no more than sixty-four alphanumeric characters, spaces, hyphens, or underscores.
namestring  PreviewThe name for the persisted aggregation. Must start with an alphanumeric character, but can also contain spaces, hyphens, and underscores — for a maximum of 128 characters.

Returned Datatype

For the returned datatype, you may want to get the parameters you did't change (i.e., the name, description, or labels). There are a few other parameters you can get. They're listed in the table below:

Table: PersistedAggregation

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For return datatypes, this indicates that you must specify which fields you want returned in the results.
Table last updated: Mar 30, 2026
descriptionstring  PreviewThe description of the persisted aggregation.
enabledbooleanyes PreviewWhether the persisted aggregation is enabled.
idstringyes PreviewThe unique identifier of the persisted aggregation.
labels[string]yes PreviewThe labels associated with the aggregation.
namestringyes PreviewThe name of the persisted aggregation.
queryOwnershipTypestringyes PreviewThe ownership type of the query.
queryStringstringyes PreviewThe query string for the aggregation.
schedulePersistedAggregationScheduleyes PreviewThe schedule configuration for the aggregation. See PersistedAggregationSchedule.
viewNamestringyes PreviewThe name of the view to which the persisted aggregation belongs.