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

# Restart Survey

> API endpoint for restarting a survey. This can be triggered to resume a previously stopped survey.

A **restarted survey resumes accepting new respondents**, allowing further additions after being previously stopped.


## OpenAPI

````yaml POST /restartSurvey
openapi: 3.0.1
info:
  title: API Documentation
  description: API Documentation for Redem 3.0
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://api.redem.io
security:
  - apiKeyAuth: []
tags:
  - name: Survey
    description: Survey management
  - name: Respondent
    description: Respondent management
paths:
  /restartSurvey:
    post:
      tags:
        - Survey
      summary: Restart a survey
      description: >-
        API endpoint for restarting a survey. This can be triggered to resume a
        previously stopped survey.
      operationId: restartSurveyV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RestartSurveyRequest'
            example:
              surveyName: Global Vacation Insights 2024
      responses:
        '200':
          description: >-
            Upon successful processing, the API returns a 200 OK status code
            along with the expected data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: >-
                      A variable indicating whether the **operation was
                      successful**.
                    enum:
                      - true
                      - false
                  message:
                    type: string
                    description: >-
                      A variable that **human-readable message** providing
                      additional context or confirmation of the requested
                      action.
                  results:
                    type: object
                    description: >-
                      This object serves as a **container to hold the results
                      for the requested data**, encapsulating all relevant
                      information and outputs in a structured format.
                    properties:
                      surveyId:
                        type: string
                        description: >-
                          A variable that **indicates the unique survey
                          identifier**.
                      surveyName:
                        type: string
                        description: A variable that **indicates the survey name**.
                      status:
                        type: string
                        description: >-
                          A variable that **indicates the status of the
                          survey**. 

                           **⭕ Note:** ReDem surveys have two possible statuses: `RUNNING` and `STOPPED`. The survey status will be updated to `RUNNING` once the survey is restarted.
                      previousStatus:
                        type: string
                        description: >-
                          A variable that **indicates the previous status of the
                          survey** before the restart.
              example:
                success: true
                message: Survey successfully restarted
                results:
                  surveyId: 68e4f174adc679a59fe16324
                  surveyName: Global Vacation Insights 2024
                  status: RUNNING
                  previousStatus: STOPPED
        '400':
          description: >-
            When a request fails due to invalid input or other errors, the API
            returns a 400 Bad Request status code. The response includes a
            descriptive `message` explaining the issue and an `error` object
            containing additional details to aid in diagnosing and resolving the
            problem.
          content:
            application/json:
              schema:
                oneOf:
                  - title: Validation Error
                    description: >-
                      Indicating a validation failure, the response includes a
                      `message` field specifying the issue and an `errors`
                      object listing the missing or incorrect fields to help
                      clients resolve them. 

                       **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.
                    type: object
                  - title: Survey not found
                    description: >-
                      This error occurs when the **requested survey does not
                      exist in the system**. It may happen if the survey name is
                      incorrect, has been deleted, or was never created. 

                       **⭕ Note:** Refer to the [response structure](/api-reference/api-specifications/response-structure) for the format of the error response.
                    type: object
              examples:
                Validation Error:
                  value:
                    success: false
                    message: Validation Error
                    errors:
                      '0': '"surveyName" is required'
                Survey not found:
                  value:
                    success: false
                    message: Survey not found
                    errors: {}
components:
  schemas:
    RestartSurveyRequest:
      description: |-
        Request body for restarting a survey 

         **🔒 Authentication:** This endpoint is only accessible via a `PRIVATE` API key type
      required:
        - surveyName
      type: object
      properties:
        surveyName:
          type: string
          description: '**The name of the survey**.'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: api-key

````