Skip to main content
Study API errors use a machine-readable code and a human-readable message. Validation failures can also include an errors array with precise paths and issue codes.
Use code for program logic. Display message for operators, and log the complete response after removing credentials and respondent data.

Validate before launch

Call POST /v2/studies/{studyId}/validate before changing the Study status to IN_PROGRESS. Validation is read-only and does not require If-Match.
An empty errors array means the current definition is ready to launch. A successful validation does not reserve the Study version, so launch with the latest ETag. Launch validation issue codes are: If a launch request fails with 422 STUDY_NOT_READY, its errors array uses the same issue format.

Common response codes

Invitation endpoints currently use two different unsupported-resource responses. Listing invitations for an in-product survey returns 422 INVITATIONS_NOT_SUPPORTED. Creating invitations for an in-product survey returns 400 with the legacy { "error": "Survey is not a link survey" } envelope. Handle both until the API is normalized. Translation endpoints can additionally return UNSUPPORTED_TRANSLATION_LOCALE, TRANSLATION_ENQUEUE_FAILED, TRANSLATION_GENERATION_FAILED, or TRANSLATION_JOB_NOT_CANCELLABLE. Inspect the job status before retrying an asynchronous operation.

Editable states

Settings and authored content can be changed while a Study is DRAFT or PAUSED. Some resources also accept the initial internal state immediately after creation. Public lifecycle transitions are:
  • DRAFT → IN_PROGRESS
  • IN_PROGRESS → PAUSED, COMPLETED, or ARCHIVED
  • PAUSED → IN_PROGRESS, COMPLETED, or ARCHIVED
  • COMPLETED → ARCHIVED
ARCHIVED is terminal. Send a lifecycle update by itself; do not combine status with settings in the same PATCH.

Legacy compatibility errors

The Study API refuses to reinterpret a stored legacy graph when doing so could change behavior. Compatibility errors are deliberate safeguards:
  • UNSUPPORTED_TARGETING protects targeting that cannot be expressed by the public targeting schema.
  • UNSUPPORTED_STUDY_DEFINITION protects unsupported Question or layout structures.
  • UNSUPPORTED_TRANSLATION_DEFINITION protects translations that cannot be represented completely.
Do not clear or replace the resource merely to bypass the error. Review the Study in Sprig and contact support@sprig.com when migration is required.