Summary

The languageRestrictionsEnable() mutation enables or disables language restrictions for a specified query language version. Language restrictions define an allow list of permitted functions for a version. When restrictions are enabled for a version, LogScale enforces that allow list: queries running under that version can call only the listed functions. When restrictions are disabled, all functions are available regardless of the allow list. This mutation is typically used by administrators to lock down or restore function access for a specific version across all users.

To inspect the current restriction state and allow list for a version before modifying it, use the languageRestrictions() query.

API Stability Short-Term

Syntax

graphql
languageRestrictionsEnable(
      input: EnabledInput!
   ): Boolean!

The mutation accepts a required input argument of type EnabledInput. The version field identifies the query language version whose restriction state to change. The enabled flag sets the new state: pass true to enforce the function allow list for that version, or false to remove that enforcement. The mutation returns a non-null Boolean!: true if the operation succeeded, or false if it did not.

Example

Raw
graphql
mutation {
  languageRestrictionsEnable ( input: 
    { version: legacy,
      enabled: true }
  )
}
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 {
  languageRestrictionsEnable ( input: 
    { version: legacy,
      enabled: true }
  )
}"
}
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 {
  languageRestrictionsEnable ( input: 
    { version: legacy,
      enabled: true }
  )
}"
}
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 { ^
  languageRestrictionsEnable ( input:  ^
    { version: legacy, ^
      enabled: true } ^
  ) ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  languageRestrictionsEnable ( input: 
    { version: legacy,
      enabled: true }
  )
}"
}'
    "$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 {
  languageRestrictionsEnable ( input: 
    { version: legacy,
      enabled: true }
  )
}";
$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 {
  languageRestrictionsEnable ( input: 
    { version: legacy,
      enabled: true }
  )
}"
}'''

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 {
  languageRestrictionsEnable ( input: 
    { version: legacy,
      enabled: true }
  )
}"
}
);


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": {
    "languageRestrictionsEnable": true
  }
}

Input Parameters

Provide the query language version to target and the restriction state to apply. Set version to one of the LanguageVersionEnum values (for example, legacy, xdr1, or xdrdetects1). Set enabled to true to activate the allow list for that version, which limits available functions to those explicitly permitted. Set it to false to deactivate restrictions, making all functions available for that version. Both fields are required.

Table: EnabledInput Input Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
Some input parameters may be required, as indicated in the Required column. For return values, this indicates that you are assured a value if the field is requested for the results. 
Table last updated: Oct 14, 2026 
enabledBooleanyes Preview Whether it's enabled or not.
versionLanguageVersionEnumyes Preview The version of Human language to use: legacy, xdr1, or xdrdetects1. If non-null, it will be a version known by the current LogScale installation. See LanguageVersionEnum Table.

Returned Values

The mutation returns a non-null Boolean!. A return value of true confirms that the restriction state was successfully updated for the specified version. A return value of false indicates the operation did not complete. To verify the updated state, run the languageRestrictions() query and check the enabled field on the returned object.