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

# Export Project to PDF

> Kick off an asynchronous PDF export for a project. Returns immediately with an `exportId` — the PDF is generated in the background by AWS Lambda (Puppeteer rendering each sheet, then combined with watermarks).

Poll `GET /v1/exports/{exportId}` until `state === "completed"`. `exportUrl` is `null` while `processing` or `failed`; once complete, download from it (presigned S3 URL, refreshed on each poll with a 10-minute TTL).

If no `sheetIds` are provided, all sheets in the project are exported.



## OpenAPI

````yaml api/openapi.json POST /v1/projects/{projectId}/export
openapi: 3.1.0
info:
  title: Connections Hub API
  version: 1.0.0
  description: >-
    Run HSS Connections Hub calculators programmatically: create projects,
    create and solve sheets from any calculator template, run batches, and
    export reports to PDF.


    All endpoints require API key authentication.
servers:
  - url: https://api.calcs.com
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: >-
      Create and manage calculation projects. Each user can have multiple
      projects to organize their calculations.
  - name: Sheets
    description: >-
      Manage individual calculation sheets — read one back, update its inputs,
      solve or re-solve it, and delete single sheets or clean up many at once.
  - name: Templates
    description: >-
      Run calculations using any enabled template. Supports all calculator types
      without requiring endpoint-specific code.
paths:
  /v1/projects/{projectId}/export:
    post:
      tags:
        - Projects
      summary: Export Project to PDF
      description: >-
        Kick off an asynchronous PDF export for a project. Returns immediately
        with an `exportId` — the PDF is generated in the background by AWS
        Lambda (Puppeteer rendering each sheet, then combined with watermarks).


        Poll `GET /v1/exports/{exportId}` until `state === "completed"`.
        `exportUrl` is `null` while `processing` or `failed`; once complete,
        download from it (presigned S3 URL, refreshed on each poll with a
        10-minute TTL).


        If no `sheetIds` are provided, all sheets in the project are exported.
      operationId: export-project
      parameters:
        - name: Authorization
          in: header
          required: true
          example: Bearer YOUR_KEY_HERE
          schema:
            type: string
          description: >-
            The `Authorization` header is used to authenticate with the API
            using your API key. Value is of the format `Bearer YOUR_KEY_HERE`.
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Project UUID
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                sheetIds:
                  type: array
                  items:
                    type: string
                    format: uuid
                  description: >-
                    Sheet UUIDs to include in the export. Defaults to all sheets
                    in the project.
                printMode:
                  type: string
                  enum:
                    - supersummary
                    - summary
                    - details
                  default: summary
                  description: >-
                    Level of detail in the PDF. `supersummary` = one-line per
                    sheet, `summary` = standard output, `details` = full
                    working.
                paperSize:
                  type: string
                  enum:
                    - A4
                    - Letter
                  default: Letter
                locale:
                  type: string
                  default: en-US
                  description: >-
                    BCP-47 locale used for number and unit formatting (e.g.
                    `en-US`, `en-AU`, `en-GB`).
                includeToc:
                  type: boolean
                  default: false
                  description: Include a table-of-contents page at the start of the PDF.
            examples:
              all_sheets:
                summary: Export all sheets with defaults
                value: {}
              selected_sheets:
                summary: Export selected sheets with detailed working
                value:
                  sheetIds:
                    - 11111111-1111-1111-1111-111111111111
                    - 22222222-2222-2222-2222-222222222222
                  printMode: details
                  paperSize: A4
                  locale: en-AU
                  includeToc: true
      responses:
        '201':
          description: >-
            Export job accepted. Poll `GET /v1/exports/{exportId}` until `state
            === "completed"`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportStatus'
              examples:
                processing:
                  summary: >-
                    Accepted — poll until completed; exportUrl is null while
                    processing
                  value:
                    exportId: 662f0b28-3c2e-4dae-a61b-1bdfa367373b
                    state: processing
                    progressPercent: 0
                    exportUrl: null
        '400':
          description: >-
            Malformed request — invalid printMode, paperSize, locale,
            includeToc, or a non-UUID / empty sheetIds array.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                empty_sheet_ids:
                  summary: sheetIds present but empty
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: >-
                        sheetIds cannot be empty; omit the field to export all
                        sheets
                      details:
                        - field: sheetIds
                          message: >-
                            sheetIds cannot be empty; omit the field to export
                            all sheets
                non_uuid_sheet_id:
                  summary: sheetIds contains a non-UUID value
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: sheetIds must contain only UUID strings
                      details:
                        - field: sheetIds
                          message: sheetIds must contain only UUID strings
                invalid_print_mode:
                  summary: Invalid printMode enum value
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: 'printMode must be one of: supersummary, summary, details'
                      details:
                        - field: printMode
                          message: >-
                            printMode must be one of: supersummary, summary,
                            details
        '401':
          description: Unauthorized — missing or invalid API key.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
              examples:
                unauthorized:
                  summary: Missing or invalid API key
                  value:
                    type: https://httpproblems.com/http-status/401
                    title: Unauthorized
                    status: 401
                    detail: No Authorization Header
                    instance: /v1/projects/84cb248b-a36f-41a9-9639-575bc597341e/export
                    trace:
                      timestamp: '2026-07-03T04:24:41.646Z'
                      requestId: 782427e6-6a0f-4d4d-84cf-ffcc8dd38731
                      buildId: 2bca24cd-6038-4608-b26c-a997deb070d3
                      rayId: a1531f3c39b6e6e1
        '403':
          description: The project does not exist, or is not accessible with this API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                access_denied:
                  summary: Project is unknown or not accessible to this API key
                  value:
                    error:
                      code: ACCESS_DENIED
                      message: Access to this project is restricted
        '422':
          description: >-
            One or more sheetIds are well-formed but do not belong to this
            project. `details` lists each offending id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                sheet_not_in_project:
                  summary: A requested sheetId does not belong to the project
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: One or more sheetIds do not belong to this project.
                      details:
                        - field: sheetIds
                          message: >-
                            Sheet 11111111-1111-1111-1111-111111111111 does not
                            belong to this project.
      security:
        - api_key: []
components:
  schemas:
    ExportStatus:
      type: object
      description: >-
        Async PDF export status. `exportUrl` is `null` while the export is
        `processing` or `failed`, and is populated with a presigned download URL
        only once `state === "completed"`; that URL then expires 10 minutes
        after each poll.
      properties:
        exportId:
          type: string
          format: uuid
        state:
          type: string
          enum:
            - processing
            - completed
            - failed
        progressPercent:
          type: number
          minimum: 0
          maximum: 100
        exportUrl:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            Presigned S3 URL, or `null` while the export is still processing or
            has failed. Populated only once `state === "completed"`, after which
            it expires 10 minutes after this response.
      required:
        - exportId
        - state
        - progressPercent
        - exportUrl
    ValidationError:
      type: object
      description: Validation error response for invalid API inputs
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - VALIDATION_ERROR
              description: Error code for validation failures
            message:
              type: string
              description: Human-readable error summary
              example: Input validation failed
            details:
              type: array
              description: Array of specific validation errors
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: Path to the invalid field (e.g., 'L_X', 'supports.0.2')
                  message:
                    type: string
                    description: Description of what's wrong with the field
                required:
                  - field
                  - message
          required:
            - code
            - message
      required:
        - error
      example:
        error:
          code: VALIDATION_ERROR
          message: Input validation failed
          details:
            - field: L_X
              message: Expected number, received string
            - field: supports
              message: At least 2 supports are required
    ProblemDetails:
      type: object
      description: >-
        RFC 7807 (`application/problem+json`) error returned by the API gateway
        before a request reaches the handler — currently authentication failures
        (401). Note this differs from the `{ error: { code, message, details }
        }` envelope returned by the handler for validation and not-found errors.
      properties:
        type:
          type: string
          format: uri
          description: URI identifying the problem type.
        title:
          type: string
          description: Short, human-readable summary of the problem type.
        status:
          type: integer
          description: HTTP status code.
        detail:
          type: string
          description: Human-readable explanation specific to this occurrence.
        instance:
          type: string
          description: The request path that produced the error.
        trace:
          type: object
          description: >-
            Gateway trace metadata for support (timestamp, requestId, buildId,
            rayId).
      required:
        - type
        - title
        - status
        - detail
    ErrorResponse:
      type: object
      description: >-
        Standard error envelope for handler errors. `code` is a stable
        machine-readable error code (e.g. NOT_FOUND, UPSTREAM_ERROR); `message`
        is human-readable and may change.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code.
            message:
              type: string
              description: Human-readable error message.
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send your API key as a bearer token: `Authorization: Bearer
        YOUR_API_KEY`. Every endpoint requires one.
    api_key:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.