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

> ## Agent Instructions
> Flowsign is one word with a lowercase s.
> The REST API base URL is https://my.flowsign.app and every endpoint lives under /api/v1.
> When answering API questions, cite the HTTP method and endpoint path.
> API access needs the Enterprise plan and an API key with the API access permission.

# List library documents

> Lists up to 50 library documents that can be attached to a package. Requires canSendPackages.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/library/documents
openapi: 3.0.3
info:
  title: Flowsign API
  version: 1.0.0
  description: >-
    Public v1 API for Flowsign. Every endpoint is authenticated with a Bearer
    API key (prefix `fsk_`). Errors use `{ error, details? }`; success responses
    wrap payload data as `{ data }`.


    An organisation is divided into workspaces. A key is issued for one
    workspace and acts there on every request (see `GET /api/v1/workspaces`);
    `X-Workspace-Id` is optional and may only name that workspace. Packages,
    templates, contacts and members are scoped to the key's workspace.
servers:
  - url: https://my.flowsign.app
    description: Production
security:
  - ApiKey: []
paths:
  /api/v1/library/documents:
    get:
      tags:
        - Library
      summary: List library documents
      description: >-
        Lists up to 50 library documents that can be attached to a package.
        Requires canSendPackages.
      operationId: getLibraryDocuments
      parameters:
        - schema:
            type: string
            minLength: 1
            description: >-
              Keeps only documents whose title contains this text, ignoring
              case. Surrounding whitespace is trimmed.
            example: employment
          required: false
          name: search
          in: query
        - schema:
            type: string
            description: >-
              The workspace the key was issued for, as returned by `GET
              /api/v1/workspaces`. Optional: omitting it acts in the key's
              workspace, and any other id is rejected with 401.
          required: false
          name: x-workspace-id
          in: header
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      documents:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: >-
                                The library document's id, one of `documentIds`
                                when attaching it to a package.
                              example: cmg1ld8x40001v9x0l4b2r7y3
                            title:
                              type: string
                              description: The document's title.
                              example: Employment agreement.pdf
                            pageCount:
                              type: integer
                              description: How many pages the document has.
                              example: 4
                            fileSize:
                              type: integer
                              description: The stored file's size in bytes.
                              example: 182344
                            kind:
                              $ref: '#/components/schemas/DocumentKind'
                            thumbnailUrl:
                              type: string
                              format: uri
                              description: >-
                                A signed URL for the first page's thumbnail,
                                valid for one hour. Absent when no thumbnail has
                                been generated.
                              example: >-
                                https://xyzcompany.supabase.co/storage/v1/object/sign/pdf/cmg1org00001/cmg1ws000001/library/cmg1ld8x40001v9x0l4b2r7y3/thumbnail.png?token=eyJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJwZGYvLi4uIn0.k3Yv8Qm2pL1nR7tW4xZc9aB5dE0fG6hJ
                          required:
                            - id
                            - title
                            - pageCount
                            - fileSize
                            - kind
                        description: >-
                          Up to 50 documents, pinned ones first and then the
                          most recently updated.
                    required:
                      - documents
                required:
                  - data
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Caller's plan does not include this feature (publicApi / webhooks)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: API key present but caller lacks the required permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Request failed schema validation; details keyed by field
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded; see `Retry-After`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    DocumentKind:
      type: string
      enum:
        - STANDARD
        - DYNAMIC
      description: >-
        `STANDARD` is an uploaded PDF whose pages are fixed. `DYNAMIC` is a
        document converted from an editable source into content Flowsign edits
        and lays out itself, so its pages are not fixed.
      example: STANDARD
    Error:
      type: object
      properties:
        error:
          type: string
          description: What went wrong, in plain words.
          example: 'Missing permission: canSendPackages'
        details:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: >-
            Validation problems keyed by field path. Present only on 422
            responses.
          example:
            recipients.0.email:
              - Invalid email
      required:
        - error
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: fsk_*

````