API Stability Long-Term

The createScheduledSearchV2() GraphQL mutation field is used to create a scheduled search. This replaces createScheduledSearch(), which is deprecated.

Syntax

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

graphql
createScheduledSearchV2(
       input: CreateScheduledSearchV2!
    ): ScheduledSearch!

Example

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

Raw
graphql
mutation {
  createScheduledSearchV2( input:
    { viewName: "humio",
      name: "mySearch",
      queryString: "@host=localhost",
      searchIntervalSeconds: 10,
      schedule: "15 1 * * *",
      timeZone: "UTC+2",
      enabled: true,
      actionIdsOrNames: [],
      queryOwnershipType: User,
      queryTimestampType: EventTimestamp
    }
  )
 { 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 {
  createScheduledSearchV2( input:
    { viewName: \"humio\",
      name: \"mySearch\",
      queryString: \"@host=localhost\",
      searchIntervalSeconds: 10,
      schedule: \"15 1 * * *\",
      timeZone: \"UTC+2\",
      enabled: true,
      actionIdsOrNames: [],
      queryOwnershipType: User,
      queryTimestampType: EventTimestamp
    }
  )
 { 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 {
  createScheduledSearchV2( input:
    { viewName: \"humio\",
      name: \"mySearch\",
      queryString: \"@host=localhost\",
      searchIntervalSeconds: 10,
      schedule: \"15 1 * * *\",
      timeZone: \"UTC+2\",
      enabled: true,
      actionIdsOrNames: [],
      queryOwnershipType: User,
      queryTimestampType: EventTimestamp
    }
  )
 { 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 { ^
  createScheduledSearchV2( input: ^
    { viewName: \"humio\", ^
      name: \"mySearch\", ^
      queryString: \"@host=localhost\", ^
      searchIntervalSeconds: 10, ^
      schedule: \"15 1 * * *\", ^
      timeZone: \"UTC+2\", ^
      enabled: true, ^
      actionIdsOrNames: [], ^
      queryOwnershipType: User, ^
      queryTimestampType: EventTimestamp ^
    } ^
  ) ^
 { id } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  createScheduledSearchV2( input:
    { viewName: \"humio\",
      name: \"mySearch\",
      queryString: \"@host=localhost\",
      searchIntervalSeconds: 10,
      schedule: \"15 1 * * *\",
      timeZone: \"UTC+2\",
      enabled: true,
      actionIdsOrNames: [],
      queryOwnershipType: User,
      queryTimestampType: EventTimestamp
    }
  )
 { 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 {
  createScheduledSearchV2( input:
    { viewName: \"humio\",
      name: \"mySearch\",
      queryString: \"@host=localhost\",
      searchIntervalSeconds: 10,
      schedule: \"15 1 * * *\",
      timeZone: \"UTC+2\",
      enabled: true,
      actionIdsOrNames: [],
      queryOwnershipType: User,
      queryTimestampType: EventTimestamp
    }
  )
 { 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 {
  createScheduledSearchV2( input:
    { viewName: \"humio\",
      name: \"mySearch\",
      queryString: \"@host=localhost\",
      searchIntervalSeconds: 10,
      schedule: \"15 1 * * *\",
      timeZone: \"UTC+2\",
      enabled: true,
      actionIdsOrNames: [],
      queryOwnershipType: User,
      queryTimestampType: EventTimestamp
    }
  )
 { 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 {
  createScheduledSearchV2( input:
    { viewName: \"humio\",
      name: \"mySearch\",
      queryString: \"@host=localhost\",
      searchIntervalSeconds: 10,
      schedule: \"15 1 * * *\",
      timeZone: \"UTC+2\",
      enabled: true,
      actionIdsOrNames: [],
      queryOwnershipType: User,
      queryTimestampType: EventTimestamp
    }
  )
 { 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": {
    "createScheduledSearchV2": {
      "id": "abc123"
    }
  }
}

Given Datatypes

For CreateScheduledSearchV2, there are several parameters. Below is a list of them:

Table: CreateScheduledSearchV2

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: Dec 23, 2025
actionIdsOrNames[string]yes Long-TermA list of identifiers or names for actions to fire on query result. No more than ten actions can be added. Actions in packages can be referred to as packagescope/packagename:actionname.
backfillLimitintegeryes Long-TermUser-defined limit, which caps the number of missed searches to backfill (e.g., in the event of a shutdown). This is only allowed when queryTimestampType is set to EventTimestamp, where it's mandatory.
descriptionstring  Long-TermDescription of the scheduled search.
enabledboolean trueLong-TermFlag indicating whether the scheduled search is enabled.
labels[string] [ ]Long-TermLabels attached to the scheduled search.
maxWaitTimeSecondslong  Long-TermThe maximum number of seconds to wait for ingest delay and query warnings. Only allowed when queryTimestamp is IngestTimestamp where it's mandatory.
namestringyes Long-TermThe name of the scheduled search.
queryOwnershipTypeQueryOwnershipTypeyes Long-TermThe ownership of the query run by this scheduled search. If value is User, ownership will be based on the runAsUserId field. See QueryOwnershipType.
queryStringstringyes Long-TermThe LogScale query to execute.
queryTimestampTypeQueryTimestampTypeyes Long-TermThe timestamp type to use for the query. QueryTimestampType.
runAsUserIdstring  Long-TermThe scheduled search will run with the permissions of the user corresponding to this unique identifier if the queryOwnershipType field is set to User. If it's set to Organization, while runAsUserId is set, it will result in an error. If not specified, the scheduled search will run with the permissions of the calling user. The ChangeTriggersToRunAsOtherUsers permission is required to set this field to a different user other than the calling user.
schedulestringyes Long-TermCron pattern describing the schedule on which to execute the query.
searchIntervalOffsetSecondslong  Long-TermThe offset of the search interval in seconds. This is only allowed when queryTimestampType is set to EventTimestamp, where it's mandatory.
searchIntervalSecondslongyes Long-TermThe search interval in seconds.
timeZonestringyes Long-TermTime zone of the schedule. Currently, this field only supports UTC offsets (i.e., 'UTC', 'UTC-01' or 'UTC+12:45').
triggerOnEmptyResultboolean falseLong-TermWhether the scheduled search should trigger when it finds en empty result (i.e., no events).
viewNamestringyes Long-TermThe name of the view of the scheduled search.

Returned Datatypes

For ScheduledSearch, there are also several parameters. Below is a list of them:

Table: ScheduledSearch

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: Jan 19, 2026
actions[string]yes Long-TermList of unique identifiers for actions to fire on query result.
actionsV2[Action]yes Long-TermList of actions to fire on query result. See Action.
allowedActions[AssetAction]yes Short-TermThe allowed asset actions. See AssetAction .
backfillLimitinteger  DeprecatedUser-defined limit, which caps the number of missed searches to backfill (e.g., in the event of a shutdown). This option is deprecated and will be removed at the earliest in version 1.231. Use instead backfillLimitV2.
backfillLimitV2integer  Long-TermUser-defined limit, which caps the number of missed searches to backfill when queryTimestampType is EventTimestamp.
createdInfoAssetCommitMetadata  Long-TermMetadata related to the creation of the scheduled search. See AssetCommitMetadata.
descriptionstring  Long-TermA description of the scheduled search.
enabledbooleanyes Long-TermWhether the scheduled search is enabled.
endstringyes DeprecatedThe end of the relative time interval for the query. This parameter is deprecated and will be removed at the earliest in version 1.231. Use instead searchIntervalOffsetSeconds.
idstringyes Long-TermThe unique identifier of the scheduled search.
labels[string]yes Long-TermThe labels added to the scheduled search.
lastErrorstring  Long-TermThe last error encountered while running the search.
lastExecutedlong  DeprecatedUnix timestamp for end of search interval for last query execution. However, this parameter has been deprecated because the name is confusing. It will be removed at the earliest in version 1.27. Use instead the timeOfLastExecution parameter.
lastTriggeredlong  DeprecatedUnix timestamp for end of search interval for last query execution that triggered. However, this parameter has been deprecated because the name is confusing. It will be removed at the earliest in version 1.27. Use instead the timeOfLastTrigger parameter.
lastWarnings[string]yes Long-TermThe Last warnings encountered while running the scheduled search.
maxWaitTimeSecondslong  Long-TermThe maximum wait time in seconds when queryTimestampType is IngestTimestamp.
modifiedInfoModifiedInfoyes PreviewUser or token used to modify the asset. See ModifiedInfo.
namestringyes Long-TermThe name of the scheduled search.
packagePackageInstallation  Long-TermThe related package. See PackageInstallation.
packageIdVersionedPackageSpecifier  Long-TermThe unique identifier for the related package. VersionedPackageSpecifier is a scalar.
queryOwnershipQueryOwnershipyes Long-TermOwnership of the query run by this scheduled search. See QueryOwnership.
queryStringstringyes Long-TermThe LogScale query to execute.
queryTimestampTypeQueryTimestampTypeyes Long-TermThe timestamp type to use for the query. Running on @ingesttimestamp is only available with feature flag ScheduledSearchIngestTimestamp. See QueryTimestampType .
resourcestringyes Short-TermThe resource identifier for the scheduled search.
runAsUserUser  Long-TermThe unique identifier of the user as which the scheduled search is running. See User.
schedulestringyes Long-TermThe cron pattern describing the schedule to execute the query on.
searchIntervalOffsetSecondslong  Long-TermThe search interval offset in seconds when queryTimestampType is EventTimestamp.
searchIntervalSecondslongyes Long-TermThe search interval in seconds.
startstringyes DeprecatedThe start of the relative time interval for the query. This parameter is deprecated and will be removed at the earliest in version 1.231. Use instead searchIntervalSeconds.
timeOfLastExecutionlong  Long-TermUnix timestamp for when the scheduled search was last executed.
timeOfLastTriggerlong  Long-TermUnix timestamp for when the scheduled search was last triggered.
timeOfNextPlannedExecutionlong  Long-TermThe UNIX timestamp for next planned search.
timeZonestringyes Long-TermTime zone of the schedule. Currently, this field only supports UTC offsets like 'UTC', 'UTC-01' or 'UTC+12:45'.
triggerOnEmptyResultbooleanyes Long-TermFlag indicating whether the scheduled search should trigger when it finds an empty result (i.e., no events).
yamlTemplateYAMLyes Long-TermA template that can be used to recreate the scheduled search. YAML is a scalar.