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

# Update approval policy

> Replace an approval policy's configuration. In-flight bills are unaffected — they carry a snapshot of the decision made at submit time.



## OpenAPI

````yaml put /ap/approval-policies/{id}
openapi: 3.1.1
info:
  title: Dolfin API
  description: >-
    Dolfin API for AR & AP. Authenticate using the `x-dolfin-api-key` header
    with the API key distributed to your organisation.
  version: v1
servers:
  - url: https://api.dolfinai.co
    description: Production
security:
  - {}
tags:
  - name: Webhooks
  - name: Users
  - name: TaxRates
  - name: Suppliers
  - name: Supplier Credit Notes
  - name: Bills
  - name: SpendCategories
  - name: Payables
  - name: RecurringInvoices
  - name: Receivables
  - name: Purchase Orders
  - name: Products
  - name: Payments
  - name: Invoices
  - name: Organisations
  - name: Members
  - name: MCP
  - name: Matching
  - name: Invoice Reminders
  - name: Industries
  - name: Gmail
  - name: Delivery Notes
  - name: Customers
  - name: Currencies
  - name: Credit Notes
  - name: Clients
  - name: ClientInvites
  - name: BankPayments
  - name: Bank details
  - name: Auth
  - name: ApprovalPolicies
  - name: ApiKeys
  - name: Agent
paths:
  /ap/approval-policies/{id}:
    put:
      tags:
        - ApprovalPolicies
      summary: Update approval policy
      description: >-
        Replace an approval policy's configuration. In-flight bills are
        unaffected — they carry a snapshot of the decision made at submit time.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertApprovalPolicyRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalPolicyResponse'
        '400':
          description: >-
            ApprovalPolicy.NameRequired — a policy name is required


            ApprovalPolicy.InvalidPriorityOrder — priority order must be between
            0 and 1000


            ApprovalPolicy.InvalidAmountRange — the lower amount bound must not
            exceed the upper bound


            ApprovalPolicy.CurrencyRequired — a currency is required when an
            amount condition is set


            Currency.NotFoundByCode — the specified currency is not supported


            ApprovalPolicy.TooManyApprovers — more than the maximum number of
            approvers were supplied


            ApprovalPolicy.ApproverNotInOrganisation — a supplied approver is
            not a member of this organisation


            ApprovalPolicy.SupplierNotInOrganisation — a supplied supplier does
            not belong to this organisation
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: >-
            Organisation.InsufficientRole — caller's organisation role is below
            the level this action requires
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: >-
            ApprovalPolicy.NotFound — approval policy does not exist or belongs
            to a different organisation
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    UpsertApprovalPolicyRequest:
      type: object
      properties:
        name:
          type: string
        priorityOrder:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          format: int32
        active:
          type: boolean
        amountGte:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          format: double
        amountLte:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          format: double
        currency:
          type:
            - 'null'
            - string
        supplierIds:
          type: array
          items:
            type: string
            format: uuid
        supplierStanding:
          $ref: '#/components/schemas/SupplierStanding'
        action:
          $ref: '#/components/schemas/ApprovalPolicyAction'
        approverUserIds:
          type: array
          items:
            type: string
            format: uuid
        hasAmountCondition:
          type: boolean
    ApprovalPolicyResponse:
      required:
        - id
        - name
        - priorityOrder
        - active
        - supplierIds
        - supplierStanding
        - action
        - approverUserIds
        - createdAt
        - updatedAt
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        priorityOrder:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          description: 0–1000, lower wins. Also the UI sort order.
          format: int32
        active:
          type: boolean
        amountGte:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          format: double
        amountLte:
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          type:
            - 'null'
            - number
            - string
          format: double
        currency:
          type:
            - 'null'
            - string
          description: >-
            ISO 4217. Set when an amount condition is present; scopes the policy
            to this currency.
        supplierIds:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Empty ⇒ global policy (any supplier). Otherwise the policy is
            supplier-specific.
        supplierStanding:
          $ref: '#/components/schemas/SupplierStanding'
        action:
          $ref: '#/components/schemas/ApprovalPolicyAction'
        approverUserIds:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Approvers for AlwaysReview. Empty ⇒ no designated approver (admins
            action in-app).
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
    SupplierStanding:
      enum:
        - Any
        - New
        - Established
    ApprovalPolicyAction:
      enum:
        - AutoApprove
        - AlwaysReview
        - AutoVoid

````