Try it free

Generate a DQL query

  • Latest Dynatrace
  • Reference
  • Published Oct 13, 2026

Generate a DQL query from natural language in Dynatrace with the NL2DQL API using a text prompt and receive the generated query.

POSTSaaShttps://{your-environment-id}.apps.dynatrace.com/platform/davis/copilot/v1/skills/nl2dql:generate

Overview

You send natural language text in the request body to create a DQL query. The response returns the answer from the Nl2Dql skill.

Authentication

To execute this request, you need a platform token or OAuth access token with davis-copilot:nl2dql:execute scope. To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
bodyNl2DqlRequest-bodyRequired

Request body objects

The Nl2DqlRequest object

ElementTypeDescriptionRequired
textstring-Required

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.

{
"text": "Generate a query which shows the latest 10 log lines"
}

Response

Response codes

CodeTypeDescription
200Nl2DqlResponse

Answer from Nl2Dql skill

4XXClientErrorResponse-
5XXInternalErrorResponse-

Response body objects

The Nl2DqlResponse object

ElementTypeDescription
dqlstring-
messageTokenstring-
statusStatus-
The element can hold these values
  • SUCCESSFUL
  • SUCCESSFUL_WITH_WARNINGS
  • FAILED
metadataMetadata-

The Status object

The Metadata object

ElementTypeDescription
notificationsNotification[]-

The Notification object

ElementTypeDescription
severitystring-
notificationTypestring-
messagestring-

The ClientErrorResponse object

ElementTypeDescription
errorClientErrorResponseObject-

The ClientErrorResponseObject object

ElementTypeDescription
codeinteger-
messagestring-

Response body JSON models

{
"dql": "fetch logs\n| limit 10",
"messageToken": "1e9eaca7-2a32-4263-806f-787fa2e1350c",
"status": "SUCCESSFUL",
"metadata": {
"notifications": [
{
"severity": "WARNING",
"notificationType": "POSSIBLY_UNEXPECTED_DQL_BEHAVIOUR",
"message": "Your prompt seems to refer to segments or management zones. Please select the segment using the segment selector."
}
]
}
}
{
"error": {
"code": 400,
"message": "Bad Request"
}
}
Related tags
Platform APIDynatrace PlatformAI Observability