{
  "opencollection": "1.0.0",
  "info": {
    "name": "Trino Client REST Cluster Queries API",
    "version": "480"
  },
  "items": [
    {
      "info": {
        "name": "Queries",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Submit SQL Statement",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "http://{host}:{port}/v1/statement",
            "headers": [
              {
                "name": "X-Trino-User",
                "value": "alice"
              },
              {
                "name": "X-Trino-Catalog",
                "value": "hive"
              },
              {
                "name": "X-Trino-Schema",
                "value": "default"
              },
              {
                "name": "X-Trino-Source",
                "value": "my-app"
              },
              {
                "name": "X-Trino-Session",
                "value": "query_max_memory=10GB,query_max_run_time=5m"
              },
              {
                "name": "X-Trino-Transaction-Id",
                "value": "NONE"
              },
              {
                "name": "X-Trino-Client-Tags",
                "value": ""
              },
              {
                "name": "X-Trino-Client-Info",
                "value": ""
              },
              {
                "name": "X-Trino-Time-Zone",
                "value": "America/New_York"
              },
              {
                "name": "X-Trino-Language",
                "value": "en-US"
              },
              {
                "name": "X-Trino-Trace-Token",
                "value": ""
              },
              {
                "name": "X-Trino-Extra-Credential",
                "value": ""
              }
            ]
          },
          "docs": "Submits an SQL query string for execution. Returns an initial QueryResults response which may contain the first batch of results and/or a nextUri for polling subsequent results. Clients must include the X-Trino-User header at minimum. Additional context headers (catalog, schema, session properties) may be provided to configure the query environment."
        },
        {
          "info": {
            "name": "Get Query Results",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "http://{host}:{port}/v1/statement/:queryId/:token",
            "headers": [
              {
                "name": "X-Trino-User",
                "value": ""
              }
            ],
            "params": [
              {
                "name": "queryId",
                "value": "20240101_120000_00001_abcde",
                "type": "path",
                "description": "The unique query identifier returned by POST /v1/statement"
              },
              {
                "name": "token",
                "value": "1",
                "type": "path",
                "description": "Sequential token for paging through results"
              },
              {
                "name": "maxWait",
                "value": "2s",
                "type": "query",
                "description": "Maximum duration to wait for results before returning empty batch"
              },
              {
                "name": "targetResultSize",
                "value": "1MB",
                "type": "query",
                "description": "Desired result batch size hint"
              }
            ]
          },
          "docs": "Retrieves the next batch of results for a running query. Clients should follow the nextUri from a previous QueryResults response. When no nextUri is present in the response, the query is complete."
        },
        {
          "info": {
            "name": "Cancel Query",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "http://{host}:{port}/v1/statement/:queryId/:token",
            "headers": [
              {
                "name": "X-Trino-User",
                "value": ""
              }
            ],
            "params": [
              {
                "name": "queryId",
                "value": "",
                "type": "path",
                "description": "The unique query identifier"
              },
              {
                "name": "token",
                "value": "",
                "type": "path",
                "description": "Sequential token matching the current position"
              }
            ]
          },
          "docs": "Cancels a running query. Clients should DELETE the nextUri returned by the most recent QueryResults response to abort execution."
        },
        {
          "info": {
            "name": "List Active Queries",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "http://{host}:{port}/v1/query",
            "params": [
              {
                "name": "state",
                "value": "",
                "type": "query",
                "description": "Filter queries by state"
              },
              {
                "name": "limit",
                "value": "",
                "type": "query",
                "description": "Maximum number of queries to return"
              }
            ]
          },
          "docs": "Returns a list of currently running and recently completed queries on the Trino coordinator. Useful for monitoring and management UIs."
        }
      ]
    }
  ],
  "bundled": true
}