Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.insito.app/llms.txt

Use this file to discover all available pages before exploring further.

Insito’s data model is intentionally flat. Six tables cover everything your app and dashboard read or write.

Entity diagram

Tables

organization

The billing unit. One organization = one Stripe customer, one monthly response cap, one set of members.
ColumnTypeNotes
iduuidPK
nametextWorkspace name
planenumfree, pro, scale, enterprise
stripe_customer_idtextSet after first paid plan

member

Links a Supabase auth user to an organization with a role.
ColumnTypeNotes
user_iduuidFK → auth.users.id
organization_iduuidFK
roleenumowner, admin, editor, viewer

project

One app = one project. Holds the project’s api_key (the proj_xxx secret your SDK uses).
ColumnTypeNotes
iduuidPK
organization_iduuidFK
nametextDisplay name
api_keytextProject secret, format proj_xxx. Unique, indexed.
platformenumreact-native, flutter, web, other

survey

A survey definition. Linked to a project.
ColumnTypeNotes
iduuidPK
project_iduuidFK
nametextInternal label
trigger_keytext^[a-z][a-z0-9_]*$
statusenumdraft, active, inactive
cooldown_daysintDefault 28
audiencejsonbPlatform + version filters

question

Belongs to a survey. Position = order in the modal.
ColumnTypeNotes
iduuidPK
survey_iduuidFK
typeenumnps, rating, multiple_choice, open_text
texttextShown to user
optionsjsonbType-dependent (choices, max length, etc.)
is_requiredboolBlock “Next” until answered
positionint1-based

respondent

Created on first identify() per (project, userId). Holds metadata keyed by userId. Multiple devices share one respondent if you pass the same userId.
ColumnTypeNotes
iduuidPK
project_iduuidFK
user_idtextYour stable identifier
platformtextFrom identify()
app_versiontextFrom identify()
metadatajsonbFree-form key/value

response

One row per submitted survey. Counts against your plan.
ColumnTypeNotes
iduuidPK
survey_iduuidFK
respondent_iduuidFK
created_attimestamptzWhen the user tapped Submit
platformtextSnapshot at submit time
app_versiontextSnapshot at submit time

answer

One row per question per response.
ColumnTypeNotes
iduuidPK
response_iduuidFK
question_iduuidFK
valuejsonbType-dependent — see below
value shape per question type:
  • nps: { "n": 0..10 }
  • rating: { "n": 1..5 }
  • multiple_choice: { "choices": ["a", "b"] } (always an array)
  • open_text: { "text": "..." }

Soft deletes and history

  • Surveys are never hard-deleted. Toggling status to inactive keeps the data; the API just refuses to serve the survey to new triggers.
  • Questions removed from a survey are soft-deleted (deleted_at set). Historical answers still resolve.
  • Respondents and responses are immutable once written. There’s no edit-response surface in the SDK or dashboard.

RLS scope

Every row is scoped to one organization_id via Postgres RLS. The SDK uses a project API key that’s tied to one organization; the dashboard uses Supabase auth + the member table. Cross-organization reads/writes return 404 — never 403, on purpose, so tenant existence isn’t leaked. See Authentication for how API keys and JWTs authorize requests.