For the complete documentation index, see llms.txt. This page is also available as Markdown.

Surveys

Introduction

Surveys collect one or more selections from targeted users and departments.

The description field uses the shared Rich Text HTML format.

Model Definition

Alias

survey

Computed Properties

  • hash - Hashed survey ID.

  • url - Stable survey URL.

  • answer_options_summary - Vote count per answer option when explicitly appended.

  • current_vote - Current user's vote when explicitly appended.

Capabilities

  • Targetables - Explicit users and departments or a supported targetable parent define eligible voters.

  • Entity Permissions - Direct administration grants supplement module permissions.

  • URL Context - Survey URLs resolve to access-checked context.

  • Translations - Localizes title and description; examples use en-US.

Relations

Key
Relation
Type
Relation Field(s)

user

Belongs to

user_id

folder

Belongs to

folder_id

targetable

Supported targetable entity

Morph to

targetable_type, targetable_id

users

Belongs to many

survey_user

departments

Belongs to many

department_survey

surveyAnswerOptions

Has many

survey_id

surveyVotes

Has many

survey_id

currentVote

Has one

survey_id, department_id, user_id

entityPermissions

Morph many

target_entity, target_entity_id

Types

  • singleChoice - Allows one selected answer option per vote.

  • multipleChoice - Allows multiple selected answer options per vote.

Show Votes Types

  • none - Does not expose vote results to voters.

  • always - Exposes vote results while the survey is available.

  • after_vote - Exposes vote results after the current voter has submitted a vote.

  • after_survey_end - Exposes vote results after the survey has ended.

Targetable Types

List

List visible Surveys.

Definition

GET /api/surveys

Request Keys

Key
Type
Default
Description

selects

string

All fields

Comma-separated fields to return.

relations

string

Default relations

Pipe-separated relations to include.

appends

string

Default appends

Pipe-separated computed properties such as answer_options_summary or current_vote.

limit

integer

No limit

Maximum number of surveys.

filters

object

No filters

Example Request

Example Response

Show

Show one visible Survey.

Definition

GET /api/surveys/{survey}

Route Parameters

Parameter
Type
Description

survey

integer

Survey ID.

Request Keys

Key
Type
Default
Description

selects

string

All fields

Comma-separated fields to return.

relations

string

Default relations

Pipe-separated relations to include.

appends

string

Default appends

Pipe-separated computed properties.

Behavior

For anonymous surveys, voter-specific attributes and relations are removed from nested vote data.

Example Request

Example Response

Admin: List

List all Surveys in administration scope.

Definition

GET /api/administration/surveys

Request Keys

Key
Type
Default
Description

selects

string

All fields

Comma-separated fields to return.

relations

string

Default relations

Pipe-separated relations to include.

appends

string

Default appends

Pipe-separated computed properties such as answer_options_summary or current_vote.

limit

integer

No limit

Maximum number of surveys.

filters

object

No filters

Behavior

Administration results can include inactive and soft-deleted surveys.

Example Request

Example Response

Admin: Show

Show one Survey in administration scope.

Definition

GET /api/administration/surveys/{survey}

Route Parameters

Parameter
Type
Description

survey

integer

Survey ID.

Request Keys

Key
Type
Default
Description

selects

string

All fields

Comma-separated fields to return.

relations

string

Default relations

Pipe-separated relations to include.

appends

string

Default appends

Pipe-separated computed properties.

Example Request

Example Response

Admin: Create

Create a new Survey.

Definition

POST /api/administration/surveys

Request Keys

Key
Type
Default
Description

lang_id

string

System language

Language key. Use en-US for this example.

type*

string

-

Selects one of the supported Types.

title*

string

-

Survey title.

description

string | null

null

HTML description.

active

boolean

false

Whether the survey can be answered.

show_votes_type

string

System default

Selects one of the supported Show Votes Types.

assign_mode

string | null

Default assignment mode

Assignment mode; ignored for a targetable parent.

user_ids

array | null

[]

Directly targeted user IDs.

department_ids

array | null

[]

Directly targeted department IDs.

targetable_type

string | null

null

Supported targetable morph alias.

targetable_id

integer | null

null

Targetable entity ID.

user_confirmation_required

boolean

false

Require confirmed user identity.

one_vote_per_department

boolean

false

Limit voting by department instead of user.

anonymous

boolean

false

Suppress voter information in permitted responses.

start_date

datetime | null

null

Voting start.

end_date

datetime | null

null

Voting end.

folder_id

integer | null

null

Folder ID.

sort_number

integer

Auto

Display order.

entity_permissions

object

Unrestricted

Keys with * are required for creation.

Example Request

Example Response

Admin: Update

Update an existing Survey.

Definition

PUT /api/administration/surveys/{survey}

Route Parameters

Parameter
Type
Description

survey

integer

Survey ID.

Request Keys

Key
Type
Default
Description

lang_id

string

System language

Language key. Use en-US for this example.

type*

string

-

Selects one of the supported Types.

title*

string

-

Survey title.

description

string | null

null

HTML description.

active

boolean

false

Whether the survey can be answered.

show_votes_type

string

System default

Selects one of the supported Show Votes Types.

assign_mode

string | null

Default assignment mode

Assignment mode; ignored for a targetable parent.

user_ids

array | null

[]

Directly targeted user IDs.

department_ids

array | null

[]

Directly targeted department IDs.

targetable_type

string | null

null

Supported targetable morph alias.

targetable_id

integer | null

null

Targetable entity ID.

user_confirmation_required

boolean

false

Require confirmed user identity.

one_vote_per_department

boolean

false

Limit voting by department instead of user.

anonymous

boolean

false

Suppress voter information in permitted responses.

start_date

datetime | null

null

Voting start.

end_date

datetime | null

null

Voting end.

folder_id

integer | null

null

Folder ID.

sort_number

integer

Auto

Display order.

entity_permissions

object

Unrestricted

Behavior

After the first vote, configured immutable attributes such as survey type cannot be changed. Use Reset when those settings must change and existing votes may be removed.

Example Request

Example Response

Admin: Reset

Reset an existing Survey.

Definition

PUT /api/administration/surveys/{survey}/reset

Route Parameters

Parameter
Type
Description

survey

integer

Survey ID.

Request Keys

Key
Type
Default
Description

lang_id

string

System language

Language key. Use en-US for this example.

type*

string

-

Selects one of the supported Types.

title*

string

-

Survey title.

description

string | null

null

HTML description.

active

boolean

false

Whether the survey can be answered.

show_votes_type

string

System default

Selects one of the supported Show Votes Types.

assign_mode

string | null

Default assignment mode

Assignment mode; ignored for a targetable parent.

user_ids

array | null

[]

Directly targeted user IDs.

department_ids

array | null

[]

Directly targeted department IDs.

targetable_type

string | null

null

Supported targetable morph alias.

targetable_id

integer | null

null

Targetable entity ID.

user_confirmation_required

boolean

false

Require confirmed user identity.

one_vote_per_department

boolean

false

Limit voting by department instead of user.

anonymous

boolean

false

Suppress voter information in permitted responses.

start_date

datetime | null

null

Voting start.

end_date

datetime | null

null

Voting end.

folder_id

integer | null

null

Folder ID.

sort_number

integer

Auto

Display order.

entity_permissions

object

Unrestricted

Behavior

Applies the supplied changes and soft-deletes every existing vote for the survey. Omitted settings keep their current values.

Example Request

Example Response

Admin: Delete

Delete an existing Survey.

Definition

DELETE /api/administration/surveys/{survey}

Route Parameters

Parameter
Type
Description

survey

integer

Survey ID.

Example Request

Example Response

Admin: List Targeted Users

List users targeted by one Survey.

Definition

GET /api/administration/surveys/{survey}/targeted/users

Route Parameters

Parameter
Type
Description

survey

integer

Survey ID.

Request Keys

Key
Type
Default
Description

selects

string

All fields

Comma-separated user fields to return.

limit

integer

No limit

Maximum number of users.

Example Request

Example Response

Admin: List Targeted Departments

List departments targeted by one Survey.

Definition

GET /api/administration/surveys/{survey}/targeted/departments

Route Parameters

Parameter
Type
Description

survey

integer

Survey ID.

Request Keys

Key
Type
Default
Description

selects

string

All fields

Comma-separated department fields to return.

limit

integer

No limit

Maximum number of departments.

Example Request

Example Response

Last updated