Try it free

Get query autocomplete suggestions

  • Latest Dynatrace
  • Reference
  • Published Oct 13, 2026

Get structured DQL suggestions in Dynatrace Query API for the current cursor position, helping you complete a query with valid next tokens.

POSTSaaShttps://{your-environment-id}.apps.dynatrace.com/platform/storage/query/v1/query:autocomplete

Overview

For information about the required permissions see the Bucket and table permissions in Grail documentation.

We provide a list of suggestions that may be used after the cursor position. The following queries will all provide the same results:

  • query: "f"
  • query: "f", cursorPosition:1
  • query: "fetch ", cursorPosition:1

Available fields:

FieldDescription

suggestions

a list of suggestions. Each item is a separate possible suggestion, despite they might have the same outputs.

optional

whether the suggestion is optional. If true, the query until the cursor position might work. If false, the query is definitely incomplete or invalid if cut at the cursor position.

Fields in the suggestions

FieldDescription

suggestion

a string representing the whole suggestion. This information could also be derived from the parts.

alreadyTypedCharacters

how many characters of this suggestion have already been typed (and will be overridden by the suggestion).

parts

a list of semantically enriched information on what are the parts of a suggestion.

Fields in parts

FieldDescription

suggestion

a string representing the current part of the suggestion.

type

current types: SPACE, PIPE, COMMAND (may be extended)

The type helps to treat specific parts of the suggestion different to others; either by a different visualization,
a link to docs, etc.

Authentication

To execute this request, you need a platform token or OAuth access token with one of the following scopes:

  • storage:bizevents:read
  • storage:buckets:read
  • storage:entities:read
  • storage:events:read
  • storage:fieldsets:read
  • storage:logs:read
  • storage:metrics:read
  • storage:spans:read
  • storage:system:read

To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
dt-client-contextstring

The dt-client-context header is an optional string parameter used for monitoring purposes. When included in a request, it helps retrieve information about the execution of the query. It shouldn't hold sensitive information.

headerOptional
bodyAutocompleteRequest

All query parameters can also be passed via JSON in the POST body. It's not allowed to specify a parameter twice. 'query' has to be present either as a query parameter or in the request body.

bodyRequired

Request body objects

The AutocompleteRequest object

ElementTypeDescriptionRequired
cursorPositioninteger

No upper limit but must be lower than length of query. No default value.

Optional
enforceQueryConsumptionLimitboolean

Boolean to indicate if the query consumption limit should be enforced

Optional
localestring

The query locale. If none specified, then a language/country neutral locale is chosen. The input values take the ISO-639 Language code with an optional ISO-3166 country code appended to it with an underscore. For instance, both values are valid 'en' or 'en_US'.

Optional
maxDataSuggestionsinteger

Limit the number of data suggestions, such as field names. No upper limit. No default value.

Optional
querystring

The full query string.

Required
queryOptionsQueryOptions

Query options enhance query functionality for Dynatrace internal services.

Optional
timezonestring

The query timezone. If none is specified, UTC is used as fallback. The list of valid input values matches that of the IANA Time Zone Database (TZDB). It accepts values in their canonical names like 'Europe/Paris', the abbreviated version like CET or the UTC offset format like '+01:00'

Optional

The QueryOptions object

Query options enhance query functionality for Dynatrace internal services.

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

{
"cursorPosition": 1,
"enforceQueryConsumptionLimit": true,
"locale": "en_US",
"maxDataSuggestions": 1,
"query": "fetch events \n| filter event.type == \"davis\" AND davis.status != \"CLOSED\" \n| fields timestamp, davis.title, davis.underMaintenance, davis.status \n| sort timestamp \n| limit 10",
"queryOptions": null,
"timezone": "UTC"
}

Response

Response codes

CodeTypeDescription
200AutocompleteResponse

A list of structured autocomplete suggestions.

400ErrorEnvelope

Bad Request - The caller submitted an invalid request (e.g., mandatory parameters missing).

401--
403--
404--
405--
415--
500--
503--
504--

Response body objects

The AutocompleteResponse object

The response of the autocomplete call.

ElementTypeDescription
optionalboolean

True if the suggestions are optional.

suggestedTtlSecondsinteger

Suggested duration in seconds, for how long the response may be cached and reused by the client. It is derived from the volatility of the suggestions on the server (if the suggestions are static, how long the server will cache the volatile suggestions, ...). If not provided, then the result may be cached for long time. Value below 1 means that the result should not be cached.

suggestionsAutocompleteSuggestion[]

The list of suggestions.

The AutocompleteSuggestion object

Single suggestion for completion of the query.

ElementTypeDescription
alreadyTypedCharactersinteger

Number of characters that the user already typed for this suggestion.

partsAutocompleteSuggestionPart[]

List of suggestion parts.

suggestionstring

The suggested continuation of the query.

The AutocompleteSuggestionPart object

Part of the suggestion.

ElementTypeDescription
infostring

The type of the suggestion.

suggestionstring

The suggested continuation of the query.

synopsisstring

The synopsis of the suggestion.

typeTokenType

The type of the autocomplete token.

The element can hold these values
  • SPACE
  • LINEBREAK
  • INDENT
  • PIPE
  • DOT
  • COLON
  • COMMA
  • ASSIGNMENT
  • BRACE_OPEN
  • BRACE_CLOSE
  • BRACKET_OPEN
  • BRACKET_CLOSE
  • PARENTHESIS_OPEN
  • PARENTHESIS_CLOSE
  • QUOTE
  • SINGLE_QUOTE
  • SLASH
  • BOOLEAN_TRUE
  • BOOLEAN_FALSE
  • NULL
  • COMMAND_NAME
  • PARAMETER_KEY
  • PARAMETER_VALUE_SCOPE
  • FUNCTION_NAME
  • TIMESERIES_AGGREGATION
  • TIMESERIES_AGGREGATION_EXPRESSION
  • OPERATOR
  • SEARCH_OPERATOR
  • TRAVERSAL_OPERATOR
  • TRAVERSAL_RELATION_NAME
  • TRAVERSAL_HOP_COUNT
  • SIMPLE_IDENTIFIER
  • DATA_OBJECT
  • NUMBER
  • STRING
  • TIME_UNIT
  • TIMESTAMP_VALUE
  • METRIC_KEY
  • VARIABLE
  • END_COMMENT
  • UID_VALUE
  • PARSE_PATTERN
  • FIELD_PATTERN
  • SEARCH_PATTERN
  • ENTITY_SELECTOR_PART
  • SAVED_TABLE_NAME
  • TABULAR_FILE_NAME
  • PARAMETER_MODIFIER
  • FIELD_MODIFIER
  • ENTITY_TYPE
  • ENTITY_ATTRIBUTE
  • SMARTSCAPE_ID_VALUE
  • ENUM_STRING
  • FIELD_PREFIX
  • BUCKET
  • SMARTSCAPE_NODE_PATTERN
  • SMARTSCAPE_EDGE_PATTERN
  • SMARTSCAPE_NODE_TYPE
  • SMARTSCAPE_EDGE_TYPE
  • JSON_PATH
  • URL

The TokenType object

The type of the autocomplete token.

The ErrorEnvelope object

An 'envelope' error object that has the mandatory error object.

ElementTypeDescription
errorErrorResponse

The response for error state

The ErrorResponse object

The response for error state

ElementTypeDescription
codeinteger

Error code, which normally matches the HTTP error code.

detailsErrorResponseDetails

Detailed information about the error.

messagestring

A short, clear error message without details

retryAfterSecondsinteger

The number of seconds to wait until the next retry.

The ErrorResponseDetails object

Detailed information about the error.

ElementTypeDescription
argumentsstring[]

The arguments for the message format.

constraintViolationsobject[]

Information about an input parameter that violated some validation rule of the service API.

errorMessagestring

Complete error message.

errorMessageFormatstring

The message format of the error message, string.format based.

errorMessageFormatSpecifierTypesstring[]

The corresponding DQL format specifier types for each format specifier used in the error message format.

errorTypestring

The error type, e.g. COMMAND_NAME_MISSING

exceptionTypestring

The exception type.

missingPermissionsstring[]

List of missing IAM permissions necessary to successfully execute the request.

missingScopesstring[]

List of missing IAM scopes necessary to successfully execute the request.

queryIdstring-
queryStringstring

Submitted query string.

syntaxErrorPositionTokenPosition

The position of a token in a query string used for errors and notification to map the message to a specific part of the query.

The TokenPosition object

The position of a token in a query string used for errors and notification to map the message to a specific part of the query.

ElementTypeDescription
endPositionInfo

The exact position in the query string.

startPositionInfo

The exact position in the query string.

The PositionInfo object

The exact position in the query string.

ElementTypeDescription
columninteger

Query position column zero based index.

indexinteger

Query position index.

lineinteger

Query position line zero based index.

Response body JSON models

{
"optional": true,
"suggestions": [
{
"alreadyTypedCharacters": 4,
"parts": [
{
"info": "the name of the new field",
"suggestion": "alias",
"type": "PARAMETER_KEY"
},
{
"suggestion": ":",
"type": "COLON"
}
],
"suggestion": "alias:"
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": "*",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " * "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": "/",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " / "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": "%",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " % "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": "+",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " + "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": "-",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " - "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": "==",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " == "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": "!=",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " != "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": "<",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " < "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": ">",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " > "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": "<=",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " <= "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": ">=",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " >= "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": "AND",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " AND "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": "XOR",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " XOR "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": " ",
"type": "SPACE"
},
{
"suggestion": "OR",
"type": "OPERATOR"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": " OR "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": ",",
"type": "COMMA"
},
{
"suggestion": " ",
"type": "SPACE"
}
],
"suggestion": ", "
},
{
"alreadyTypedCharacters": 0,
"parts": [
{
"suggestion": "|",
"type": "PIPE"
}
],
"suggestion": "|"
}
]
}
{
"error": {
"code": 400,
"details": {
"constraintViolations": [
{
"message": "must not be null",
"parameterDescriptor": "query"
}
]
},
"message": "Constraint Violations"
}
}
Related tags
Platform APIDynatrace Platform