Athena
Query

Execute SQL

Executes raw SQL against the Athena client selected by `X-Athena-Client`. PostgreSQL clients may also be targeted with a direct PostgreSQL URI header (`x-pg-uri` preferred). This route is intended for advanced workflows where structured gateway payloads are insufficient. Use carefully with parameterized SQL on the caller side when constructing dynamic queries. Direct URI requests execute inline (deferred queue bypassed). Optional `schema_name` sets a schema-local search_path (`schema_name, public`) for PostgreSQL execution only.

POST
/gateway/query

Header Parameters

X-Athena-Client?string

Registered logical Athena client name. Optional when direct PostgreSQL URI headers are provided.

x-pg-uri?string

Preferred direct PostgreSQL URI (postgres://... or jdbc:postgresql://...).

x-athena-jdbc-url?string

Compatibility direct PostgreSQL URI header.

x-jdbc-url?string

Compatibility direct PostgreSQL URI header.

x-api-key?string

Optional API key header; not required for credentialed direct PostgreSQL URI requests.

Request Body

application/json

query*string

raw SQL to execute

schema_name?string

Optional schema override for PostgreSQL query execution.

Response Body

application/json

curl -X POST "https://athena-cluster.com/gateway/query" \  -H "Content-Type: application/json" \  -d '{    "query": "SELECT id, path, status_code FROM http_request_log ORDER BY created_at DESC LIMIT 10;"  }'
{
  "status": "success",
  "message": "Query executed",
  "data": {
    "rows": [
      {
        "id": "5d845b27-8d06-40a0-9e76-08de9d9f3c1f",
        "path": "/gateway/fetch",
        "status_code": 200
      }
    ]
  }
}
Empty
Empty