Skip to article
Browse documentation

Querying

SQL endpoints

Publish saved queries as private JSON APIs and manage refreshes, read keys and endpoint access.

Publish a saved query as JSON

SQL endpoints give another application a stable URL for a stored query result. Open SQL endpoints in the main sidebar, or go to SQL endpoints after signing in. Publishing and refreshing run the query; reading the URL serves stored rows and does not run compute.

Create an endpoint

  1. In SQL editor, write a read-only query using Managed workspace tables and choose Save query. External catalog queries cannot be published.
  2. Open SQL endpoints → New endpoint. Select the saved query and give the endpoint a name. The Publish link beside a saved query in the editor opens this page with that query selected; a prior editor run is not required.
  3. Choose Check full result. This runs the query and uses your compute allowance. Review the columns, sample JSON, row count and result size. Nothing is readable through the endpoint yet.
  4. Choose Publish. Exactly the checked result becomes readable. When republishing changes output column names or types, review and acknowledge those changes first.
  5. Choose Create key, copy the secret shown once, and use the endpoint URL and curl example.

Access and read keys

Workspace editors, admins and owners can publish, refresh, disable and manage keys. Viewers can see endpoints and their SQL. API keys, service identities and demo sessions cannot manage endpoints.

An endpoint key starts with fe_ and reads only its endpoint. Send it as Authorization: Bearer …; never put it in the URL. Workspace API keys and browser sessions do not authenticate endpoint reads. Anyone holding an endpoint key can read every published row. Revoke a key under Connect to stop its next request.

export FROSTTABLE_ENDPOINT_KEY='paste-your-endpoint-key-here'
curl -sS -H "Authorization: Bearer $FROSTTABLE_ENDPOINT_KEY" \
  "https://YOUR_FROSTTABLE_HOST/api/v1/published/ENDPOINT_ID?limit=100"

Refresh, republish and disable

  • Connect shows the URL, read keys and request example.
  • Refresh reruns the published SQL. Readers keep the existing result until the replacement is ready. A failed refresh leaves that result available and displays an error.
  • Republish lets you select a saved query, preview its current SQL and replace the result at the same URL. Editing or deleting a saved query never updates the endpoint automatically. Column changes or replaced source tables require republishing.
  • Disable rejects reads and removes stored results. Republishing enables the same URL again; keys that were not revoked work again.

The page shows status, version, row count, published SQL and the last successful refresh. Automatic refresh is configurable per endpoint; import-triggered refresh and caller-supplied SQL query parameters are not supported.

Automatic refresh and quota

Set Refresh every (minutes) on the endpoint and choose Save schedule. Use any whole-minute interval from 1 minute to 30 days; leave it blank for manual refresh. Scheduling is off by default. The next run is shown in UTC and is normally picked up within 30 seconds of its due time. Scheduled refreshes do not overlap an existing refresh or replay missed intervals as a backlog.

Every scheduled refresh runs the published SQL through the same compute quota and credit accounting as a manual refresh. If quota is exhausted, the previous result stays available and the failure is shown; the next scheduled interval can try again. Reading the endpoint still runs no query compute.

Schedules use the access of the person who saved them and pause if that account is disabled, deleted or loses workspace write access. Another editor can save a new schedule. Disabling the endpoint pauses its schedule; republishing restarts its saved interval. Clearing a schedule does not cancel a query already in progress.

Reading pages

The JSON response includes rows, columns, row_count, result_version, refreshed_at and next_cursor. The refresh timestamp is the producing query's start time in UTC. Use limit from 1 to 1,000, then pass next_cursor as cursor for the next page. Cursors stay on one version for 15 minutes after a refresh by default. A republish invalidates older cursors immediately.

Limits and errors

Defaults are 10,000 rows, 10 MB of result JSON, 50 endpoints per workspace including disabled endpoints, and 10 active read keys per endpoint. Results over either size limit fail rather than truncate; duplicate output column names also fail. Active previews reserve endpoint capacity, while discarded, expired and failed drafts release it. Limits can vary by deployment.

  • 401 UNAUTHORIZED: the read key is missing, revoked, expired or belongs to another endpoint.
  • 410 ENDPOINT_DISABLED: the endpoint is disabled.
  • 410 CURSOR_EXPIRED: start reading again without a cursor.
  • 429 RATE_LIMITED: respect Retry-After.

See the API reference for request and response details, and SQL queries for writing and saving queries.