> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sprig.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate a Study

> Returns the set of issues, if any, blocking the Study from launching.



## OpenAPI

````yaml /reference/study-api-v2.json post /v2/studies/{studyId}/validate
openapi: 3.1.0
info:
  title: Sprig Public API V2 — Studies
  version: 1.0.0
  description: >-
    Programmatically create and manage Sprig Studies (surveys), their Questions,
    Blocks, invitations, and translations.
  contact:
    name: Support
    email: support@sprig.com
servers:
  - url: https://api.sprig.com
security: []
tags:
  - name: Studies
    description: The root resource for a programmatically managed survey.
  - name: Questions
    description: Questions, with their nested options, owned by a Study.
  - name: Blocks
    description: >-
      Blocks and Pages; Pages are not supported for IN_PRODUCT_SURVEY Studies.
      Group skip and display logic live on the Block. Question logic is member
      display, plus skip logic only outside a Page.
  - name: Invitations
    description: >-
      Invitation codes for SURVEY Studies; invitations are not supported for
      IN_PRODUCT_SURVEY Studies.
  - name: Translations
    description: >-
      Per-locale translated content for a Study, and the asynchronous jobs that
      generate it. Job cancellation is best-effort and does not roll back
      committed output.
  - name: Attributes
    description: Custom Attribute definitions available in the environment.
  - name: Targeting
    description: Event triggers and audience conditions for IN_PRODUCT_SURVEY Studies.
  - name: Events
    description: Existing tracked and page-URL Events available for Study targeting.
paths:
  /v2/studies/{studyId}/validate:
    post:
      tags:
        - Studies
      summary: Validate a Study
      description: Returns the set of issues, if any, blocking the Study from launching.
      operationId: validateStudy
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: studyId
          in: path
      responses:
        '200':
          description: >-
            Validation completed. Inspect `errors` to determine whether the
            Study can launch.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StudyValidationReport'
        '400':
          description: The request is not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            The environment API key is missing or invalid, cannot access this
            resource, or the Study API is not available for the account.
        '404':
          description: Study not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - EnvironmentApiKey: []
components:
  schemas:
    StudyValidationReport:
      type: object
      properties:
        status:
          type: string
          enum:
            - DRAFT
            - IN_PROGRESS
            - PAUSED
            - COMPLETED
            - ARCHIVED
        errors:
          type: array
          items:
            $ref: '#/components/schemas/StudyValidationIssue'
          description: Launch blockers. An empty array means the Study is ready to launch.
      required:
        - status
        - errors
      additionalProperties: false
      description: Current Study status and all issues that would block launch.
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: A machine-readable error code (e.g. STUDY_NOT_FOUND).
        message:
          type: string
          description: A human-readable description of the error.
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              path:
                type: string
              message:
                type: string
              resource:
                type: object
                properties:
                  type:
                    type: string
                  id:
                    type: string
                required:
                  - type
                  - id
                description: >-
                  The other resource this issue points at, when the issue is not
                  about the request itself.
            required:
              - code
              - message
          description: >-
            Per-field validation issues, present when the request itself was
            malformed.
      required:
        - code
        - message
      description: Error response returned by the Public API V2.
    StudyValidationIssue:
      type: object
      properties:
        code:
          type: string
          enum:
            - QUESTION_REQUIRED
            - INVALID_CONSENT_DOCUMENT
            - TARGETING_REQUIRED
            - OPTION_IMAGES_MISSING
            - OPTION_LABELS_MISSING
            - STUDY_FEATURE_DISABLED
          description: Stable code identifying the launch blocker.
        path:
          type: string
          enum:
            - questions
            - targeting/triggers
            - questions/options
            - appearance/replay
          description: Study area that must be corrected before launch.
        message:
          type: string
          description: Human-readable explanation of the launch blocker.
      required:
        - code
        - path
        - message
      additionalProperties: false
      description: One issue that prevents a Study from launching.
  securitySchemes:
    EnvironmentApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Use `API-Key YOUR_API_KEY`. The key selects the Production or
        Development environment.

````