Fetch data with conditions
Fetches rows from a table or view using structured conditions, optional pagination, sort instructions, and optional post-processing (`group_by`, `time_granularity`, aggregation options). Notes: - Route selection is based on `X-Athena-Client` (or custom Supabase headers for `custom_supabase`). - `X-Strip-Nulls` can be used to remove null-valued fields from response payloads. - Cache behavior may include `X-Athena-Cached`, `X-Athena-Cache-Outcome`, and `X-Athena-Cache-Source` headers.
Header Parameters
optional API key mirror of the apikey header
Required when X-Athena-Client is custom_supabase
uriRequired when X-Athena-Client is custom_supabase
Request Body
application/json
Column name to group results by
Time granularity for grouping timestamp data
"day" | "hour" | "minute"Column to aggregate (required when using aggregation_strategy)
Aggregation strategy to apply (requires aggregation_column)
"cumulative_sum"Whether to deduplicate during aggregation
Optional sort (camelCase). Use sort_by for snake_case.
Optional sort (snake_case). Same shape as sortBy.
Response Body
application/json
curl -X POST "https://athena-cluster.com/gateway/fetch" \ -H "Content-Type: application/json" \ -d '{ "table_name": "http_request_log", "columns": [ "id", "path", "status_code", "created_at" ], "conditions": [ { "eq_column": "client_name", "eq_value": "athena_logging" } ], "limit": 25, "current_page": 1, "sortBy": { "field": "created_at", "direction": "desc" } }'{
"status": "success",
"message": "Fetched 25 rows",
"data": {
"rows": [
{
"id": "5d845b27-8d06-40a0-9e76-08de9d9f3c1f",
"path": "/gateway/fetch",
"status_code": 200,
"created_at": "2026-04-14T10:15:00Z"
}
],
"row_count": 25
}
}Delete a row by id DELETE
Deletes rows from the target table, usually by primary/resource identifier fields in the request body. Route authorization and client routing follow the same model as other gateway mutations.
Insert a row into a table PUT
Inserts one row (or server-normalized payload) into the target table selected by `X-Athena-Client`. The optional `X-Athena-Insert-Window` header can enable request-scoped batching for Postgres-backed inserts. Conflict responses (409) are typically raised for unique/constraint violations.