Generate a DQL query 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.
POST SaaS https://{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 Request body objects 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 body objects The Nl2DqlResponse object dql string - messageToken string - status Status -The element can hold these values SUCCESSFULSUCCESSFUL_WITH_WARNINGSFAILED metadata Metadata -
The Status object The Notification object severity string - notificationType string - message string -
The ClientErrorResponse object The ClientErrorResponseObject object code integer - message string -
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"
}
}