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

# Download screen results as PDF

> Returns the screen results as a downloadable PDF file. Generates
the PDF on-the-fly if it has not been cached previously.

On success, returns binary PDF data with appropriate headers
(`Content-Type: application/pdf`, `Content-Disposition: attachment`).

On error, returns a standard AJAX JSON error response.

**Errors:**
- No results available (400)
- PDF generation failed (500)
- PDF file not found on disk (404)

Registered as `wp_ajax_sagescreen_download_screen_results` — **login required**.




## OpenAPI

````yaml /openapi/private/specs/wp/screen.yml post /wp-admin/admin-ajax.php?action=sagescreen_download_screen_results
openapi: 3.1.0
info:
  title: SageScreen — Screen Module
  description: |
    Screen (interview) lifecycle management. A screen represents a single
    candidate screening session — from invite creation through completion,
    results generation, and PDF download.

    **CPT:** `ss_screen`
    **Custom statuses:** `ss_draft`, `ss_invited`, `ss_accepted`, `ss_started`,
    `ss_completed`, `ss_closed`, `ss_cancelled`, `ss_expired`

    Screens are created when candidates are invited to a sage, progress through
    the interview, and conclude with AI-generated results including category
    scores, a summary, recommendation, and a hire/no-hire determination.
  version: 1.0.0
servers:
  - url: https://{domain}/wp-json/sagescreen/v1
    description: WordPress REST API
    variables:
      domain:
        default: api.sagescreen.app
security: []
tags:
  - name: Screen – Testing
    description: Test invite and temperature check endpoints
  - name: Screen – Results
    description: Results generation, checking, regeneration, feedback, and download
  - name: Screen – Workflow
    description: Workflow progression (skip testing)
paths:
  /wp-admin/admin-ajax.php?action=sagescreen_download_screen_results:
    post:
      tags:
        - Screen – Results
      summary: Download screen results as PDF
      description: >
        Returns the screen results as a downloadable PDF file. Generates

        the PDF on-the-fly if it has not been cached previously.


        On success, returns binary PDF data with appropriate headers

        (`Content-Type: application/pdf`, `Content-Disposition: attachment`).


        On error, returns a standard AJAX JSON error response.


        **Errors:**

        - No results available (400)

        - PDF generation failed (500)

        - PDF file not found on disk (404)


        Registered as `wp_ajax_sagescreen_download_screen_results` — **login
        required**.
      operationId: ajaxDownloadScreenResults
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DownloadResultsRequest'
      responses:
        '200':
          description: PDF file download
          content:
            application/pdf:
              schema:
                type: string
                format: binary
            application/json:
              schema:
                $ref: '#/components/schemas/AjaxErrorResponse'
              examples:
                noResults:
                  summary: No results available
                  value:
                    success: false
                    data:
                      message: No results available for this screen
                pdfFailed:
                  summary: PDF generation failed
                  value:
                    success: false
                    data:
                      message: Failed to generate PDF
                pdfNotFound:
                  summary: PDF file not on disk
                  value:
                    success: false
                    data:
                      message: PDF file not found
                permissionDenied:
                  summary: User cannot access this screen
                  value:
                    success: false
                    data:
                      message: You do not have permission to access this screen
      security:
        - wpAjaxNonce: []
components:
  schemas:
    DownloadResultsRequest:
      type: object
      required:
        - action
        - nonce
        - screen_id
      properties:
        action:
          type: string
          const: sagescreen_download_screen_results
        nonce:
          type: string
          description: WP nonce for `sagescreen_frontend_nonce`
          examples:
            - abc123def456
        screen_id:
          type: integer
          description: Post ID of the `ss_screen`
          examples:
            - 5678
    AjaxErrorResponse:
      type: object
      description: |
        Standard AJAX error. The `data` field is either a plain string
        or an object with a `message` field.
      properties:
        success:
          type: boolean
          const: false
        data:
          oneOf:
            - type: string
              description: Error message as plain string
              examples:
                - Security check failed
            - type: object
              properties:
                message:
                  type: string
                  examples:
                    - Screen ID is required
        message:
          type: string
          description: |
            Present on some endpoints that use `wp_send_json()` directly
            instead of `wp_send_json_error()`.
          examples:
            - Security check failed
  securitySchemes:
    wpAjaxNonce:
      type: apiKey
      in: query
      name: nonce
      description: WordPress AJAX nonce (passed as form field, verified per-action)

````