---
title: "Run a trace search query asynchronously."
method: POST
path: "/v1/tracing/tracequery"
tags: ["traces"]
---

# Run a trace search query asynchronously.

`POST /v1/tracing/tracequery`

Execute a trace search query and get the id to fetch its status and results. Use the [Trace Query Status](#operation/getTraceQueryStatus) endpoint to check a query status. When the query has been completed, use the [Trace Query Result](#operation/getTraceQueryResult) endpoint to get the result of the asynchronous query.

## Request body

- AsyncTraceQueryRequest
  - `queryRows` AsyncTraceQueryRow[], required — A list of trace queries.
    - `query` TraceQueryExpression, required — Base query expression object.
      - `type` string, required — Expression type of the object model.
    - `rowId` string, required — An identifier used to reference this particular row of the query request while fetching a query result. Within a query, row ids must have distinct values.
    - `orderBy` OrderBy
      - `fieldName` string, required — Field based on which results should be sorted. When not provided, the default behavior is to sort by timestamp descending. Sortable fields values: `trace_id`, `start_timestamp`, `duration`, `spans_number`, `errors`, `status_code`.
      - `order` string, required — Type of sorting values - descending or ascending.
  - `timeRange` ResolvableTimeRange, required
    - `type` string, required — Type of the time range. Value must be either `CompleteLiteralTimeRange` or `BeginBoundedTimeRange`.

## Response `200`

Query execution result.

- CreateTraceQueryResponse
  - `queryId` string, required — Id of the created query

## Other responses

- `default` — Operation failed with an error.

---

[API](https://skmtc.net/sumologic/apis/sumo-logic-api.md) · [All operations](https://skmtc.net/sumologic/apis/sumo-logic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sumologic/sumo-logic-api/revisions/18a824df1e78/schema)
