# REST API (/docs/cloud/rest-api)

<Component />

Each published dataset gets a `POST` endpoint. `hypequery deploy` and `hypequery deployment:status` print the exact
URLs for your environment:

<CodeBlock>
```text
POST https://<environment-slug>.hypequery.app/api/analytics/datasets/orders/query
```
</CodeBlock>

## Make a request [#make-a-request]

Send a [runtime API key](/docs/cloud/api-keys) as a bearer token and a dataset query as JSON:

<CodeBlock>
```bash
curl -X POST https://<environment-slug>.hypequery.app/api/analytics/datasets/orders/query \
  -H "Authorization: Bearer $HYPEQUERY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dimensions": ["country"], "measures": ["revenue"], "limit": 10}'
```
</CodeBlock>

The body uses the same dataset query format as [self-hosted dataset endpoints](/docs/datasets/serve-integration):
`dimensions`, `measures`, `filters`, `orderBy`, `by`, `limit`, and `offset`.

Request bodies are limited to 128 KiB.

## Tenants [#tenants]

For tenant-scoped datasets, the request runs as the tenant your API key allows. A key with several permitted tenants,
or a trusted backend key, selects the tenant with the `x-hypequery-tenant-id` header:

<CodeBlock>
```bash
curl -X POST https://<environment-slug>.hypequery.app/api/analytics/datasets/orders/query \
  -H "Authorization: Bearer $HYPEQUERY_API_KEY" \
  -H "x-hypequery-tenant-id: customer-42" \
  -H "Content-Type: application/json" \
  -d '{"dimensions": ["country"], "measures": ["revenue"]}'
```
</CodeBlock>

See [API keys & tenants](/docs/cloud/api-keys) for how tenant authority works.

## Access [#access]

A request is allowed when the API key's roles and scopes satisfy the policy you set when publishing the dataset. Keep API keys server-side or in your secret manager; never ship them to a browser. For a React app, see
[React](/docs/cloud/react). To load rows into pandas, see [Python](/docs/cloud/python).

## API explorer [#api-explorer]

The **APIs** page lists every endpoint in the live release with its input and output schema. You can run requests from
the browser and copy ready-made code samples for curl, TypeScript, and React.