API Reference

Query your data programmatically via REST API.

Authentication

rawquery supports two authentication methods for API access.

Getting an API Key

Create a key via the CLI or the dashboard:

bash
rq api-keys create --name my-key

Or go to Settings > API Keys in the dashboard and click Generate API Key.

Copy the key (starts with rq_). To revoke: rq api-keys revoke <key-id> or delete it from Settings > API Keys.

X-API-Key header (recommended for scripts)

For the Execute API, use the X-API-Key header:

text
X-API-Key: rq_your_api_key_here

Bearer token

For workspace and dashboard endpoints, API keys also work as Bearer tokens:

text
Authorization: Bearer rq_your_api_key_here

Base URL

text
https://api.rawquery.dev/api/v1

Full interactive reference with schemas and "Try it out": api.rawquery.dev/api/docs

OpenAPI spec (JSON): api.rawquery.dev/api/openapi.json

Rate Limits

PlanQueries/min
Free10
Team60
Business100

Free tier: 10 requests/min. Exceeding this returns 429 Too Many Requests. Upgrade to Team or Business for higher limits.

Error Handling

Errors return appropriate HTTP status codes with a JSON body:

json
{
"detail": {
"error": {
"code": "SYNTAX_ERROR",
"message": "Syntax error at line 1: unexpected token 'FORM'",
"hint": "Check your SQL syntax. rawquery uses Postgres-compatible SQL."
}
}
}

Access the error in code: response.json()["detail"]["error"]["code"].

StatusMeaning
400Bad request (invalid SQL, missing params)
401Unauthorized (invalid, missing, or expired API key)
403Forbidden (valid key, but no access to this workspace or resource)
408Query timeout (30s limit)
429Rate limit exceeded
500Server error

Wire Protocol

rawquery exposes a Postgres-compatible wire protocol on port 5433. Connect with any Postgres client - psql, DBeaver, Metabase, Looker, Grafana, or your application's Postgres driver.

ParameterValue
Hostrawquery.dev
Port5433
Userany value
Passwordyour API key
Databaseyour workspace slug
SSLrequire
bash
PGPASSWORD=rq_your_api_key psql -h rawquery.dev -p 5433 -U any -d your-workspace

The wire protocol authenticates against the same API key system. Rate limits apply per plan.

SSL certificate

All connections use TLS. Most clients work with sslmode=require out of the box.

If your tool requires uploading an SSL certificate (Looker, Metabase Cloud, Grafana Cloud), download it from Settings > Wire Protocol in the dashboard, or directly at rawquery.dev/ca.pem.

Table discovery

BI tools that query information_schema.tables for table discovery are supported. The catalog is scoped to your workspace - you only see your own tables.

Next: Execute API - Run SQL queries programmatically with curl, Python, or JavaScript

All Endpoints - Complete reference for workspace, connection, and query endpoints