> ## 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.

# Initiate PDF download for survey submission

> Initiates PDF generation for a survey submission. If PDF already exists, returns the PDF URL immediately.



## OpenAPI

````yaml /api-reference/surveys/openapi.json post /surveys/{surveyId}/submissions/{submissionId}/download-pdf
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/{surveyId}/submissions/{submissionId}/download-pdf:
    post:
      tags:
        - Surveys
      summary: Initiate PDF download for survey submission
      description: >-
        Initiates PDF generation for a survey submission. If PDF already exists,
        returns the PDF URL immediately.
      operationId: initiate-survey-pdf-download
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-07-28'
        - name: surveyId
          required: true
          in: path
          description: Survey ID
          schema:
            example: DWQ45t2IPVxi9LDu1wBl
            type: string
        - name: submissionId
          required: true
          in: path
          description: Submission ID
          schema:
            example: 38303ec7-629a-49e2-888a-cf8bf0b1f97e
            type: string
        - name: locationId
          required: true
          in: query
          description: Location ID
          schema:
            type: string
            example: ve9EPM428h8vShlRW1KT
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DownloadPdfBody'
      responses:
        '200':
          description: >-
            PDF download initiated successfully or PDF URL returned if already
            exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DownloadPdfResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
        '404':
          description: Survey or Submission not found
      security:
        - bearer: []
components:
  schemas:
    DownloadPdfBody:
      type: object
      properties:
        pdfType:
          type: string
          description: PDF type to download
          example: submission
          enum:
            - submission
            - results
          default: submission
        locationId:
          type: string
          description: Location ID (can be provided in body or query parameter)
          example: ve9EPM428h8vShlRW1KT
    DownloadPdfResponseDto:
      type: object
      properties:
        message:
          type: string
          description: Success message
          example: PDF generation initiated
        pdfUrl:
          type: string
          description: PDF URL (present if PDF already exists)
          example: https://storage.googleapis.com/bucket/path/to/file.pdf
        pdfExists:
          type: boolean
          description: Indicates if PDF URL exists
          example: true
      required:
        - message
        - pdfExists
    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
  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

````