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

# List All Documents

> Retrieve a paginated list of all employee documents across the entire company.

Returns every document in the system across all employees, with support for filtering by employee ID, document file type, or specific document IDs. Use this for company-wide document reporting. To list documents for a single employee, use [List Employee Documents](/v1/endpoint/employees-documents) instead.

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url "https://v1-api.ticket-plus.app/employee-documents?page=1&perPage=10" \
    --header "Authorization: Basic <base64(clientId:clientSecret)>"
  ```

  ```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",
      params={"page": 1, "perPage": 10},
      headers={"Authorization": f"Basic {credentials}"},
  )
  print(res.json())
  ```

  ```javascript Node.js theme={null}
  const credentials = Buffer.from("<clientId>:<clientSecret>").toString("base64");

  const res = await fetch(
    "https://v1-api.ticket-plus.app/employee-documents?page=1&perPage=10",
    { headers: { Authorization: `Basic ${credentials}` } },
  );
  console.log(await res.json());
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": {
      "data": [
        {
          "id": 101,
          "employeeId": 42,
          "documentName": "May 2024 Transit Invoice",
          "documentFileType": "pdf",
          "downloadable": true,
          "createdAt": "2024-05-01T09:00:00Z",
          "updatedAt": "2024-05-01T09:00:00Z",
          "resource": "employee-document",
          "_links": {
            "self": { "href": "https://v1-api.ticket-plus.app/employee-documents/101", "type": "application/json" },
            "employee": { "href": "https://v1-api.ticket-plus.app/employees/42", "type": "application/json" }
          }
        }
      ],
      "page": 1,
      "perPage": 10,
      "totalPages": 12,
      "total": 118
    }
  }
  ```
</ResponseExample>

## Query Parameters

<ParamField query="search" type="string">
  Full-text search across document names.
</ParamField>

<ParamField query="page" type="integer" default="1">
  Page number to return. Starts at `1`.
</ParamField>

<ParamField query="perPage" type="integer" default="10">
  Number of results per page. Maximum is `100`.
</ParamField>

<ParamField query="sortOrder" type="string" default="desc">
  Sort direction. Allowed values: `asc`, `desc`.
</ParamField>

<ParamField query="sortField" type="string" default="id">
  Field to sort results by. Allowed values: `id`, `employeeId`, `createdAt`,
  `updatedAt`.
</ParamField>

<ParamField query="ids" type="integer[]">
  Filter to a specific set of document IDs.
</ParamField>

<ParamField query="employeeIds" type="integer[]">
  Filter to documents belonging to specific employee IDs.
</ParamField>

<ParamField query="documentFileTypes" type="string[]">
  Filter by file extension, e.g. `pdf`.
</ParamField>

## Response

<ResponseField name="data" type="object" required>
  <Expandable title="properties">
    <ResponseField name="data" type="object[]" required>
      Array of document objects.

      <Expandable title="document object">
        <ResponseField name="id" type="integer" required>
          Unique document identifier. Use this `id` with the [Download
          Document](/v1/endpoint/documents-download) endpoint.
        </ResponseField>

        <ResponseField name="employeeId" type="integer | null">
          ID of the employee this document belongs to.
        </ResponseField>

        <ResponseField name="documentName" type="string" required>
          Human-readable name of the document.
        </ResponseField>

        <ResponseField name="documentFileType" type="string" required>
          File extension of the document, e.g. `pdf`.
        </ResponseField>

        <ResponseField name="downloadable" type="boolean" required>
          `true` if the file binary can be fetched via [Download
          Document](/v1/endpoint/documents-download). `false` means the file is
          not available for download.
        </ResponseField>

        <ResponseField name="createdAt" type="string" required>
          ISO 8601 timestamp when the document was created.
        </ResponseField>

        <ResponseField name="updatedAt" type="string" required>
          ISO 8601 timestamp when the document was last updated.
        </ResponseField>

        <ResponseField name="resource" type="string" required>
          Resource type label. Always `"employee-document"`.
        </ResponseField>

        <ResponseField name="_links" type="object" required>
          HAL hypermedia links.

          <Expandable title="properties">
            <ResponseField name="self" type="object" required>
              Link to this document resource.

              <Expandable title="properties">
                <ResponseField name="href" type="string" required>
                  URL of this document.
                </ResponseField>

                <ResponseField name="type" type="string" required>
                  Media type.
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="employee" type="object" required>
              Link to the employee who owns this document.

              <Expandable title="properties">
                <ResponseField name="href" type="string" required>
                  URL of the owning employee.
                </ResponseField>

                <ResponseField name="type" type="string" required>
                  Media type.
                </ResponseField>
              </Expandable>
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="page" type="integer" required>
      Current page number.
    </ResponseField>

    <ResponseField name="perPage" type="integer" required>
      Number of results per page.
    </ResponseField>

    <ResponseField name="totalPages" type="integer" required>
      Total number of pages available.
    </ResponseField>

    <ResponseField name="total" type="integer" required>
      Total number of documents matching your filters.
    </ResponseField>
  </Expandable>
</ResponseField>


## OpenAPI

````yaml GET /employee-documents
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:
    get:
      tags:
        - Employee Documents
      summary: Paginate All Employee Documents
      description: >-
        Returns a paginated, filterable list of every employee document in the
        company. Use `employeeIds` or `documentFileTypes` to narrow results.
        Requires the `view-employees` permission on the API key.
      parameters:
        - schema:
            type: string
            nullable: true
          in: query
          name: search
          required: false
          description: Full-text search across document names.
        - schema:
            type: integer
            minimum: 0
            default: 1
            nullable: true
          in: query
          name: page
          required: false
          description: Page number to return. Starts at 1.
        - schema:
            type: integer
            minimum: 0
            maximum: 100
            default: 10
            nullable: true
          in: query
          name: perPage
          required: false
          description: Number of results per page. Maximum is 100.
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
            nullable: true
          in: query
          name: sortOrder
          required: false
          description: Sort direction — `asc` for ascending, `desc` for descending.
        - schema:
            type: string
            enum:
              - id
              - employeeId
              - createdAt
              - updatedAt
            default: id
            nullable: true
          in: query
          name: sortField
          required: false
          description: Field to sort results by.
        - schema:
            type: array
            items:
              type: integer
              minimum: 0
            nullable: true
          in: query
          name: ids
          required: false
          description: Filter to a specific set of document IDs.
        - schema:
            type: array
            items:
              type: integer
              minimum: 0
            nullable: true
          in: query
          name: employeeIds
          required: false
          description: Filter to documents belonging to specific employee IDs.
        - schema:
            type: array
            items:
              type: string
            nullable: true
          in: query
          name: documentFileTypes
          required: false
          description: Filter by document file type (e.g. `contract`, `payslip`).
      responses:
        '200':
          description: A paginated list of employee documents.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      data:
                        type: array
                        description: Array of document objects.
                        items:
                          type: object
                          properties:
                            id:
                              type: integer
                              description: Unique document identifier.
                            employeeId:
                              type: integer
                              nullable: true
                              description: ID of the employee this document belongs to.
                            documentName:
                              type: string
                              description: Human-readable name of the document.
                            documentFileType:
                              type: string
                              description: >-
                                Category of the document, e.g. `contract`,
                                `payslip`.
                            downloadable:
                              type: boolean
                              description: >-
                                Whether the binary file can be fetched via the
                                download endpoint.
                            createdAt:
                              type: string
                              format: date-time
                              description: >-
                                ISO 8601 timestamp when the document was
                                created.
                            updatedAt:
                              type: string
                              format: date-time
                              description: >-
                                ISO 8601 timestamp when the document was last
                                updated.
                            resource:
                              type: string
                              description: Resource type label, always `employee-document`.
                            _links:
                              type: object
                              description: HAL hypermedia links.
                              properties:
                                self:
                                  type: object
                                  description: Link to this document.
                                  properties:
                                    href:
                                      type: string
                                    type:
                                      type: string
                                  required:
                                    - href
                                    - type
                                employee:
                                  type: object
                                  description: Link to the owning employee.
                                  properties:
                                    href:
                                      type: string
                                    type:
                                      type: string
                                  required:
                                    - href
                                    - type
                              required:
                                - self
                                - employee
                          required:
                            - id
                            - employeeId
                            - documentName
                            - documentFileType
                            - downloadable
                            - createdAt
                            - updatedAt
                            - resource
                            - _links
                      page:
                        type: integer
                        description: Current page number.
                      perPage:
                        type: integer
                        description: Number of results per page.
                      totalPages:
                        type: integer
                        description: Total number of pages.
                      total:
                        type: integer
                        description: Total number of matching documents.
                    required:
                      - data
                      - page
                      - perPage
                      - totalPages
                      - total
                required:
                  - data
      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.

````