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

# Update approval workflow

> Update an existing approval workflow.



## OpenAPI

````yaml put /v1/approvals/workflows/{id}
openapi: 3.1.0
info:
  title: Hyperline API
  version: 0.0.0
servers:
  - url: https://api.hyperline.co
  - url: https://sandbox.api.hyperline.co
security: []
paths:
  /v1/approvals/workflows/{id}:
    put:
      tags:
        - Approval > Workflows
      summary: Update approval workflow
      description: Update an existing approval workflow.
      operationId: updateApprovalWorkflow
      parameters:
        - schema:
            type: string
          required: true
          name: id
          in: path
      requestBody:
        description: Approval workflow update payload.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateApprovalWorkflow'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalWorkflow'
        '404':
          description: Approval workflow not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
      security:
        - bearer: []
components:
  schemas:
    UpdateApprovalWorkflow:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          description: Approval workflow name.
          example: Enterprise quote approval
        description:
          type:
            - string
            - 'null'
          description: Approval workflow description.
          example: Requires approval for high-value subscription quotes.
        applicable_flows:
          type: array
          items:
            type: string
            enum:
              - quote_subscription
              - quote_subscription_update
              - quote_one_off
              - invoice
              - credit_note
          minItems: 1
          description: >-
            Quote, subscription, invoice, or credit-note flows where the
            workflow applies. `workflow_step` workflows are picked by a
            workflow's Request approval step, apply to no other flow, have no
            rules, and can't be created or updated through the API.
          example:
            - quote_subscription
        is_active:
          type: boolean
          description: Whether the workflow is active.
          example: true
        priority:
          type: integer
          description: >-
            Workflow priority. Lower values are evaluated first when multiple
            workflows match.
          example: 10
        step_execution:
          type: string
          enum:
            - sequential
            - parallel
          description: >-
            How workflow steps execute. Sequential steps run by order; parallel
            steps run together.
          example: sequential
        email_notification_enabled:
          type: boolean
          description: Whether approvers receive email notifications for this workflow.
          example: true
        rules:
          type: array
          items:
            type: object
            properties:
              operator:
                type: string
                enum:
                  - and
                  - or
                description: Logical operator used to combine the rule conditions.
                example: and
              conditions:
                type: array
                items:
                  $ref: '#/components/schemas/ApprovalCondition'
                minItems: 1
                description: Conditions that must match for the rule to apply.
            required:
              - operator
              - conditions
          minItems: 1
          description: >-
            Rules that determine when the workflow applies. Empty for
            `workflow_step` workflows.
        steps:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Approval workflow step ID.
                example: aps_DKL4Xcb5VSa8CQ
              name:
                type: string
                minLength: 1
                description: Approval workflow step name.
                example: Finance approval
              order:
                type: integer
                exclusiveMinimum: 0
                description: Step order. Orders must be sequential starting from 1.
                example: 1
              approver_requirement:
                type: string
                enum:
                  - any
                  - all
                description: Whether any approver or all approvers must approve the step.
                example: any
              approver_role_ids:
                type: array
                items:
                  type: string
                default: []
                description: User role IDs that can approve the step.
                example:
                  - rol_DKL4Xcb5VSa8CQ
              approver_user_ids:
                type: array
                items:
                  type: string
                default: []
                description: User IDs that can approve the step.
                example:
                  - usr_DKL4Xcb5VSa8CQ
              approver_sources:
                type: array
                items:
                  type: string
                  enum:
                    - manager_of_owner
                default: []
                description: >-
                  Dynamic approver sources resolved per request.
                  `manager_of_owner` resolves to the manager of the user who
                  owns the entity under approval — for a quote, its owner,
                  meaning the user who created it or whoever it was later
                  reassigned to — falling back to the user who requested the
                  approval. The manager is the one set on their membership, and
                  the source resolves to nobody when that user has no active
                  manager in the account.
                example:
                  - manager_of_owner
            required:
              - name
              - order
              - approver_requirement
          minItems: 1
          description: Approval steps required by the workflow.
    ApprovalWorkflow:
      type: object
      properties:
        id:
          type: string
          description: Approval workflow ID.
          example: apw_DKL4Xcb5VSa8CQ
        name:
          type: string
          description: Approval workflow name.
          example: Enterprise quote approval
        description:
          type:
            - string
            - 'null'
          description: Approval workflow description.
          example: Requires approval for high-value subscription quotes.
        applicable_flows:
          type: array
          items:
            type: string
            enum:
              - quote_subscription
              - quote_subscription_update
              - quote_one_off
              - subscription_update
              - invoice
              - credit_note
              - workflow_step
          description: >-
            Quote, subscription, invoice, or credit-note flows where the
            workflow applies. `workflow_step` workflows are picked by a
            workflow's Request approval step, apply to no other flow, have no
            rules, and can't be created or updated through the API.
          example:
            - quote_subscription
        is_active:
          type: boolean
          description: Whether the workflow is active.
          example: true
        priority:
          type: integer
          description: >-
            Workflow priority. Lower values are evaluated first when multiple
            workflows match.
          example: 10
        rules:
          type: array
          items:
            $ref: '#/components/schemas/ApprovalWorkflowRule'
          description: >-
            Rules that determine when the workflow applies. Empty for
            `workflow_step` workflows.
        step_execution:
          type: string
          enum:
            - sequential
            - parallel
          description: >-
            How workflow steps execute. Sequential steps run by order; parallel
            steps run together.
          example: sequential
        email_notification_enabled:
          type: boolean
          description: Whether approvers receive email notifications for this workflow.
          example: true
        steps:
          type: array
          items:
            $ref: '#/components/schemas/ApprovalWorkflowStep'
          description: Approval steps required by the workflow.
        version:
          type: integer
          description: Workflow version number.
          example: 1
        original_workflow_id:
          type:
            - string
            - 'null'
          description: Original workflow ID when this workflow is an archived version.
          example: null
        created_at:
          type: string
          format: date-time
          description: >-
            Approval workflow creation date. UTC date time string in the [ISO
            8601](https://en.wikipedia.org/wiki/ISO_8601) format.
          example: '2024-12-20T16:04:11Z'
      required:
        - id
        - name
        - description
        - applicable_flows
        - is_active
        - priority
        - rules
        - step_execution
        - email_notification_enabled
        - steps
        - version
        - original_workflow_id
        - created_at
    ApprovalCondition:
      type: object
      properties:
        field:
          type: string
          description: >-
            Field evaluated by the approval condition. Use `has_attachment` with
            `eq` false for missing attachments, or `payment_method_type` with
            `in` or `not_in` to match payment methods. A `custom_field.<name>`
            condition with `in` or `not_in` and a non-empty list of values
            matches when the property shares any value, or no value, with the
            list.
          example: total_amount
        operator:
          type: string
          enum:
            - eq
            - neq
            - gt
            - gte
            - lt
            - lte
            - in
            - not_in
            - contains
            - not_contains
          description: Comparison operator used by the approval condition.
          example: gte
        value:
          anyOf:
            - type: string
            - type: number
            - type: boolean
            - type: 'null'
            - type: array
              items:
                type: string
            - type: array
              items:
                type: number
            - type: object
              properties:
                period:
                  type: string
                  enum:
                    - weeks
                    - months
                    - years
                  description: Product interval period.
                  example: months
                count:
                  type: integer
                  exclusiveMinimum: 0
                  description: Number of periods in the product interval.
                  example: 12
              required:
                - period
                - count
            - type: object
              properties:
                period:
                  type: string
                  enum:
                    - once
                  description: Product interval period.
                  example: once
                count:
                  type: 'null'
                  description: Number of periods in the product interval.
                  example: null
              required:
                - period
                - count
            - type: 'null'
          description: Expected value for the approval condition.
          example: 100000
        scope:
          $ref: '#/components/schemas/ApprovalConditionScope'
      required:
        - field
        - operator
        - value
    ApprovalWorkflowRule:
      type: object
      properties:
        id:
          type: string
          description: Approval workflow rule ID.
          example: apr_DKL4Xcb5VSa8CQ
        operator:
          type: string
          enum:
            - and
            - or
          description: Logical operator used to combine the rule conditions.
          example: and
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/ApprovalCondition'
          description: Conditions that must match for the rule to apply.
      required:
        - id
        - operator
        - conditions
    ApprovalWorkflowStep:
      type: object
      properties:
        id:
          type: string
          description: Approval workflow step ID.
          example: aps_DKL4Xcb5VSa8CQ
        name:
          type: string
          description: Approval workflow step name.
          example: Finance approval
        order:
          type: integer
          description: Step order. Orders must be sequential starting from 1.
          example: 1
        approver_requirement:
          type: string
          enum:
            - any
            - all
          description: Whether any approver or all approvers must approve the step.
          example: any
        approver_role_ids:
          type: array
          items:
            type: string
          description: User role IDs that can approve the step.
          example:
            - rol_DKL4Xcb5VSa8CQ
        approver_user_ids:
          type: array
          items:
            type: string
          description: User IDs that can approve the step.
          example:
            - usr_DKL4Xcb5VSa8CQ
        approver_sources:
          type: array
          items:
            type: string
            enum:
              - manager_of_owner
          description: >-
            Dynamic approver sources resolved per request. `manager_of_owner`
            resolves to the manager of the user who owns the entity under
            approval — for a quote, its owner, meaning the user who created it
            or whoever it was later reassigned to — falling back to the user who
            requested the approval. The manager is the one set on their
            membership, and the source resolves to nobody when that user has no
            active manager in the account.
          example:
            - manager_of_owner
      required:
        - id
        - name
        - order
        - approver_requirement
        - approver_role_ids
        - approver_user_ids
        - approver_sources
    ApprovalConditionScope:
      type: object
      properties:
        operator:
          type: string
          enum:
            - and
            - or
          description: Whether all or any scope filters must match each product.
        conditions:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                enum:
                  - product_ids
                description: >-
                  Product filter applied to each product before discount
                  aggregation.
              operator:
                type: string
                enum:
                  - in
                  - not_in
                description: Comparison operator used by the approval condition.
              value:
                type: array
                items:
                  type: string
                  minLength: 1
                minItems: 1
                description: >-
                  Product IDs to include or exclude from the discount
                  calculation.
            required:
              - field
              - operator
              - value
            additionalProperties: false
          minItems: 1
          description: >-
            Non-empty product filters. Selected products contribute their
            combined discount amount; percentage uses the greater of their
            effective discount rate and highest applicable configured
            percentage.
      required:
        - operator
        - conditions
      additionalProperties: false
      description: >-
        Optional product scope for total_discount_amount and discount_percent.
        Filters products before combining their discounts; omitted scope
        evaluates the whole document. No matching products means the condition
        does not match.
      example:
        operator: and
        conditions:
          - field: product_ids
            operator: in
            value:
              - itm_DKL4Xcb5VSa8CQ
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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