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

# Download Document

> Download the binary PDF file for an employee document.

Streams the raw binary PDF for the requested document. Before calling this endpoint, use [Get Document](/v1/endpoint/documents-get) to confirm `downloadable: true` — documents where this flag is `false` cannot be downloaded.

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url "https://v1-api.ticket-plus.app/employee-documents/101/download" \
    --header "Authorization: Basic <base64(clientId:clientSecret)>" \
    --output "invoice.pdf"
  ```

  ```python Python theme={null}
  import requests, base64

  credentials = base64.b64encode(b"<clientId>:<clientSecret>").decode()

  res = requests.get(
      "https://v1-api.ticket-plus.app/employee-documents/101/download",
      headers={"Authorization": f"Basic {credentials}"},
  )
  with open("invoice.pdf", "wb") as f:
      f.write(res.content)
  ```

  ```javascript Node.js theme={null}
  import { writeFileSync } from "fs";

  const credentials = Buffer.from("<clientId>:<clientSecret>").toString("base64");

  const res = await fetch(
    "https://v1-api.ticket-plus.app/employee-documents/101/download",
    { headers: { Authorization: `Basic ${credentials}` } },
  );
  writeFileSync("invoice.pdf", Buffer.from(await res.arrayBuffer()));
  ```
</RequestExample>

<ResponseExample>
  ```http 200 application/pdf theme={null}
  Content-Type: application/pdf

  <binary PDF data>
  ```
</ResponseExample>

<Warning>
  Only documents where `downloadable: true` can be downloaded. Attempting to
  download a non-downloadable document will return an error.
</Warning>

## Path Parameters

<ParamField path="id" type="integer" required>
  The unique numeric ID of the document to download.
</ParamField>

## Response

### `200 OK` — `application/pdf`

<ResponseField name="(binary)" type="string (binary)">
  The raw PDF file binary. There is no JSON wrapper — the response body is the file itself. Save to disk or stream directly to the user.

  Response header: `Content-Type: application/pdf`
</ResponseField>


## OpenAPI

````yaml GET /employee-documents/{id}/download
openapi: 3.0.3
info:
  title: JobTicket API
  description: >-
    The JobTicket B2B API lets you read employee data, manage HR integrations,
    and access employee documents programmatically. All endpoints use HTTP Basic
    Auth — pass your API key credentials from the Developer Portal as the
    username and password.
  version: 1.0.0
servers:
  - url: https://v1-api-staging.ticket-plus.app
    description: Staging server
  - url: https://v1-api.ticket-plus.app
    description: Production Server
security:
  - basicAuth: []
externalDocs:
  url: https://jobticket-docs.ticket-plus.app
  description: View our documentation to get more info
paths:
  /employee-documents/{id}/download:
    get:
      tags:
        - Employee Documents
      summary: Download Employee Document
      description: >-
        Streams the raw binary PDF for the requested document. Only documents
        where `downloadable: true` can be downloaded. Requires the
        `view-employees` permission.
      parameters:
        - schema:
            type: integer
          in: path
          name: id
          required: true
          description: The unique numeric ID of the document to download.
      responses:
        '200':
          description: Raw binary PDF file.
          content:
            application/pdf:
              schema:
                type: string
                format: binary
                description: The file binary. Save to disk or pipe directly to the user.
      security:
        - basicAuth: []
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        HTTP Basic Auth using your API key credentials. Use the username and
        password issued from the Developer Portal. Encode them as
        `Base64(username:password)` and pass in the `Authorization: Basic
        <token>` header.

````