The Insito API has two authentication modes — one for SDK traffic
from your mobile app, one for dashboard traffic from the
admin.insito.app web UI. They never overlap.
SDK: project API keys
All /v1/sdk/* routes require a Bearer token in the
Authorization header. The token is your project’s API key from
admin.insito.app → Project →
Settings → API key.
API keys:
- Format:
proj_ followed by a 32-character hex string (generated per
project). The auth middleware accepts a proj_<alphanumeric> bearer token.
- One key per project — rotating creates a new key and invalidates
the old one immediately.
- The key binds every request to a single project, so all SDK traffic is
automatically scoped to that project. A missing, malformed, or rotated key
returns
401 unauthorized.
API keys are project secrets. Treat them like a database password
— never commit to public repos, never hard-code into your app
source. For React Native, use react-native-config or
expo-constants’s extra field.
Dashboard: Supabase JWTs
/v1/dashboard/* routes require a Supabase auth JWT in the same
Authorization: Bearer shape.
Get one by signing in via Supabase Auth
against the same project the dashboard uses. The JWT is short-lived
(1 hour by default) — refresh via the refresh token flow.
Routes apply per-org RLS based on the JWT’s sub (user ID) and the
members table. Cross-org access returns 404.
Rate limits
All /v1/sdk/* routes share a sliding-window limit of 120 requests per
minute per API key (enforced in Upstash Redis). Exceeding it returns 429
with { "error": "too_many_requests" } and X-RateLimit-Limit /
X-RateLimit-Remaining response headers. There is no Retry-After header — the
window is one minute. Dashboard (/v1/dashboard/*) routes have no server-side
rate limit today. See Plan limits for response caps.
Error shape
Validation failures (Zod) return:
All other errors are a flat object with error plus any context fields at the
top level (there is no details wrapper):
Common codes:
Versioning
The API is versioned via URL prefix (/v1). We bump major versions
for breaking changes; backwards-compatible additions never get a new
version.