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

# Create an approval policy

> Create an approval policy that will apply approval steps to payables in your app. It will only apply to policies that match the `approval_conditions` and are in state `submitted_for_approval`. Policies that already have approval steps will not be overwritten.



## OpenAPI

````yaml /v2.yaml post /v2/accounts-payable/approval-policies
openapi: 3.1.0
info:
  title: dots api
  version: '1.0'
  summary: Dots Payout API
  description: Scalable and Flexible Payouts Infrastructure
  contact:
    name: Kartikye Mittal
    url: https://dots.dev
    email: info@dots.dev
  license:
    name: MIT
    url: https://opensource.org/license/mit/
servers:
  - url: https://api.dots.dev/api
    description: Production
security:
  - api_key: []
tags:
  - name: accounts-payable
    description: Accounts Payable Routes
  - name: apps
    description: App Routes
  - name: flows
    description: Flow routes
  - name: organizations
    description: Organization Routes
  - name: payment-customers
    description: Payment Customer Routes
  - name: payments
    description: Payment Routes
  - name: payout-batches
    description: Payout Batch Routes
  - name: payout-links
    description: Payout Link Routes
  - name: payout-requests
    description: Payout Request Routes
  - name: payouts
    description: Payout Routes
  - name: transactions
    description: Transaction Routes
  - name: transfer-batches
    description: Transfer Batch routes
  - name: transfers
    description: Transfer routes
  - name: users
    description: User routes
paths:
  /v2/accounts-payable/approval-policies:
    post:
      tags:
        - accounts-payable
      summary: Create an approval policy
      description: >-
        Create an approval policy that will apply approval steps to payables in
        your app. It will only apply to policies that match the
        `approval_conditions` and are in state `submitted_for_approval`.
        Policies that already have approval steps will not be overwritten.
      operationId: create-approval-policy
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                description:
                  type: string
                payable_conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                          - amount
                          - vendor_id
                    oneOf:
                      - if:
                          properties:
                            type:
                              const: amount
                        then:
                          properties:
                            value:
                              type: number
                              description: Value for amount condition
                            comparator:
                              type: string
                              enum:
                                - <=
                                - '=='
                                - '>='
                          required:
                            - value
                            - comparator
                      - if:
                          properties:
                            type:
                              const: vendor_id
                        then:
                          properties:
                            value:
                              type: string
                              description: Value for vendor_id condition
                          required:
                            - value
                    required:
                      - type
                      - value
                  minItems: 1
                  uniqueItems: true
                approval_conditions:
                  type: array
                  items:
                    type: object
                    properties:
                      approver_list:
                        type: array
                        items:
                          type: number
                        minItems: 1
                        uniqueItems: true
                      num_approvals_required:
                        type: number
                        minimum: 1
                    required:
                      - approver_list
                      - num_approvals_required
                  minItems: 1
                  uniqueItems: true
              required:
                - payable_conditions
                - approval_conditions
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/approval-policy'
components:
  schemas:
    approval-policy:
      type: object
      properties:
        active:
          type: boolean
        api_app_id:
          type: string
          format: uuid
        approval_conditions:
          type: array
          items:
            type: object
            properties:
              approver_list:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
              num_approvals_required:
                type: integer
        payable_conditions:
          type: array
          items:
            type: object
            properties:
              comparator:
                type: string
              type:
                type:
                  enum:
                    - amount
                    - vendor_id
              value:
                type: number
        created:
          type: string
          format: date-time
        description:
          type: string
          nullable: true
        id:
          type: string
          format: uuid
        priority:
          type: integer
  securitySchemes:
    api_key:
      type: http
      scheme: basic

````