canonical: https://jentic.com/apis/amazonaws.com/timestream-query

# AWS Amazon Timestream Query

Jentic publishes the only available OpenAPI specification for Amazon Timestream Query, keeping it validated and agent-ready. Amazon Timestream Query is the read-and-schedule API for Amazon Timestream, AWS's serverless time-series database. It runs SQL queries against memory and magnetic stores, prepares parameterised queries, and manages scheduled queries that pre-compute aggregations on a cron-like schedule. The 13 operations cover ad-hoc Query and CancelQuery, the full lifecycle of scheduled queries, endpoint discovery, and resource tagging.

## For AI agents

Run SQL queries and manage scheduled queries against Amazon Timestream time-series tables so an agent can read IoT, observability, and DevOps metrics on demand.

## Scope

Does not handle data ingestion, table or database creation, or real-time alerting - use for running SQL queries and managing scheduled queries on Timestream tables only.

## Capabilities

- Run ad-hoc SQL queries against Timestream tables via Query with paginated result sets
- Cancel an in-flight long-running query with CancelQuery
- Create, update, delete, and describe scheduled queries that pre-aggregate time-series data
- Trigger scheduled queries on demand via ExecuteScheduledQuery
- Prepare parameterised queries with PrepareQuery for repeated execution patterns
- Tag and untag scheduled queries for cost allocation and ownership
- Discover regional Timestream Query endpoints via DescribeEndpoints

## Use cases

### Ad-Hoc Time-Series Investigation

When an SRE needs to investigate a spike, they run SQL directly against the Timestream Query API: SELECT bin(time, 1m), avg(measure_value::double) FROM iot.sensors WHERE region = 'us-east-1' AND time BETWEEN ago(1h) AND now() GROUP BY 1. The Query operation returns paginated results with QueryStatus showing rows scanned and bytes metered, and CancelQuery aborts the run if it exceeds expectations.

Example prompt: Call Query with QueryString 'SELECT bin(time, 1m) AS minute, avg(measure_value::double) AS avg_temp FROM "iot"."sensors" WHERE time > ago(1h) GROUP BY bin(time, 1m) ORDER BY minute', then page through Rows.

### Scheduled Roll-Ups for Dashboards

Pre-aggregate raw metrics into a roll-up table that powers a Grafana or QuickSight dashboard. CreateScheduledQuery accepts a SQL statement, a ScheduleConfiguration cron expression, a TargetConfiguration writing into a destination Timestream table, and a NotificationConfiguration for SNS alerts on failure. The result is a managed materialised view of your time-series data that scales without operating extra infrastructure.

Example prompt: Call CreateScheduledQuery with Name 'cpu-5m-rollup', QueryString aggregating sensors by 5m bins, ScheduleConfiguration.ScheduleExpression 'cron(*/5 * * * ? *)', and TargetConfiguration writing to 'iot.sensors_5m'.

### Operational Monitoring and SLA Reporting

Generate SLA reports by combining ad-hoc Query calls (for the report period) with scheduled queries (for daily and weekly roll-ups feeding the report). ListScheduledQueries lets you audit which roll-ups exist; DescribeScheduledQuery returns the SQL and schedule for compliance review. Tag scheduled queries with team and environment to drive cost allocation per business unit.

Example prompt: Call ListScheduledQueries, then for each ScheduledQueryArn call DescribeScheduledQuery and return Name, QueryString, ScheduleExpression, and Tags.

### Agent-Driven Time-Series Q&A via Jentic

Embed a natural-language analytics agent that answers operational questions over time-series data. The agent translates the question into SQL, calls Query through Jentic without holding AWS keys, and formats the rows back into a chart or summary. For repeated questions, the agent can promote a successful query into a CreateScheduledQuery so the next answer reads from a pre-aggregated table.

Example prompt: Through Jentic, search for 'run a sql query on amazon timestream', load Query, and execute with QueryString containing the agent's generated SQL.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /#X-Amz-Target=Timestream_20181101.Query | Run a SQL query against Timestream |
| POST | /#X-Amz-Target=Timestream_20181101.CancelQuery | Cancel an in-flight query |
| POST | /#X-Amz-Target=Timestream_20181101.CreateScheduledQuery | Create a scheduled query |
| POST | /#X-Amz-Target=Timestream_20181101.ExecuteScheduledQuery | Run a scheduled query on demand |
| POST | /#X-Amz-Target=Timestream_20181101.DescribeScheduledQuery | Describe a scheduled query |
| POST | /#X-Amz-Target=Timestream_20181101.PrepareQuery | Prepare a parameterised query |

## Key resources

- **Ad-hoc queries** — Query, CancelQuery, PrepareQuery for direct SQL execution
- **Scheduled queries** — CreateScheduledQuery, UpdateScheduledQuery, DeleteScheduledQuery, DescribeScheduledQuery, ListScheduledQueries, ExecuteScheduledQuery
- **Endpoints** — DescribeEndpoints for SDK auto-discovery of regional endpoints
- **Tagging** — TagResource, UntagResource, ListTagsForResource for scheduled queries

## Why Jentic

- **Setup:** Wiring Amazon Timestream Query by hand means computing SigV4 signatures, handling the query cell endpoint discovery, and routing calls through the X-Amz-Target action header yourself. Through Jentic you install once, import Timestream Query from the API Directory, store the access keys once, and your agent calls it.
- **Permission scoping:** Timestream Query routes its actions through one endpoint by X-Amz-Target rather than resource ids in the path, so scope the agent to the operations it needs, such as Query and DescribeScheduledQuery. You choose the operations it may call, so scheduled-query creation or execution are not included unless you add them.
- **Credential handling:** Your AWS access keys are stored once, encrypted, by your own Jentic One instance and used to sign each Timestream Query request with SigV4 at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'run a SQL query on Timestream' or 'cancel a running query', and Jentic returns the matching Timestream Query operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Amazon CloudWatch** — CloudWatch Metrics is AWS's general-purpose metric store with shorter retention than Timestream's tiered storage.
- **AWS IoT SiteWise** — IoT SiteWise ingests industrial telemetry that often lands in Timestream for SQL analytics.
- **Amazon Kinesis Analytics** — Kinesis Analytics runs streaming SQL on incoming data; Timestream stores the resulting metrics for historical query.

## FAQ

### Why is there no official OpenAPI spec for Amazon Timestream Query?

AWS does not publish an OpenAPI specification for Amazon Timestream Query; it ships Smithy models and language-specific SDKs instead. Jentic generates and maintains this OpenAPI spec so that AI agents and developers can call Amazon Timestream Query via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does Amazon Timestream Query use?

Timestream Query uses AWS SigV4 with X-Amz-Target identifying the action (e.g. Timestream_20181101.Query). It also requires endpoint discovery: clients call DescribeEndpoints first to learn the cell endpoint to sign against. Through Jentic, your AWS keys are vaulted and Jentic handles SigV4 signing.

### Can I run aggregations across billions of points with Timestream Query?

Yes. The Query operation pushes filtering and aggregation down to Timestream's tiered memory and magnetic stores; queries return paginated results with QueryStatus reporting CumulativeBytesMetered. For repeated dashboards, promote the SQL into a scheduled query that writes pre-aggregated rows to a destination table.

### What are the rate limits for Timestream Query?

Concurrent query limits are typically 200 per account per region with up to 5GB of data scanned per query and a 60-minute maximum runtime. Scheduled queries have separate per-account quotas. Throttling responses include the standard ThrottlingException.

### How do I run a SQL query on Timestream through Jentic?

Search Jentic with 'run a sql query on amazon timestream', load the Query schema, and execute with QueryString set to your SQL and (optionally) MaxRows for pagination. Jentic returns the column metadata and Rows; pass the NextToken back into Query to continue paging.

### Can Timestream Query create or drop tables?

No. This API is read-only and scheduled-query-management. Use the separate Timestream Write API (and its CreateDatabase, CreateTable operations) to manage schema, and the Write API's WriteRecords to ingest data.

### How are scheduled queries billed?

Scheduled queries are billed by the bytes scanned per execution plus the writes to the target table, the same metering as ad-hoc queries. Tag scheduled queries to attribute the spend back to the owning team.

### Can I limit what my agent is allowed to do with the Amazon Timestream Query API?

Yes. Because you run Jentic One yourself, your own rules decide which Timestream Query operations and credentials the agent may use. Timestream Query routes every action through a single endpoint by its X-Amz-Target header rather than resource ids in the path, so you scope the agent to just the operations it needs, such as Query and DescribeScheduledQuery. You choose the operations it may call, so scheduled-query creation with CreateScheduledQuery or manual runs with ExecuteScheduledQuery stay out of reach unless you add them.
