Developer docs
SQL
Read-only SQL over the store views, in the dashboard and through the API.
New to the API? Start with the introduction.
Views
Reports › SQL in the dashboard and POST /api/v1/sql (scope sql:read) run one read-only SELECT over these views of the store: orders, order_items, refunds, customers, ad_spend, touches, events, offline_events, products, survey_responses.
Limits
Other tables, system catalogs, writes and most functions are refused; a query whose plan is too expensive is refused before it runs, and one that runs longer than 10 seconds is stopped. At most 5,000 rows come back. In the dashboard, queries can be saved, charted and exported as CSV; a saved query can feed a Google Sheets sync.
Example
curl -X POST https://app.roasaurus.com/api/v1/sql \
-H "Authorization: Bearer rsk_…" -H "content-type: application/json" \
-d '{"sql": "SELECT count(*) AS orders FROM orders"}'