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

# Validate a chart without saving it

> Always responds 200. `valid` says whether the chart would be accepted; `errors` lists every problem with a document-shaped path, and `warnings` carries the non-blocking lint (unreachable states, undeclared inputs).



## OpenAPI

````yaml /api-reference/v2/openapi.json post /workflows/validate
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/validate:
    post:
      tags:
        - Workflows
      summary: Validate a chart without saving it
      description: >-
        Always responds 200. `valid` says whether the chart would be accepted;
        `errors` lists every problem with a document-shaped path, and `warnings`
        carries the non-blocking lint (unreachable states, undeclared inputs).
      requestBody:
        content:
          application/json:
            schema:
              properties:
                definition:
                  $ref: '#/components/schemas/WorkflowChart'
              required:
                - definition
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  errors:
                    items:
                      $ref: '#/components/schemas/WorkflowError'
                    type: array
                  valid:
                    type: boolean
                  warnings:
                    items:
                      $ref: '#/components/schemas/WorkflowError'
                    type: array
                type: object
          description: The verdict
      security:
        - apiKey: []
components:
  schemas:
    WorkflowChart:
      additionalProperties: false
      description: >-
        A workflow is one JSON document: a Harel statechart whose states queue
        QuickBooks requests, pause for a decision from the calling app, or
        transform data. Qube.Workflows.Chart.validate/1 is the source of truth;
        this schema is documentation and a first-pass check. A run takes at most
        500 transitions, then fails with fault transition_limit: a paginating
        loop costs about two per page, so about 250 pages a run.
      properties:
        description:
          type: string
        headline:
          description: >-
            One plain sentence saying what happened when the run ends
            `completed`, the `headline` of its webhook, rendered as a declared
            outcome's `headline` is. Without one the webhook says "\<name>
            completed."
          type: string
        initial:
          $ref: '#/components/schemas/WorkflowChartIdentifier'
        input:
          additionalProperties:
            $ref: '#/components/schemas/WorkflowChartInputDeclaration'
          description: >-
            What a run accepts. Validated at run start and published as a JSON
            Schema.
          propertyNames:
            $ref: '#/components/schemas/WorkflowChartIdentifier'
          type: object
        key:
          $ref: '#/components/schemas/WorkflowChartWorkflowKey'
        name:
          type: string
        'on':
          $ref: '#/components/schemas/WorkflowChartEventMap'
        outcomes:
          additionalProperties:
            properties:
              description:
                description: >-
                  What this ending means, when its key does not say it already.
                  Optional. Shown on the canvas, in the usage contract and in
                  the guide.
                type: string
              headline:
                description: >-
                  One plain sentence saying what happened when the run ends this
                  way, the `headline` of its webhook: a template, rendered with
                  the run's context and `output` (and `error` on a failure),
                  such as "Created \${output.record.full_name} in QuickBooks." A
                  value it names that is missing, or a template that does not
                  render, gives the engine's own sentence instead. For people:
                  an app never parses it.
                type: string
              kind:
                default: success
                description: >-
                  success: the run ends completed with this outcome. failure:
                  the run ends failed with this outcome, and a workflow calling
                  this one receives it as an error with response.outcome set.
                enum:
                  - success
                  - failure
              output:
                description: >-
                  Template rendered when the run ends this way, instead of the
                  chart's own `output`. While it renders, `meta.outcome` holds
                  the outcome key.
            type: object
          description: >-
            Extra ways a run can end, beyond completed and failed. Each is a
            success (the default: the workflow worked as designed and this is
            how it ended; the run ends `completed` with this `outcome`) or, with
            `"kind": "failure"`, a named failure (the run ends `failed` with
            this `outcome`, and `error` is whatever the transition assigned to
            `error`, else the description, else `ended with outcome <key>`). A
            transition may target a declared outcome from anywhere, and no state
            at any level may use one of these keys.
          propertyNames:
            pattern: ^[a-z][a-z0-9_]{0,49}$
          type: object
        output:
          description: >-
            Template evaluated against the final context when the run reaches
            `completed` or an outcome with no `output` of its own. Defaults to
            \${vars}. While it renders, `meta.outcome` holds the outcome key.
        states:
          $ref: '#/components/schemas/WorkflowChartStatesMap'
        ui:
          description: >-
            Canvas bookkeeping for the chart itself, ignored by the engine: one
            entry per outcome placing its terminal node, and `transitions`
            placing the pills of the root's own handlers, keyed
            "\<event>|\<index>".
          type: object
        version:
          const: 1
      required:
        - version
        - initial
        - states
      title: QuBeSync workflow chart
      type: object
    WorkflowError:
      description: One problem, located inside the document it came from.
      properties:
        message:
          example: unknown target "bar"
          type: string
        path:
          example: states.resolve_conflict.states.ask.on.rename.0.target
          type: string
      type: object
    WorkflowChartIdentifier:
      pattern: ^[a-z][a-z0-9_]{0,49}$
      type: string
    WorkflowChartInputDeclaration:
      else:
        not:
          required:
            - operation
      if:
        properties:
          type:
            const: operation
        required:
          - type
      properties:
        body_of:
          $ref: fe67c917-4f38-48cc-a78a-5939f259a024
          description: >-
            On an object input that isn't a list: it is the body of the
            QuickBooks operation another input names, validated against that
            operation's params when the run starts, so a field the operation
            doesn't take is a 422 at the start (input.params: unknown parameter:
            "customer_rf"). {"operation": "\<input>"} when that input holds an
            operation id (add_transaction's params, named by operation);
            {"kind": "\<input>", "action": "create" | "update" | "query"} when
            it holds a kind (ensure's add, named by kind: \<kind>.create). The
            input it names is a string input, not a list. Inside a schema,
            body_of goes on a property and names a property beside it. The typed
            starts the libraries generate (GET /api/v2/workflows/types) read it.
        description:
          type: string
        enum:
          description: >-
            On a string input: the values a run may give it, checked when the
            run starts (add_transaction's operation lists the transaction adds).
            An object or array input says its values with schema.
          items:
            type: string
          minItems: 1
          type: array
        example:
          description: >-
            An example value, in the input's own JSON type: a string, a number,
            an object, or for a list the whole list. It is what the usage
            contract's start body and the dashboard's Run drawer show. An
            operation input needs none: its example is built from the operation.
            Nor does a list of objects a workflow state runs through (each:
            ${input.<name>}): its example is one element of what that workflow
            takes.
        list:
          default: false
          description: >-
            A list of what the rest of the declaration describes: with type
            operation, a list of that operation's bodies. The run input then
            takes an array, and each element is validated on its own.
          type: boolean
        only:
          items:
            type: string
          type: array
        operation:
          description: >-
            The operation this input is a body for. Left out, the input takes a
            pair -- {"operation": "customer.query", "params": {...}} --
            validated against whichever operation the run names, which a request
            state sends with "operation": "\${input.\<name>.operation}" and
            "params": {"\$from": "\${input.\<name>.params}"}.
          type: string
        required:
          type: boolean
        schema:
          $ref: '#/components/schemas/WorkflowChartInputSchema'
          description: >-
            The shape of one value of this input (of each element, for a list),
            checked when a run starts and against the example: a subset of JSON
            Schema (type, properties, required, additionalProperties, items,
            enum, description, body_of). Allowed on an object or array input, or
            a list input that isn't an operation. Its top-level type defaults to
            the input's type. The reference picker and lint read its fields, so
            \${input.\<name>.\<field>} naming a field it lacks is a warning.
        type:
          enum:
            - string
            - number
            - boolean
            - object
            - array
            - operation
      required:
        - type
      then:
        not:
          required:
            - schema
      type: object
    WorkflowChartWorkflowKey:
      pattern: ^[a-z][a-z0-9_]{0,63}$
      type: string
    WorkflowChartEventMap:
      additionalProperties:
        $ref: '#/components/schemas/WorkflowChartTransitionList'
      description: >-
        Event name -> transitions. Request states raise success/error, compounds
        raise done, wait states raise the chosen option id, notify states raise
        success/error, match states raise success (response.data is the answer:
        match is exact, strong, candidates or none; record; candidates;
        candidates_total; candidates_total_complete; index) or error (its fields
        refused once rendered: invalid_match; or QuickBooks failing the fallback
        queries on a connection without a name index).
      propertyNames:
        allOf:
          - $ref: '#/components/schemas/WorkflowChartIdentifier'
          - not:
              const: always
      type: object
    WorkflowChartStatesMap:
      additionalProperties:
        $ref: '#/components/schemas/WorkflowChartState'
      minProperties: 1
      propertyNames:
        allOf:
          - $ref: '#/components/schemas/WorkflowChartIdentifier'
          - not:
              $ref: '#/components/schemas/WorkflowChartReservedStateKeys'
      type: object
    WorkflowChartInputSchema:
      additionalProperties: false
      description: >-
        A JSON Schema subset describing one value of this input: type,
        properties, required, additionalProperties, items, enum, description,
        body_of.
      properties:
        additionalProperties:
          anyOf:
            - type: boolean
            - $ref: '#/components/schemas/WorkflowChartInputSchema'
          description: >-
            false refuses fields that properties doesn't name; true (the
            default) allows them; a schema allows them when they match it.
        body_of:
          description: >-
            On an object: it is the body of the QuickBooks operation a sibling
            field names, validated against that operation's params when the run
            starts. {"operation": "\<sibling>"} when the sibling holds an
            operation id (invoice.create); {"kind": "\<sibling>", "action":
            "create"} when it holds a kind (customer), for the operation
            \<kind>.\<action>.
          oneOf:
            - additionalProperties: false
              properties:
                operation:
                  type: string
              required:
                - operation
              type: object
            - additionalProperties: false
              properties:
                action:
                  enum:
                    - create
                    - update
                    - query
                kind:
                  type: string
              required:
                - kind
                - action
              type: object
        description:
          description: What it is, shown in the usage contract's fields table.
          type: string
        enum:
          description: The values allowed.
          minItems: 1
          type: array
        items:
          $ref: '#/components/schemas/WorkflowChartInputSchema'
          description: Every element of an array.
        properties:
          additionalProperties:
            $ref: '#/components/schemas/WorkflowChartInputSchema'
          description: An object's fields, each a schema.
          type: object
        required:
          description: The fields an object must have.
          items:
            type: string
          type: array
        type:
          anyOf:
            - enum:
                - string
                - number
                - integer
                - boolean
                - object
                - array
                - 'null'
            - items:
                enum:
                  - string
                  - number
                  - integer
                  - boolean
                  - object
                  - array
                  - 'null'
              minItems: 1
              type: array
          description: >-
            string, number, integer, boolean, object, array or null, or a list
            of them (["string", "null"]). At the top it defaults to the input's
            own type.
      type: object
    WorkflowChartTransitionList:
      items:
        $ref: '#/components/schemas/WorkflowChartTransition'
      minItems: 1
      type: array
    WorkflowChartState:
      allOf:
        - if:
            properties:
              type:
                const: request
            required:
              - type
          then:
            oneOf:
              - required:
                  - operation
              - required:
                  - requests
            properties:
              on_conflict:
                default: ask
                description: >-
                  For an update: what happens when QuickBooks says the record
                  changed after it was read (a stale edit sequence, 3200). ask
                  (the default) pauses the run with a conflict prompt carrying
                  the diff, which the app answers with overwrite (optionally
                  with different params) or keep; overwrite re-sends with the
                  current edit sequence without asking; fail raises error 3200
                  with the diff under response.error.conflict for the chart to
                  handle. An update may leave edit_sequence out: the engine
                  reads the record first and fills it in, and that read is the
                  baseline the diff is judged against.
                enum:
                  - ask
                  - overwrite
                  - fail
              operation:
                description: >-
                  A Semantic.Registry id, e.g. customer.query -- or a template
                  that renders to one, such as \${input.find.operation}, checked
                  when the state is entered.
                type: string
              page_size:
                default: 100
                description: Records per page, with `paginate`.
                maximum: 200
                minimum: 1
                type: integer
              paginate:
                description: >-
                  Page through a query's results: the state raises `page` once
                  per page (response.data that page's records, response.page its
                  number from 1, response.more whether more follow), then
                  `success` once every page is in (response.data the page set,
                  response.count and response.pages its size). Only on a single
                  `operation` that is a query (a create, update, delete or other
                  operation has no results to page through, and one named by
                  reference that renders to such fails the run before it is
                  sent); `params` may not also set `iterator` or `max_returned`.
                  A query QuickBooks does not iterate (the short lists such as
                  account.query, the deleted-records queries, the company,
                  preferences and host queries, the reports) is sent as it is
                  and answers whole, which arrives as page 1 with `more` false,
                  so a chart written for pages works over any query. Each
                  handled page costs about two of a run's 500 transitions (fault
                  transition_limit past them), so one run pages about 250 times:
                  raise page_size, or split the job over runs.
                type: boolean
              params:
                $ref: '#/components/schemas/WorkflowChartTemplate'
              qbxml_version:
                default: '16.0'
                type: string
              requests:
                items:
                  properties:
                    operation:
                      type: string
                    params:
                      $ref: '#/components/schemas/WorkflowChartTemplate'
                  required:
                    - operation
                  type: object
                minItems: 1
                type: array
              settle:
                default: true
                description: >-
                  Whether a request QuickBooks never answered is settled before
                  the state raises anything: the engine finds out whether it was
                  applied (a list add by its full name, a transaction add by the
                  external_guid it stamps on it, an update by reading the record
                  back, a delete by its id) and raises success as if the answer
                  had arrived, re-sends, or raises error with type unsettled and
                  the candidates when only the app can tell. false raises error
                  with type no_response at once, as a query does when re-sending
                  fails. Either way a no_response carries response.error.reason,
                  why it went unanswered (timed_out or connector_error: it was
                  sent, so QuickBooks may have applied it; rejected: QuickBooks
                  could not read it; withdrawn: the app withdrew it before it
                  was sent; page_expired: a later page never fetched; too_large:
                  QuickBooks ran it, but its answer was over QuBe Sync's size
                  limit, so a query is not re-sent and a write is settled as a
                  timed_out one is), and, for an add,
                  response.error.external_guid, the GUID it was sent with, so a
                  chart that does its own looking can recognise the record. An
                  add is stamped with a GUID whether settling is on or off.
                type: boolean
        - if:
            properties:
              type:
                const: wait
            required:
              - type
          then:
            properties:
              prompt:
                $ref: '#/components/schemas/WorkflowChartPrompt'
            required:
              - prompt
        - if:
            properties:
              type:
                const: workflow
            required:
              - type
          then:
            not:
              anyOf:
                - required:
                    - always
                - required:
                    - params
                - required:
                    - operation
                - required:
                    - prompt
            properties:
              as:
                $ref: '#/components/schemas/WorkflowChartIdentifier'
                default: item
                description: >-
                  The name the current element is bound to under each: each.line
                  when as is line.
                not:
                  enum:
                    - index
                    - count
              each:
                description: >-
                  Run the child once per element of this list, one at a time and
                  in order: a template that renders to a list, such as
                  \${input.lines}. The state then raises success with
                  response.items, one entry per element in order: {index, name,
                  outcome, and the element's output keys (record, ...) or
                  error}, and response.counts: {total, failed, and one count per
                  outcome}. response.data (the outputs alone), response.outcomes
                  and response.errors are the same in parallel lists. An empty
                  list raises success at once with response.items []. At most
                  200 elements.
                type:
                  - string
                  - array
              input:
                $ref: '#/components/schemas/WorkflowChartTemplate'
                description: >-
                  Rendered against this run's context and passed to the child as
                  its input. With `each`, rendered once per element, with
                  each.\<as>, each.index and each.count bound.
              item_name:
                description: >-
                  What names each element in response.items, rendered with each
                  as the input is: \${each.record.add.name}. Without it, an
                  element is named by its output's record (full_name, else
                  name), and not at all when it has none.
                type: string
              on_item_error:
                default: stop
                description: >-
                  stop: the first child that fails raises error, with the
                  elements so far in response.items. continue: a failed element
                  is an entry of response.items with its error (and null in
                  response.data), and the state still raises success;
                  response.counts.failed says how many failed.
                enum:
                  - stop
                  - continue
              stop_on:
                description: >-
                  Endings of the called workflow, such as ["cancelled"], that
                  end the loop: the first element whose run ends in one of them
                  is the last, and the elements after it never start -- no
                  requests, no questions. The state then raises success with the
                  outputs up to and including that element in response.data,
                  their endings in response.outcomes, and response.stopped:
                  {index, outcome}, which element ended the loop and how (absent
                  when every element ran). Not a failure, which on_item_error
                  decides; each name must be an outcome the called workflow
                  declares, or completed.
                items:
                  $ref: '#/components/schemas/WorkflowChartIdentifier'
                minItems: 1
                type: array
                uniqueItems: true
              workflow:
                description: >-
                  The key of another workflow of the same app to run as this
                  step.
                pattern: ^[a-z][a-z0-9_]{0,63}$
                type: string
            required:
              - workflow
        - if:
            properties:
              type:
                const: transform
            required:
              - type
          then:
            properties:
              always:
                $ref: '#/components/schemas/WorkflowChartTransitionList'
              assign:
                $ref: '#/components/schemas/WorkflowChartAssignMap'
                minProperties: 1
            required:
              - assign
              - always
        - if:
            properties:
              type:
                const: choice
            required:
              - type
          then:
            not:
              anyOf:
                - required:
                    - assign
                - required:
                    - entry
                - required:
                    - exit
            properties:
              always:
                $ref: '#/components/schemas/WorkflowChartTransitionList'
            required:
              - always
        - if:
            properties:
              type:
                const: compound
            required:
              - type
          then:
            properties:
              initial:
                $ref: '#/components/schemas/WorkflowChartIdentifier'
              states:
                $ref: '#/components/schemas/WorkflowChartStatesMap'
            required:
              - initial
              - states
        - if:
            properties:
              type:
                const: final
            required:
              - type
          then:
            not:
              anyOf:
                - required:
                    - 'on'
                - required:
                    - always
        - if:
            properties:
              type:
                const: notify
            required:
              - type
          then:
            not:
              anyOf:
                - required:
                    - url
                - required:
                    - webhook_url
                - required:
                    - operation
                - required:
                    - params
                - required:
                    - prompt
                - required:
                    - workflow
                - required:
                    - input
                - required:
                    - each
                - required:
                    - always
            properties:
              data:
                $ref: '#/components/schemas/WorkflowChartTemplate'
                description: >-
                  Any JSON, rendered as the state is entered and sent to the app
                  as a workflow_run.notification webhook, to the webhook_url the
                  run was started with (a run of a workflow that can send one is
                  refused without it: 422 webhook_url_required). `response` here
                  is the response of the event that entered the state -- on a
                  paginated query's `page`, that page -- so `${response.data}`
                  sends the page's records; a page set (a paginating query's
                  `success`) cannot be sent. At most 4 MB once encoded. The run
                  waits for the app's 2xx: then the state raises success with
                  response.delivery_id (the same on every retry), response.seq
                  (1, 2, ... in send order for the run) and response.attempts.
                  Delivery is retried for about an hour (10 attempts); if none
                  succeeds, or the data is over 4 MB, it raises error with
                  response.error.type not_delivered or too_large.
              name:
                $ref: '#/components/schemas/WorkflowChartIdentifier'
                description: >-
                  What the app routes on, such as customers_page: the webhook's
                  `name`.
            required:
              - name
              - data
        - if:
            properties:
              type:
                const: match
            required:
              - type
          then:
            not:
              anyOf:
                - required:
                    - operation
                - required:
                    - requests
                - required:
                    - params
                - required:
                    - prompt
                - required:
                    - workflow
                - required:
                    - input
                - required:
                    - data
                - required:
                    - url
                - required:
                    - webhook_url
                - required:
                    - always
                - required:
                    - paginate
                - required:
                    - page_size
                - required:
                    - settle
                - required:
                    - on_conflict
                - required:
                    - qbxml_version
                - required:
                    - each
            properties:
              exact_only:
                $ref: '#/components/schemas/WorkflowChartTemplate'
                description: >-
                  Optional, true or false (or a template): with true the answer
                  is exact or none.
              fields:
                $ref: '#/components/schemas/WorkflowChartTemplate'
                description: >-
                  Optional, for customer, vendor, employee, other_name and
                  entity: an object of company_name, email, phone,
                  account_number, city and postal_code (each a template; an
                  employee has no company_name) to match on as well as the name.
                  One that renders to nothing is left out.
              kind:
                $ref: '#/components/schemas/WorkflowChartTemplate'
                description: >-
                  The list to look in: customer, vendor, employee, other_name,
                  entity (those four together, one name space), item (every item
                  type), account, class, or another reference list a transaction
                  names (standard_terms, date_driven_terms, sales_tax_code,
                  payment_method, ship_method, price_level, customer_type,
                  vendor_type, job_type, sales_rep, customer_msg); or a template
                  that renders to one, such as \${input.kind}.
              min_score:
                $ref: '#/components/schemas/WorkflowChartTemplate'
                description: >-
                  Optional: a number from 0.3 to 1.0 (or a template), this
                  match's candidate threshold in place of 0.44. Not with
                  exact_only.
              name:
                $ref: '#/components/schemas/WorkflowChartTemplate'
                description: >-
                  The record's own name, without its parent's: a template such
                  as \${input.name}. At most 255 characters once rendered.
              parent:
                $ref: '#/components/schemas/WorkflowChartTemplate'
                description: >-
                  Optional: the parent's full name or ListID, for a job (kind
                  customer) or a sub-item (kind item), or another kind whose
                  records have parents. With one, name has no colon. A template
                  that renders to nothing, or a blank one, is left out.
              refresh:
                $ref: '#/components/schemas/WorkflowChartTemplate'
                description: >-
                  Optional, default true: refresh the connection's name index
                  from QuickBooks first, the run waiting until it is in --
                  unless the last refresh finished less than a minute ago, when
                  it matches at once, so the matches of one burst share a
                  refresh (one already on its way is waited on). false matches
                  the index as it stands (response.data.index.as_of says how
                  current).
            required:
              - kind
              - name
      properties:
        description:
          type: string
        entry:
          $ref: '#/components/schemas/WorkflowChartAssignMap'
        exit:
          $ref: '#/components/schemas/WorkflowChartAssignMap'
        'on':
          $ref: '#/components/schemas/WorkflowChartEventMap'
        type:
          enum:
            - request
            - wait
            - workflow
            - transform
            - choice
            - compound
            - final
            - notify
            - match
        ui:
          description: >-
            Canvas bookkeeping, ignored by the engine. `x`/`y` place the state;
            `transitions` places the pill drawn for each of its transitions,
            keyed `"<event>|<index>"` -- the event and the transition's position
            within it, which is what identifies a transition. Free-form:
            anything here is presentation, and a chart with no `ui` at all lays
            itself out.
          properties:
            transitions:
              additionalProperties:
                properties:
                  x:
                    type: number
                  'y':
                    type: number
                type: object
              description: Pill positions, keyed "\<event>|\<index>".
              type: object
            x:
              type: number
            'y':
              type: number
          type: object
      required:
        - type
      type: object
    WorkflowChartTransition:
      additionalProperties: false
      properties:
        assign:
          $ref: '#/components/schemas/WorkflowChartAssignMap'
        description:
          type: string
        if:
          $ref: '#/components/schemas/WorkflowChartCondition'
        target:
          description: >-
            completed, failed, a sibling key (searched upward), or an absolute
            dotted path.
          type: string
      required:
        - target
      type: object
    WorkflowChartAssignMap:
      additionalProperties:
        $ref: '#/components/schemas/WorkflowChartTemplate'
      description: >-
        Variable name -> template. Every value is rendered against the same
        context snapshot, then merged into vars at once.
      propertyNames:
        $ref: '#/components/schemas/WorkflowChartIdentifier'
      type: object
    WorkflowChartCondition:
      oneOf:
        - additionalProperties: false
          properties:
            op:
              enum:
                - present
                - absent
                - eq
                - neq
                - gt
                - gte
                - lt
                - lte
                - contains
                - starts_with
                - in
            path:
              minLength: 1
              type: string
            value: {}
          required:
            - path
            - op
        - additionalProperties: false
          properties:
            all:
              items:
                $ref: '#/components/schemas/WorkflowChartCondition'
              minItems: 1
              type: array
          required:
            - all
        - additionalProperties: false
          properties:
            any:
              items:
                $ref: '#/components/schemas/WorkflowChartCondition'
              minItems: 1
              type: array
          required:
            - any
        - additionalProperties: false
          properties:
            not:
              $ref: '#/components/schemas/WorkflowChartCondition'
          required:
            - not
      type: object
    WorkflowChartTemplate:
      description: >-
        Any JSON value. Strings may hold \${...} references; a map may hold the
        reserved "\$from" key, whose rendered map the rest of the map is
        deep-merged onto. A map holding "\$map" is a list built from another:
        {"\$map": "\${vars.items}", "as": "item", "template": ...} renders
        template once per element, with the element at each.\<as>, its position
        at each.index and the length at each.count. With "key" (a template per
        element), it is an object instead: each element's template under the key
        or keys it renders.


        {"\$add": [...]} sums its operands and {"\$default": [...]} is the first
        that renders to something. {"\$merge": [a, b, ...]} deep-merges each
        object onto the ones before it, as "\$from" does (objects merge key by
        key; lists and scalars replace; an operand that renders to nothing is
        skipped). {"\$find": "\${vars.items}", "where": condition} is the first
        element the condition holds for (at each.\<as>), or nothing.


        {"\$refs": "\${input.params}", "operation": "invoice.create"} lists an
        add's references, or with "list_ids" puts their ListIDs back. {"\$read":
        id, "operation": an add} reads that record whole. {"\$kind_name":
        "\${input.kind}"} is a kind, or an operation's, as a person reads it
        (Customer, Service item, Invoice for invoice.create), for a question's
        details. No other \$-prefixed key is allowed.
      if:
        type: object
      then:
        properties:
          $add:
            description: >-
              The sum of its operands: numbers, or templates that render to
              numbers; nothing counts as 0.
            minItems: 1
            type: array
          $default:
            description: >-
              The first of its candidates that renders to something other than
              nothing or an empty string.
            minItems: 1
            type: array
          $find:
            description: >-
              A template that renders to a list. With "where" (a condition,
              required) and "as" (default item): the first element for which the
              condition holds, the element at each.\<as>, each.index and
              each.count; nothing when none does. Only \$find, as and where.
            type: string
          $from:
            type: string
          $kind_name:
            description: >-
              A kind or an operation id, or a template for one (customer,
              item_service, invoice.create, \${input.kind}): its name as a
              person reads it -- Customer, Service item, Sales tax code, Invoice
              -- or nothing for anything but a non-empty string. For a
              question's details. Only \$kind_name.
            type: string
          $map:
            description: >-
              A template that renders to a list. With "template" (required) and
              "as" (default item): the list of the template rendered once per
              element, the element at each.\<as>, each.index and each.count.
              With "key" too (a template rendered per element, such as
              \${each.ref.paths}, to a string or a list of strings): an object,
              each element's rendered template under its key or keys. Only
              \$map, as, template and key.
            type: string
          $merge:
            description: >-
              Objects, or templates that render to objects, each deep-merged
              onto the ones before it: objects merge key by key, lists and
              scalars replace. An operand that renders to nothing is skipped.
              Alone in its object.
            minItems: 1
            type: array
          $read:
            description: >-
              A record's id, or a template for it. With "operation" (an add's
              operation id, or a template; required): {"operation", "params"},
              the query that reads the record that add makes, whole, by that id
              -- for a transaction add its type's query by txn_id with the flag
              that asks for its lines (include_line_items, or a build assembly's
              include_component_line_items), for a list add its type's query by
              list_id. A request state sends it with "operation":
              "\${vars.read.operation}" and "params": {"\$from":
              "\${vars.read.params}"}. Only \$read and operation.
            type: string
          $refs:
            description: >-
              An add's params (an object, or a template for one). With
              "operation" (the add's operation id, or a template; required): the
              distinct references the params make, in the order they first
              appear -- every *_ref field the operation has, its kind derived
              from the field's name (customer_ref is customer, ar_account_ref
              account, item_group_ref item_group), one entry per kind and full
              name with every path it appears at: {kind, field, full_name, name,
              parent, list_id, paths}. A kind with no full-name lookup
              (template) is left out.


              With "adds" (a list of {kind, add, fields, accept}, as ensure
              takes them) and "rules" (an object of kind to ensure, create or
              must_exist; ensure by default), each also has "rule", "ensure":
              {kind, add}, the add from adds that makes it, one of its name
              alone under create, or none, "pick", true when there is no add,
              and "fields" and "accept" from its entry in adds, for resolve.


              With "found" (the response of a for-each over the references: its
              data and outcomes, one per reference in order), each also has
              "outcome", "how" and "record" from its element (null for one the
              loop never reached); with "made" too (the response of a for-each
              over the ones found answered not_found), those take its outcome
              and record. "missing": true keeps the references whose outcome is
              still not_found.


              With "list_ids" instead (one per reference, in that order), it is
              the params, every reference replaced by {"list_id": ...}. Only
              \$refs, operation, adds, rules, found, made, missing and list_ids.
            type:
              - string
              - object
        propertyNames:
          not:
            pattern: ^\$(?!(from|map|add|default|merge|find|refs|read|kind_name)$)
  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.