Surveys Reference Public

Screen & data reference

Every page, form field, question type, database table, route and API endpoint the Surveys module ships, with the CLI commands used to manage it.

Guide version: r2 Module version: 1.3.0 Updated: 2026-08-27 Estimated time: 4 min 8 views 0% helpful
You are viewing version r2 of this guide. View the current version

Pages

PageShows
OverviewPublished/required counts, response and acceptance rates, star distribution, by-app and by-platform tables.
SurveysEvery survey with its type, enforcement, status, version and response count. Publish/archive live here.
ResponsesThe answer and consent ledger, filterable by survey, outcome and date.
Rating DetailsIndividual mobile-app ratings, filterable by app, platform, stars and date.
App CatalogThe apps that can be rated.

Survey form fields

FieldNotes
TitleRequired. Shown as the prompt heading.
TypeRating, Consent, Poll or Feedback. Descriptive — it does not change behaviour.
EnforcementThe behavioural switch. Optional or Required.
MessageThe prompt body. Basic HTML allowed and sanitised. For consent, this is the text being agreed to.
AppOptionally ties the survey to a catalog app.
User types / TenantsAudience filters, both multi-select. Blank = everyone. Tenants are picked by company key and appear on platform surveys only.
Starts / EndsOptional active window (UTC).
Snooze / Cooldown / Max promptsPacing. Optional surveys only — greyed out when Required is selected.
QuestionsRepeatable rows: label, type, options (one per line), required flag.
Publish as a new versionEdit only. Invalidates prior answers and re-asks everyone.

Question types

TypeRenders as
AgreementProse only — the Agree/Disagree buttons are the answer.
Star ratingFive stars, keyboard accessible.
ScaleRadio buttons from your option list.
Single choiceRadio buttons.
Multiple choiceCheckboxes.
Free textTextarea.

Tables (created on every database)

TableHolds
surveysDefinitions: enforcement, version, status, targeting, pacing, content hash.
survey_questionsOrdered questions.
survey_responsesThe append-only ledger, one row per user per survey version.
survey_answersPer-question answers for a response.
survey_prompt_stateImpression counts and snooze deadlines.
euapi_appsThe rateable app catalog (ships in the base install schema).
euapi_app_ratingsMobile-app ratings (ships in the base install schema).

Routes

RoutePurpose
surveys/overviewThe Overview page.
surveys/<page>Pages, list endpoints, modals, save/delete/publish.
survey_prompt/submitWhere a user’s answer is posted.

End-User API

EndpointNotes
GET /v1/api/me/appsEnabled catalog apps.
POST /v1/api/me/app-ratingSubmit a 1–5 rating. One per user per app per UTC day (409 duplicate otherwise).
GET /v1/api/me/surveysThe caller’s pending survey/consent queue (max 5, most-urgent first, questions inline). Counts one impression against the queue head — fetch to present, never poll. Gated on the mobile prompts policy switch.
POST /v1/api/me/surveys/respondBody {survey, action, answers}; action is answer | agree | decline | snooze | opt_out. Snooze/opt-out on a required survey → 409 action_not_allowed; a survey not pending for the caller → 404 survey_not_found; a duplicate submit is a success (status: already_recorded).

The rating pair keeps the URLs, request bodies and response envelopes it had before the move. All four answer 404 module_unavailable when the module — or their own policy switch — is disabled. Full request/response contracts live in the generated OpenAPI spec (php erpat euapi:openapipublic/v1/api/openapi.json).

Commands

php erpat migrate:modules --module=surveys   # create the tables
php erpat db:seed SurveysDemo                # load demo surveys
php erpat db:seed SurveysDemo --dry-run      # preview only
php erpat db:seed SurveysDemo --remove       # soft-delete the demo rows
php erpat module:test Surveys                # run the module's tests

Report a content problem