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

# Get a package document

> Returns one document with its fields and a download URL that expires after an hour.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/packages/{packageId}/documents/{documentId}
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/packages/{packageId}/documents/{documentId}:
    get:
      tags:
        - Packages
      summary: Get a package document
      description: >-
        Returns one document with its fields and a download URL that expires
        after an hour.
      operationId: getPackagesByPackageIdDocumentsByDocumentId
      parameters:
        - schema:
            type: string
          required: true
          name: packageId
          in: path
        - schema:
            type: string
          required: true
          name: documentId
          in: path
        - 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:
                    allOf:
                      - $ref: '#/components/schemas/Document'
                      - type: object
                        properties:
                          downloadUrl:
                            type: string
                            nullable: true
                            description: >-
                              A signed URL for the file, valid for one hour.
                              Serves the sealed, signed copy once the package
                              has completed and the original before that. Null
                              while a completed package's signed copies are
                              still being prepared, or when no file is stored.
                            example: >-
                              https://xyzcompany.supabase.co/storage/v1/object/sign/pdf/cmg1org00001/cmg1ws000001/packages/cmg1p4k2a0003v9x0hq7d2e1s/completed/cmg1p4k2a0007v9x0d8n3f5t2.pdf?token=eyJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJwZGYvLi4uIn0.k3Yv8Qm2pL1nR7tW4xZc9aB5dE0fG6hJ
                          fields:
                            type: array
                            items:
                              allOf:
                                - $ref: '#/components/schemas/PlacedField'
                                - type: object
                                  properties:
                                    recipientId:
                                      type: string
                                      nullable: true
                                      description: >-
                                        The package recipient who completes this
                                        field, or null when it is assigned to
                                        nobody. The same id `PUT
                                        /api/v1/packages/:packageId/fields`
                                        takes.
                                      example: cmg1p4k2a0005v9x0r1c9t3m7
                                  required:
                                    - recipientId
                              description: >-
                                A field as it is placed on a document. It has
                                the same shape the field endpoints take, so a
                                field can be read, changed and written back
                                whole.
                            description: >-
                              Every field placed on the document, except those
                              on pages the sender removed. Each has the shape
                              `PUT /api/v1/packages/:packageId/fields` takes, so
                              it can be changed and written back whole.
                          createdAt:
                            type: string
                            description: >-
                              When the document was added to the package, as an
                              ISO 8601 timestamp in UTC.
                            example: '2026-03-12T09:41:07.000Z'
                          updatedAt:
                            type: string
                            description: >-
                              When the document or its file last changed, as an
                              ISO 8601 timestamp in UTC.
                            example: '2026-03-12T09:43:52.000Z'
                        required:
                          - downloadUrl
                          - fields
                          - createdAt
                          - updatedAt
                    description: A document attached to a package or template.
                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'
        '404':
          description: >-
            No package with that id is visible to the caller, or the document is
            not attached to it
          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:
    Document:
      type: object
      properties:
        id:
          type: string
          description: The document's id.
          example: cmg4v8q2k0003s7xhq1w8n5r7
        title:
          type: string
          description: 'The document''s title: its file name without the extension.'
          example: Employment agreement
        pageCount:
          type: integer
          description: How many pages the document has.
          example: 4
      required:
        - id
        - title
        - pageCount
      description: A document attached to a package or template.
    PlacedField:
      type: object
      properties:
        id:
          type: string
          description: The field's id, as given when it was placed.
          example: cmg1p4k2a000bv9x0f2r6s8u4
        pageNumber:
          type: integer
          description: The page the field sits on, counting from 1.
          example: 1
        fieldType:
          $ref: '#/components/schemas/FieldType'
        position:
          type: object
          properties:
            x:
              type: number
              description: >-
                Distance from the page's left edge to the field's left edge, as
                a fraction of the page width (0 is the left edge, 1 the right).
              example: 0.12
            'y':
              type: number
              description: >-
                Distance from the page's top edge to the field's top edge, as a
                fraction of the page height (0 is the top, 1 the bottom).
              example: 0.78
          required:
            - x
            - 'y'
          description: >-
            The field's top-left corner, as fractions of the page's width and
            height. Fractions keep the placement valid whatever the page's pixel
            size.
          example:
            x: 0.12
            'y': 0.78
        size:
          type: object
          properties:
            width:
              type: number
              description: The field's width as a fraction of the page width.
              example: 0.28
            height:
              type: number
              description: The field's height as a fraction of the page height.
              example: 0.05
          required:
            - width
            - height
          description: The field's extent, as fractions of the page's width and height.
          example:
            width: 0.28
            height: 0.05
        isRequired:
          type: boolean
          description: Whether the recipient must complete the field before finishing.
          example: true
        placeholder:
          type: string
          nullable: true
          description: >-
            Text shown inside the empty field in place of the default for its
            type, or null. For a `label` field it is the text itself.
          example: Sign here
        dropdownOptions:
          type: array
          items:
            type: string
          description: >-
            The choices a `dropdown` field offers, in display order. Empty for
            other types.
          example:
            - Full time
            - Part time
            - Casual
        radioGroup:
          type: string
          nullable: true
          description: >-
            For a `radio` field, the name shared by every option in the same
            group, or null for other types.
          example: employment-type
      required:
        - id
        - pageNumber
        - fieldType
        - position
        - size
        - isRequired
        - placeholder
        - dropdownOptions
        - radioGroup
      description: >-
        A field as it is placed on a document. It has the same shape the field
        endpoints take, so a field can be read, changed and written back whole.
    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
    FieldType:
      type: string
      enum:
        - text
        - signature
        - date
        - initial
        - comment
        - name
        - email
        - company
        - title
        - number
        - checkbox
        - radio
        - dropdown
        - formula
        - payment
        - label
        - attachment
      description: >-
        What the field collects. `signature` and `initial` capture a drawn or
        typed mark. `date` is filled with the signing date. `name`, `email`,
        `company` and `title` are single-line text prefilled from the
        recipient's details where known. `text` is free text and `number` a
        numeric value. `checkbox` is a tick box; `radio` is one option of a
        group named by `radioGroup`, of which the recipient picks one;
        `dropdown` offers `dropdownOptions`. `comment` is a multi-line note.
        `attachment` asks the recipient to upload a file. `label` is static text
        the sender writes and nobody fills. `formula` (a calculated value) and
        `payment` are placed only in the app for now.
      example: signature
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: fsk_*

````