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

# Get a business policy

> Returns one business policy of the organization, in any status.

An archived policy is returned too, with `status: "ARCHIVED"`. Each approver in `actions.approvals` carries the user's or group's current `name`; it is left out when the approver can no longer be found. To change the policy, send its writable fields (`context`, `name`, `description`, `order`, `status`, `actions`, `conditions`) to the update endpoint, without the approvers' `name`; an archived policy cannot be changed.

Any member of the organization can read its policies.


## OpenAPI

````yaml /api-reference/ruleengine.openapi.json get /realms/{realmId}/organizations/{organizationId}/business-policies/{businessPolicyId}
openapi: 3.0.3
info:
  title: Ruleengine
  version: 1.0.0
  description: >-
    Portão 3 ruleengine API. Every endpoint requires a bearer token in the
    Authorization header (Authorization: Bearer <token>) unless its page states
    otherwise; see the Authentication guide. That requirement is not repeated
    per endpoint. Generated by tools/openapi from code (routes + security) and
    the hand-written spec (request/response bodies). Confidence tiers:
    generated:typed=26 copied:manual=0 unknown=0.
servers:
  - url: https://api.ruleengine.v2.portao3.com.br/
    description: production
  - url: https://api.ruleengine.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Business Policies
  - name: Policy Requests
paths:
  /realms/{realmId}/organizations/{organizationId}/business-policies/{businessPolicyId}:
    get:
      tags:
        - Business Policies
      summary: Get a business policy
      description: Returns one business policy of the organization, in any status.
      operationId: >-
        getRealmsByRealmIdOrganizationsByOrganizationIdBusinessPoliciesByBusinessPolicyId
      parameters:
        - name: realmId
          in: path
          required: true
          description: |-
            ID of your realm.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
        - name: organizationId
          in: path
          required: true
          description: |-
            ID of the organization the policy belongs to.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
        - name: businessPolicyId
          in: path
          required: true
          description: |-
            ID of the business policy.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: 3f1c9a52-7d4e-4b8a-9c21-5e6f0a8b2d47
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: ID of the business policy.
                    example: 3f1c9a52-7d4e-4b8a-9c21-5e6f0a8b2d47
                    format: uuid
                  realmId:
                    type: string
                    description: ID of the realm the policy belongs to.
                    example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
                    format: uuid
                  organizationId:
                    type: string
                    description: ID of the organization the policy belongs to.
                    example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
                    format: uuid
                  context:
                    type: string
                    enum:
                      - PAYMENT
                      - SPEND_REVIEW
                      - TRAVEL
                    description: >-
                      What the policy governs. `PAYMENT`: a Pix payment, a
                      boleto payment or a wallet transfer request, before it is
                      paid. `SPEND_REVIEW`: the review of a transaction that
                      already happened. `TRAVEL`: no travel flow evaluates
                      policies yet.
                    example: PAYMENT
                  name:
                    type: string
                    description: Name of the policy, shown to approvers.
                    example: Payments over R$ 5,000
                  description:
                    type: string
                    description: >-
                      What the policy does, in plain words. Absent when none was
                      written.
                    example: >-
                      Pagamentos acima de R$ 5.000,00 precisam da aprovação do
                      time financeiro.
                  order:
                    type: number
                    description: >-
                      Evaluation order: active policies of the same `context`
                      are tried from the lowest `order` up — the oldest first on
                      a tie — and the first match decides.
                    example: 10
                  status:
                    type: string
                    enum:
                      - ACTIVE
                      - DISABLED
                      - ARCHIVED
                    description: >-
                      `ACTIVE`: evaluated. `DISABLED`: kept, never evaluated.
                      `ARCHIVED`: archived for good — never evaluated, can no
                      longer be changed.
                    example: ACTIVE
                  conditions:
                    type: object
                    properties:
                      logic:
                        type: string
                        enum:
                          - AND
                          - OR
                        description: >-
                          How the results of `groups` combine: `AND` — every
                          group must match; `OR` — one is enough.
                        example: AND
                      groups:
                        type: array
                        items:
                          type: object
                          properties:
                            logic:
                              type: string
                              enum:
                                - AND
                                - OR
                              description: >-
                                How the group's `items` combine: `AND` — every
                                item must match; `OR` — one is enough.
                              example: AND
                            dependsOn:
                              type: array
                              items:
                                type: string
                              description: >-
                                Data loaded before the group is evaluated, for
                                items that read it through `dynamicFieldValue`.
                                Absent on most groups.
                            items:
                              type: array
                              items:
                                type: object
                                properties:
                                  operator:
                                    type: string
                                    description: >-
                                      How `field` is compared with `value` — see
                                      the condition catalog for the operators
                                      each field accepts.
                                    example: GREATER_THAN
                                  field:
                                    type: string
                                    description: >-
                                      Dot path of the value tested, from the
                                      condition catalog of the policy's
                                      `context` (`TRAVEL` has none).
                                    example: amount
                                  maskType:
                                    type: string
                                    description: >-
                                      `CPF_CNPJ` or `PHONE`: both sides of the
                                      comparison are masked before it runs (an
                                      unformatted CPF/CNPJ, or a phone number's
                                      middle digits). Absent when nothing is
                                      masked.
                                  dynamicFieldValue:
                                    type: string
                                    description: >-
                                      Dot path of a value loaded at evaluation
                                      time, compared instead of `value`. Absent
                                      on most conditions.
                                  value:
                                    description: >-
                                      What `field` is compared with, typed as
                                      the catalog says — an amount in centavos,
                                      a `YYYY-MM-DD` date, an array for
                                      `INCLUDES`, criteria text for
                                      `LLM_EVALUATE`. Absent for the operators
                                      that take no value.
                                    example: 500000
                                required:
                                  - operator
                                  - field
                                description: One condition.
                              description: The group's conditions.
                          required:
                            - logic
                            - items
                          description: A group of conditions.
                        description: >-
                          The condition groups. Empty when the policy matches
                          everything — an organization-wide default.
                    required:
                      - logic
                      - groups
                    description: When the policy matches.
                  actions:
                    type: object
                    properties:
                      hierarchy:
                        type: boolean
                        description: >-
                          `true`: the `approvals` decide one at a time, in the
                          order listed. `false`: all of them are asked at once.
                        example: false
                      autoAction:
                        type: string
                        enum:
                          - APPROVE
                          - DENY
                          - NONE
                        description: >-
                          What happens when the policy matches. `APPROVE`:
                          allowed right away. `DENY`: refused right away.
                          `NONE`: an approval request is opened and `approvals`
                          decide it.
                        example: NONE
                      moveBalance:
                        type: object
                        properties:
                          addBalance:
                            type: boolean
                            description: >-
                              `true`: when the policy approves — right away or
                              through its approvers — the amount is first moved
                              from the funding wallet (`fromAccountId` +
                              `fromWalletId`) into the wallet the payment comes
                              from (on a `SPEND_REVIEW` policy, the wallet of
                              the reviewed transaction). Nothing moves for an
                              incoming wallet transfer request, which credits
                              the wallet itself, nor when the funding wallet is
                              that wallet and the money would land in the same
                              balance.
                            example: true
                          fromAccountId:
                            type: string
                            description: >-
                              ID of the account that holds the funding wallet.
                              Present when `addBalance` is `true`.
                            example: 66f2a1c7b4d3e80012c9a0b4
                          fromWalletId:
                            type: string
                            description: >-
                              ID of the funding wallet. Present when
                              `addBalance` is `true`.
                            example: 6710b8e4c9e77b0012a4d6f3
                        required:
                          - addBalance
                        description: >-
                          Funding from another wallet of the organization once
                          the payment is approved — money moves only when
                          `addBalance` is `true`. Absent when not configured.
                      approvals:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - USER
                                - GROUP
                              description: >-
                                `USER`: one member of the organization. `GROUP`:
                                a user group of the organization — the first
                                member who decides, decides for the group.
                              example: GROUP
                            id:
                              type: string
                              description: ID of the user or of the group.
                              example: 8b0e4c2a-1f6d-4e3b-a9c7-2d5f8e1b6c30
                            name:
                              type: string
                              description: >-
                                Current name of the user or group. Absent when
                                the approver can no longer be found. Read-only:
                                remove it before sending the policy back on an
                                update.
                              example: Financeiro
                          required:
                            - id
                            - type
                          description: >-
                            One approver of the policy, with the user's or
                            group's current name.
                        description: >-
                          Who approves when `autoAction` is `NONE` — every entry
                          must approve, and one refusal denies the request.
                          Absent or empty for `APPROVE` and `DENY`.
                    required:
                      - autoAction
                      - hierarchy
                    description: What the policy does when it matches.
                  createdAt:
                    type: string
                    description: When the policy was created.
                    example: '2026-10-14T13:45:12.000Z'
                    format: date-time
                  updatedAt:
                    type: string
                    description: When the policy was last changed.
                    example: '2026-11-03T18:02:40.000Z'
                    format: date-time
                required:
                  - actions
                  - conditions
                  - context
                  - createdAt
                  - id
                  - name
                  - order
                  - organizationId
                  - realmId
                  - status
                  - updatedAt
                description: A business policy of the organization.
        '403':
          description: >-
            `BUSINESS_POLICY_FORBIDDEN` — You are not a member of the
            organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - BUSINESS_POLICY_FORBIDDEN
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - RULE_ENGINE
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: BUSINESS_POLICY_FORBIDDEN
                origin: RULE_ENGINE
                message: You do not have permission to manage business policies
        '404':
          description: >-
            `BUSINESS_POLICY_NOT_FOUND` — No policy with this ID belongs to the
            organization.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - BUSINESS_POLICY_NOT_FOUND
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - RULE_ENGINE
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: BUSINESS_POLICY_NOT_FOUND
                origin: RULE_ENGINE
                message: Business policy not found
        '422':
          description: >-
            `BAD_REQUEST` — A path parameter is not a valid ID; `fields` names
            it.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - RULE_ENGINE
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                  fields:
                    type: array
                    description: >-
                      One entry per invalid request field (validation errors
                      only).
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: >-
                            Path of the invalid field, e.g. `label` or
                            `values[0].value`.
                          example: label
                        message:
                          type: string
                          description: Why the field was rejected.
                          example: label is required
                        code:
                          type: string
                          description: >-
                            `<FIELD>_<REASON>` — e.g. `LABEL_REQUIRED`,
                            `TYPE_ONE_OF`, `VALUES_VALUE_TYPE_ERROR`.
                          example: LABEL_REQUIRED
                        values:
                          type: array
                          items:
                            type: string
                          description: >-
                            The accepted values, when the field is an
                            enumeration.
                      required:
                        - field
                        - message
                        - code
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: BAD_REQUEST
                origin: RULE_ENGINE
                message: >-
                  Bad Request: Your request is invalid or incomplete. Please
                  make sure you are requesting with the right fields.
                fields:
                  - field: businessPolicyId
                    message: Invalid UUID
                    code: BUSINESSPOLICYID_UUID

````

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