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

# Schedule Survey Export

> Schedule survey submission export as CSV



## OpenAPI

````yaml /api-reference/surveys/openapi.json post /surveys/schedule-survey-export
openapi: 3.0.0
info:
  title: Surveys API
  description: Documentation for surveys API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Surveys
    description: Documentation for surveys API
paths:
  /surveys/schedule-survey-export:
    post:
      tags:
        - Surveys
      summary: Schedule Survey Export
      description: Schedule survey submission export as CSV
      operationId: schedule-survey-export
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-07-28'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduleSurveyExportParams'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SurveysExportResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableDTO'
      security:
        - bearer: []
components:
  schemas:
    ScheduleSurveyExportParams:
      type: object
      properties:
        surveyIds:
          example:
            - id1
            - id2
            - id3
          description: List of survey IDs to be exported
          type: array
          items:
            type: string
        startDate:
          format: date-time
          type: string
          example: '2023-01-01T00:00:00.000Z'
          description: Start date for the export
        endDate:
          format: date-time
          type: string
          example: '2023-01-31T23:59:59.999Z'
          description: End date for the export
        locationId:
          type: string
          example: location1
          description: ID of the location for which surveys will be exported
        companyId:
          type: string
          example: company1
          description: ID of the company
        type:
          type: string
          example: survey
          description: Type of the export should be survey
      required:
        - surveyIds
        - startDate
        - endDate
        - locationId
        - companyId
        - type
    SurveysExportResponseDto:
      type: object
      properties:
        successMessage:
          type: string
          example: >-
            The export started and when the download link is ready, it will be
            sent via email.
          description: Success message
      required:
        - successMessage
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
    UnauthorizedDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: 'Invalid token: access token is invalid'
        error:
          type: string
          example: Unauthorized
      required:
        - statusCode
        - message
        - error
    UnprocessableDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 422
        message:
          type: array
          items:
            type: string
          example:
            - Unprocessable Entity
        error:
          type: string
          example: Unprocessable Entity
      required:
        - statusCode
        - message
        - error
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Use the Access Token generated with user type as Sub-Account (OR)
        Private Integration Token of Sub-Account.
      type: http

````