API Stability Long-Term

The addLimitV2() GraphQL mutation is used to add a limit to a given organization. This replaces addLimit(), which is deprecated.

For more information on query quotas, see the Query Quotas documentation page. You may also want to look at Limits and Standards for related information.

Syntax

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

graphql
addLimitV2(
      input: AddLimitV2Input!
    ): LimitV2!

In the syntax above, you would replace AddLimitV2Input with arguments required or allowed by that input definition (see the table below). A boolean value is always returned that your API client may capture and use.

Below is an example of how this mutation field might be used:

Raw
graphql
mutation {
  addLimitV2(input: 
       {limitName: "limiter1", 
        allowLogin: true, allowSelfService: true,
        allowFlightControl: true,
        dailyIngest: 1000, retention: 1000,
        dailyIngestContractualType: Limited,
        dailyScanContractualType: Limited,
        storageContractualType: Limited,
        measurementType: SegmentWriteSize,
        maxRetention: 1000
        dateType: "date",
        trial: false
      } )
  {id, limitName, storageLimit{includeUsage} }
}
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 {
  addLimitV2(input: 
       {limitName: \"limiter1\", 
        allowLogin: true, allowSelfService: true,
        allowFlightControl: true,
        dailyIngest: 1000, retention: 1000,
        dailyIngestContractualType: Limited,
        dailyScanContractualType: Limited,
        storageContractualType: Limited,
        measurementType: SegmentWriteSize,
        maxRetention: 1000
        dateType: \"date\",
        trial: false
      } )
  {id, limitName, storageLimit{includeUsage} }
}"
}
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 {
  addLimitV2(input: 
       {limitName: \"limiter1\", 
        allowLogin: true, allowSelfService: true,
        allowFlightControl: true,
        dailyIngest: 1000, retention: 1000,
        dailyIngestContractualType: Limited,
        dailyScanContractualType: Limited,
        storageContractualType: Limited,
        measurementType: SegmentWriteSize,
        maxRetention: 1000
        dateType: \"date\",
        trial: false
      } )
  {id, limitName, storageLimit{includeUsage} }
}"
}
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 { ^
  addLimitV2(input:  ^
       {limitName: \"limiter1\",  ^
        allowLogin: true, allowSelfService: true, ^
        allowFlightControl: true, ^
        dailyIngest: 1000, retention: 1000, ^
        dailyIngestContractualType: Limited, ^
        dailyScanContractualType: Limited, ^
        storageContractualType: Limited, ^
        measurementType: SegmentWriteSize, ^
        maxRetention: 1000 ^
        dateType: \"date\", ^
        trial: false ^
      } ) ^
  {id, limitName, storageLimit{includeUsage} } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  addLimitV2(input: 
       {limitName: \"limiter1\", 
        allowLogin: true, allowSelfService: true,
        allowFlightControl: true,
        dailyIngest: 1000, retention: 1000,
        dailyIngestContractualType: Limited,
        dailyScanContractualType: Limited,
        storageContractualType: Limited,
        measurementType: SegmentWriteSize,
        maxRetention: 1000
        dateType: \"date\",
        trial: false
      } )
  {id, limitName, storageLimit{includeUsage} }
}"
}'
    "$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 {
  addLimitV2(input: 
       {limitName: \"limiter1\", 
        allowLogin: true, allowSelfService: true,
        allowFlightControl: true,
        dailyIngest: 1000, retention: 1000,
        dailyIngestContractualType: Limited,
        dailyScanContractualType: Limited,
        storageContractualType: Limited,
        measurementType: SegmentWriteSize,
        maxRetention: 1000
        dateType: \"date\",
        trial: false
      } )
  {id, limitName, storageLimit{includeUsage} }
}";
$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 {
  addLimitV2(input: 
       {limitName: \"limiter1\", 
        allowLogin: true, allowSelfService: true,
        allowFlightControl: true,
        dailyIngest: 1000, retention: 1000,
        dailyIngestContractualType: Limited,
        dailyScanContractualType: Limited,
        storageContractualType: Limited,
        measurementType: SegmentWriteSize,
        maxRetention: 1000
        dateType: \"date\",
        trial: false
      } )
  {id, limitName, storageLimit{includeUsage} }
}"
}'''

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 {
  addLimitV2(input: 
       {limitName: \"limiter1\", 
        allowLogin: true, allowSelfService: true,
        allowFlightControl: true,
        dailyIngest: 1000, retention: 1000,
        dailyIngestContractualType: Limited,
        dailyScanContractualType: Limited,
        storageContractualType: Limited,
        measurementType: SegmentWriteSize,
        maxRetention: 1000
        dateType: \"date\",
        trial: false
      } )
  {id, limitName, storageLimit{includeUsage} }
}"
}
);


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": {
    "addLimitV2": {
      "id": "8uB9I1pJVtPJ36M0snB3Wx2B",
      "limitName": "limiter1",
      "storageLimit": {
        "includeUsage": true
      }
    }
  }
}

Given Datatypes

For AddLimitV2Input, there are several parameters that may be given. Below is a list of them along with their data type and a description of each:

Table: AddLimitV2Input

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: Aug 21, 2025
allowFlightControlbooleanyes Long-TermWhether flight control is allowed.
allowLoginbooleanyes Long-TermWhether the limit allows logging in.
allowSelfServicebooleanyes Long-TermWhether the limit allows self-service.
dailyIngestlong  Long-TermThe daily ingest allowed for the limit.
dailyIngestContractualTypeOrganizations__ContractualTypeyes Long-TermThe daily ingest contractual type. See Organizations__ContractualType.
dailyScanlong  Long-TermThe daily scan.
dailyScanContractualTypeOrganizations__ContractualTypeyes Long-TermThe daily scan contratual type. See Organizations__ContractualType.
dateTypestringyes Long-TermThe data type.
expirationlong  Long-TermThe expiration date for the limit.
limitNamestringyes Long-TermThe name of the limit to add.
maxRetentionintegeryes Long-TermMaximum amount of retention.
measurementTypeOrganizations__MeasurementTypeyes Long-TermThe measurement type. See Organizations__MeasurementType.
repositoryLimitinteger  Long-TermThe repository limit.
retentionintegeryes Long-TermThe retention in days allowed for the limit.
storageContractualTypeOrganizations__ContractualTypeyes Long-TermThe storage contratual type. See Organizations__ContractualType.
trialbooleanyes Long-TermWhether it's subject to trial.
userLimitinteger  Long-TermThe limit for users.

Returned Data Types

For LimitV2 returns several parameters. They're described below:

Table: LimitV2

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: Jun 26, 2025
allowFlightControlbooleanyes Long-TermWhether the customer is allowed flight control.
allowLoginbooleanyes Long-TermWhether the limit allows logging in.
allowSelfServicebooleanyes Long-TermWhether the limit allows self service.
dailyIngestcontractualyes Long-TermThe daily ingest allowed for the limit.
dataScannedLimitcontractualyes Long-TermThe data scanned measurement allowed for the limit. See Limited.
dataTypestringyes Long-TermData type for the limit, all repositories linked to the limit will get this datatype logged in usage.
deletedDatelong  Long-TermThe deleted date for the limit.
displayNamestringyes Long-TermThe display name of the limit.
expirationDatelong  Long-TermThe expiration date for the limit.
idstringyes Long-TermThe unique identifier of the limit.
limitNamestringyes Long-TermThe name of the limit.
maxRetentionintegeryes Long-TermThe max retention in days allowed for the limit, this can be greater than or equal to retention.
measurementPointOrganizations__MeasurementTypeyes Long-TermThe usage measurement type used for the limit. See Organizations__MeasurementType.
repoLimitinteger  Long-TermThe number of repositories allowed for the limit.
repositories[Repository]yes Long-TermThe repositories related to the limit. See Repository.
retentionintegeryes Long-TermThe retention in days allowed for the limit, that's the contracted value.
storageLimitcontractualyes Long-TermThe amount of storage allowed for the limit. See Limited.
trialbooleanyes Long-TermWhether the limit is a trial.
userLimitcontractualyes Long-TermThe user seats allowed for the limit. See Limited.