PublishSurvey snapshots the current draft into a new immutable version.
POST/api/v1/surveys/:id/publish
Each call creates a new SurveyVersion whose version_number is one
greater than the previous version. The survey's active_version_id is
updated to point at the new version, which becomes the default for new
assignments created without an explicit survey_version_id.
Existing assignments continue to reference their pinned version and are not affected, preserving response consistency.
Parameters
- id: Required, survey ID (> 0).
Response
Returns the newly published version including its frozen question set.
Errors
- NOT_FOUND: Survey does not exist.
- FAILED_PRECONDITION: Draft has no questions, or there are no changes since the last published version.
Request
Responses
- 200
- default
A successful response.
An unexpected error response.