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

# Your workflows' input types

> The input of every workflow your app has published, at its published version, as JSON Schema: what the libraries' generators (`bin/rails g qube_rails:workflows`, `qube_sync workflows`) write typed start methods from, one per workflow and, for a body whose operation another input names, one per operation. An operation body is `{"$operation": "invoice.create"}`, a reference to that operation's params (the libraries already hold every operation's types, from `/libraries/operations.json`, whose digest is `operations_digest`); an object holding such bodies is a `oneOf` with a `discriminator` naming the input that picks the operation, one branch per operation, each with the `title` generated code names it by.

A `$operation` body's `set_by_workflow` lists the fields the workflow sets itself (the caller's value is overwritten), which generated types make optional; the rest keep the operation's own required fields. The run checks a body's fields and types when it starts, and required fields when it sends the request. With `include=drafts`, `drafts` adds each workflow whose working copy differs from what is published (or that was never published), so you can type against a version before you publish it. `digest` changes whenever any of this does, and is the `ETag`: send it back as `If-None-Match` for a 304. Only your app's workflows; inputs only for now.



## OpenAPI

````yaml /api-reference/v2/openapi.json get /workflows/types
openapi: 3.1.0
info:
  contact:
    email: support@qubesync.com
  description: >
    A single generic operation surface for every curated qbXML request QuBe Sync
    supports, driven directly off the qbXML schema -- see the [MCP
    server](/mcp-server) to explore available operations interactively.


    **Every endpoint queues a request and returns it immediately (`201`, a
    `QueuedRequest`).** QuickBooks Desktop is reached through the customer's Web
    Connector, which polls QuBe Sync, so the answer arrives seconds to minutes
    later. **Pass a `webhook_url` with every request**: when QuickBooks has
    answered, QuBe Sync POSTs the same document to it -- `state` set,
    `response_json` filled in -- signed with `X-QUBE-Signature` (see the
    Webhooks guide). `response_json` is the `{status, data}` envelope documented
    on each operation: `status: "success"` with `data` derived from the qbXML
    `*Ret` (and `warning`, QuickBooks' code and message, when it carried the
    request out but warned about it), or `status: "error"` with QuickBooks' own
    status code and message -- a QuickBooks business error is a *successful*
    HTTP round trip. `links.self` returns the request on demand (for a
    dashboard, a retry, a script); it is not the integration path. Send an
    `Idempotency-Key` header with each request so a call whose answer you never
    got can be sent again without queueing it twice.


    Authentication is HTTP Basic with your app's API key as the username and a
    blank password. Connections themselves (creating one, onboarding, its QWC
    file and password) are the `/connections` endpoints; every QuickBooks
    operation is scoped to one of them.
  title: QuBe Sync API (v2)
  version: 2.0.0
servers:
  - description: v2 API
    url: https://qubesync.com/api/v2
  - description: Local development server
    url: https://dev.qubesync.com/api/v2
security:
  - apiKey: []
tags:
  - description: >-
      Creating and managing the connection (a customer's QuickBooks company
      file) that every request below is queued against. See the Onboarding
      guide.
    name: Connections
  - description: >-
      Queueing qbXML you wrote yourself, listing the requests queued on a
      connection, and discarding one the app no longer wants. A `webhook_url` on
      each request is the integration path (see the Webhooks guide): the listing
      is for a dashboard, a script, or catching up after downtime.
    name: Queued Requests
  - description: >-
      Finding the record in a customer's company file that a name means, even
      written differently: ranked matches from QuBe Sync's index of the file's
      names, on realtime and simulated connections. See the Matching guide.
    name: Matching
  - description: >-
      Endpoints for publishing workflow definitions, starting runs, and
      answering a run that is waiting on a decision from your app. A workflow is
      one JSON statechart document; see the schema at
      /api/v2/workflows/schema.json.
    name: Workflows
  - name: Account Tax Line Infos
  - name: Accounts
  - name: Aging Reports
  - name: Alerts
  - name: Ar Refund Credit Cards
  - name: Bar Codes
  - name: Bill Payment Checks
  - name: Bill Payment Credit Cards
  - name: Bill To Pays
  - name: Billing Rates
  - name: Bills
  - name: Budget Summary Reports
  - name: Build Assemblies
  - name: Charges
  - name: Checks
  - name: Classes
  - name: Cleared Statuses
  - name: Companies
  - name: Company Activities
  - name: Credit Card Charges
  - name: Credit Card Credits
  - name: Credit Memos
  - name: Currencies
  - name: Custom Detail Reports
  - name: Custom Summary Reports
  - name: Customer Msgs
  - name: Customer Types
  - name: Customers
  - name: Data Event Recovery Infos
  - name: Data Ext Defs
  - name: Data Exts
  - name: Date Driven Terms
  - name: Deposits
  - name: Employee Defaults
  - name: Employees
  - name: Entities
  - name: Estimates
  - name: Form1099 Category Account Mappings
  - name: General Detail Reports
  - name: General Summary Reports
  - name: Hosts
  - name: Inventory Adjustments
  - name: Inventory Sites
  - name: Invoices
  - name: Item Assemblies Can Builds
  - name: Item Discounts
  - name: Item Fixed Assets
  - name: Item Groups
  - name: Item Inventories
  - name: Item Inventory Assemblies
  - name: Item Non Inventories
  - name: Item Other Charges
  - name: Item Payments
  - name: Item Receipts
  - name: Item Sales Tax Groups
  - name: Item Sales Taxes
  - name: Item Services
  - name: Item Sites
  - name: Item Subtotals
  - name: Items
  - name: Job Reports
  - name: Job Types
  - name: Journal Entries
  - name: Leads
  - name: List Deleteds
  - name: List Displays
  - name: List Merge
  - name: Lists
  - name: Other Names
  - name: Paychecks
  - name: Payment Methods
  - name: Payments
  - name: Payroll Detail Reports
  - name: Payroll Item Additions
  - name: Payroll Item Company Contributions
  - name: Payroll Item Deductions
  - name: Payroll Item Direct Deposits
  - name: Payroll Item Non Wages
  - name: Payroll Item Taxes
  - name: Payroll Item Wages
  - name: Payroll Item Workers Compensations
  - name: Payroll Items
  - name: Payroll Last Periods
  - name: Payroll Liability Adjustments
  - name: Payroll Liability Checks
  - name: Payroll Prior Payments
  - name: Payroll Summary Reports
  - name: Payroll Year To Date Adjustments
  - name: Preferences
  - name: Price Levels
  - name: Purchase Orders
  - name: Qb Command Exec
  - name: Receive Payment To Deposits
  - name: Receive Payments
  - name: Sales Orders
  - name: Sales Receipts
  - name: Sales Reps
  - name: Sales Tax Codes
  - name: Sales Tax Payables
  - name: Sales Tax Payment Checks
  - name: Sales Tax Return Lines
  - name: Sales Tax Returns
  - name: Ship Methods
  - name: Special Accounts
  - name: Special Items
  - name: Standard Terms
  - name: Templates
  - name: Terms
  - name: Time Reports
  - name: Time Trackings
  - name: To Dos
  - name: Transactions
  - name: Transfer Inventories
  - name: Transfers
  - name: Txn Deleteds
  - name: Txn Displays
  - name: Txn Void
  - name: Txns
  - name: Unit Of Measure Sets
  - name: Vehicle Mileages
  - name: Vehicles
  - name: Vendor Credits
  - name: Vendor Types
  - name: Vendors
  - name: Workers Comp Codes
paths:
  /workflows/types:
    get:
      tags:
        - Workflows
      summary: Your workflows' input types
      description: >-
        The input of every workflow your app has published, at its published
        version, as JSON Schema: what the libraries' generators (`bin/rails g
        qube_rails:workflows`, `qube_sync workflows`) write typed start methods
        from, one per workflow and, for a body whose operation another input
        names, one per operation. An operation body is `{"$operation":
        "invoice.create"}`, a reference to that operation's params (the
        libraries already hold every operation's types, from
        `/libraries/operations.json`, whose digest is `operations_digest`); an
        object holding such bodies is a `oneOf` with a `discriminator` naming
        the input that picks the operation, one branch per operation, each with
        the `title` generated code names it by.


        A `$operation` body's `set_by_workflow` lists the fields the workflow
        sets itself (the caller's value is overwritten), which generated types
        make optional; the rest keep the operation's own required fields. The
        run checks a body's fields and types when it starts, and required fields
        when it sends the request. With `include=drafts`, `drafts` adds each
        workflow whose working copy differs from what is published (or that was
        never published), so you can type against a version before you publish
        it. `digest` changes whenever any of this does, and is the `ETag`: send
        it back as `If-None-Match` for a 304. Only your app's workflows; inputs
        only for now.
      parameters:
        - description: '`drafts` adds each workflow''s draft, marked `draft: true`.'
          in: query
          name: include
          required: false
          schema:
            enum:
              - drafts
            type: string
        - description: >-
            The `ETag` of a document you already have: a 304 when it is still
            current.
          in: header
          name: If-None-Match
          required: false
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              example:
                data:
                  digest: sha256:9f2c...
                  include_drafts: false
                  operations_digest: sha256:41ab...
                  workflows:
                    ensure:
                      description: Finds a list record, or creates it.
                      draft: false
                      input:
                        additionalProperties: false
                        discriminator:
                          propertyName: kind
                        oneOf:
                          - properties:
                              add:
                                $operation: customer.create
                                description: The add to send when nothing is the record.
                              kind:
                                const: customer
                            title: customer
                        properties:
                          add:
                            description: The add to send when nothing is the record.
                            type: object
                          kind:
                            description: The list the add goes to.
                            type: string
                        required:
                          - kind
                        type: object
                      name: Ensure a list record
                      version: 1
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/WorkflowTypes'
                type: object
          description: The types
          headers:
            ETag:
              description: The document's `digest`, quoted.
              schema:
                type: string
        '304':
          description: '`If-None-Match` named the current document: nothing has changed.'
      security:
        - apiKey: []
components:
  schemas:
    WorkflowTypes:
      properties:
        digest:
          description: >-
            `sha256:<hex>` over the rest of the document; the `ETag`, and what a
            generated file's `--check` compares.
          type: string
        drafts:
          additionalProperties:
            $ref: '#/components/schemas/WorkflowTypesEntry'
          description: >-
            With `include=drafts`: each workflow whose working copy differs from
            what is published, by key.
          type: object
        include_drafts:
          type: boolean
        operations_digest:
          description: >-
            The digest of `/libraries/operations.json`, the manifest the
            `$operation` ids refer to.
          type: string
        workflows:
          additionalProperties:
            $ref: '#/components/schemas/WorkflowTypesEntry'
          description: Each published workflow, by key.
          type: object
      required:
        - digest
        - operations_digest
        - include_drafts
        - workflows
      type: object
    WorkflowTypesEntry:
      properties:
        description:
          type:
            - string
            - 'null'
        draft:
          description: Whether this is the working copy rather than a published version.
          type: boolean
        input:
          description: >-
            The run input, as JSON Schema with `$operation` references and
            `oneOf` + `discriminator` for bodies another input picks the
            operation of.
          type: object
        name:
          type: string
        version:
          description: The published version's number; null for a draft.
          type:
            - integer
            - 'null'
      required:
        - name
        - version
        - draft
        - input
      type: object
  securitySchemes:
    apiKey:
      description: Use your app's API key as the username, and leave the password blank
      scheme: basic
      type: http

````

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