ProjectReports

Runs a saved Query on the traffic log

Changed on

Runs the saved Query (Analytics > Queries) called queryName on the traffic log of the given environment and returns the matching records, newest first by default. The Query is looked up by name inside the project in the path; the search covers the project's API and AI gateway traffic. A Query shared by the whole installation (global) is allowed and still sees only this project's traffic. A personal Query is not available through this API and answers 404 like an unknown name. The records carry the traffic list's columns only; request and response bodies, headers and credentials are never returned. Paged: size defaults to 20, at most 200, and page * size + size must stay within resultWindow (10,000); totalElements is the exact count of matching records, so narrow from/to when it is larger than resultWindow. An unreadable traffic log answers 503, never an empty list.

post/apiops/projects/{projectName}/reports/saved-queries/{queryName}/search

Request

Path parameters

projectNamestring required

Project name

queryNamestring required

Name of the saved Query to run.

Query parameters

pageinteger

Zero-based page index.

sizeinteger

Rows per page. Default 20, at most 200.

sortstring

timestamp[,asc|desc]. Default timestamp,desc.

Request body

environmentNamestring

Name of the environment whose traffic log is searched. Required.

fromstring

Range start: ISO-8601 (for example 2026-10-27T08:00:00Z) or Elasticsearch date math (for example now-1h). Default now-24h.

tostring

Range end, same formats as from. Default now.

fieldsstring[]

Columns to return. Omit for the default set. Allowed: timestamp, apiType, statusCode, apiProxyName, endpoint, httpMethod, remoteAddress, consumer, routingAddress, serverName, serverPort, requestPipelineMs, routingMs, responsePipelineMs, totalMs, requestBytes, responseBytes, source. The default set leaves out consumer. Bodies, headers and credentials are never returned by this endpoint.

Example request

{
  "environmentName": "prod",
  "from": "now-24h",
  "to": "now",
  "fields": [
    "timestamp",
    "statusCode",
    "apiProxyName",
    "totalMs"
  ]
}

Response

successful operation!

status'SUCCESS' | 'FAILURE'
pageinteger
sizeinteger
totalElementsinteger
totalPagesinteger
sortstring[]
queryNamestring

Name of the saved Query that was run.

queryScopestring

PROJECT for a Query of the project in the path, GLOBAL for a Query shared by the whole installation.

totalRelationstring

Records are counted exactly (eq). gte would mean the count is a lower bound.

resultWindowinteger

Deepest page * size + size a search can reach. totalElements above this means the range holds more records than can be paged; narrow from/to to read them.

Example response

{
  "items": [
    {
      "apiType": "REST",
      "statusCode": 200,
      "apiProxyName": "PetstoreProxy",
      "endpoint": "/pet/{petId}",
      "httpMethod": "GET"
    }
  ],
  "queryScope": "PROJECT",
  "totalRelation": "eq",
  "resultWindow": 10000
}

Changes