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

# /realms/{realmId}/organizations/{organizationId}/business-policies



## OpenAPI

````yaml /api-reference/ruleengine.openapi.json get /realms/{realmId}/organizations/{organizationId}/business-policies
openapi: 3.0.3
info:
  title: Ruleengine
  version: 1.0.0
  description: >-
    Portão 3 ruleengine API. Generated by tools/openapi from code (routes +
    security) and the hand-written spec (request/response bodies). Confidence
    tiers: generated:typed=15 copied:manual=0 unknown=1.
servers:
  - url: https://api.ruleengine.v2.portao3.com.br/
    description: production
  - url: https://api.ruleengine.dev.3pers.com.br/
    description: development
security:
  - bearerAuth: []
tags:
  - name: Business Policies
  - name: Policy Evaluations
  - name: Policy Request
paths:
  /realms/{realmId}/organizations/{organizationId}/business-policies:
    get:
      tags:
        - Business Policies
      summary: /realms/{realmId}/organizations/{organizationId}/business-policies
      operationId: getRealmsByRealmIdOrganizationsByOrganizationIdBusinessPolicies
      parameters:
        - name: realmId
          in: path
          required: true
          schema:
            type: string
        - name: organizationId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  next:
                    type: string
                    nullable: true
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        realmId:
                          type: string
                        organizationId:
                          type: string
                        context:
                          type: string
                          enum:
                            - PAYMENT
                            - SPEND_REVIEW
                            - TRAVEL
                          description: The business surface a policy governs.
                        name:
                          type: string
                        description:
                          type: string
                        order:
                          type: number
                          description: Evaluation sorts ascending; first match wins.
                        status:
                          type: string
                          enum:
                            - ACTIVE
                            - DISABLED
                        actions:
                          type: object
                          properties:
                            hierarchy:
                              type: boolean
                              description: >-
                                true = approvals resolve one-by-one in array
                                order.
                            autoAction:
                              type: string
                              enum:
                                - APPROVE
                                - DENY
                                - NONE
                              description: >-
                                What happens when a policy matches:

                                - `APPROVE` — allowed outright, no
                                policy-request

                                - `DENY` — refused outright

                                - `NONE` — an approval flow is required
                                (`approvals` must be non-empty)
                            approvalDeadlineHours:
                              type: number
                              description: >-
                                Feeds the policy-request `approvalDeadline`
                                (default 72).
                            moveBalance:
                              type: object
                              properties:
                                addBalance:
                                  type: boolean
                                fromAccountId:
                                  type: string
                                  description: Required when `addBalance` is true.
                                fromWalletId:
                                  type: string
                                  description: Required when `addBalance` is true.
                              required:
                                - addBalance
                            approvals:
                              type: array
                              items:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - USER
                                      - GROUP
                                  id:
                                    type: string
                                    description: >-
                                      userId when type=USER, identity groupId
                                      when type=GROUP.
                                  name:
                                    type: string
                                    description: >-
                                      Display name / group name, snapshotted for
                                      the UI.
                                required:
                                  - type
                                  - id
                                  - name
                              description: >-
                                Non-empty when autoAction=NONE; empty/absent
                                otherwise.
                          required:
                            - hierarchy
                            - autoAction
                        conditions:
                          type: object
                          properties:
                            logic:
                              type: string
                              enum:
                                - AND
                                - OR
                            groups:
                              type: array
                              items:
                                type: object
                                properties:
                                  logic:
                                    type: string
                                    enum:
                                      - AND
                                      - OR
                                  dependsOn:
                                    type: array
                                    items:
                                      type: string
                                  items:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        operator:
                                          type: string
                                          description: >-
                                            Same ConditionOperator union the
                                            security rules use (incl. LLM_EVALUATE).
                                        field:
                                          type: string
                                        maskType:
                                          type: string
                                        dynamicFieldValue:
                                          type: string
                                        value: {}
                                      required:
                                        - operator
                                        - field
                                required:
                                  - logic
                                  - items
                              description: >-
                                An EMPTY array matches unconditionally — the
                                catch-all/default policy.
                          required:
                            - logic
                            - groups
                        createdAt:
                          anyOf:
                            - type: string
                            - type: string
                              format: date-time
                        updatedAt:
                          anyOf:
                            - type: string
                            - type: string
                              format: date-time
                      required:
                        - id
                        - realmId
                        - organizationId
                        - context
                        - name
                        - order
                        - status
                        - actions
                        - conditions
                required:
                  - next
                  - items
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````