> ## 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}/policy-request



## OpenAPI

````yaml /api-reference/ruleengine.openapi.json get /realms/{realmId}/organizations/{organizationId}/policy-request
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}/policy-request:
    get:
      tags:
        - Policy Request
      summary: /realms/{realmId}/organizations/{organizationId}/policy-request
      operationId: getRealmsByRealmIdOrganizationsByOrganizationIdPolicyRequest
      parameters:
        - name: realmId
          in: path
          required: true
          schema:
            type: string
        - name: organizationId
          in: path
          required: true
          schema:
            type: string
        - name: userId
          in: query
          required: false
          schema:
            type: string
            minLength: 1
        - name: requestStatus
          in: query
          required: false
          schema:
            type: string
            enum:
              - REQUESTED
              - APPROVED
              - DENIED
              - CANCELED
              - EXPIRED
        - name: executionStatus
          in: query
          required: false
          schema:
            type: string
            enum:
              - WAITING
              - PROCESSING
              - EXECUTED
              - FAILED
        - name: approvalStatus
          in: query
          required: false
          schema:
            type: string
            enum:
              - WAITING
              - REQUESTED
              - APPROVED
              - DENIED
              - CANCELED
        - name: subjectType
          in: query
          required: false
          schema:
            type: string
            minLength: 1
        - name: subjectId
          in: query
          required: false
          schema:
            type: string
            minLength: 1
        - name: next
          in: query
          required: false
          schema:
            type: string
            minLength: 1
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
            maximum: 100
      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
                        accountId:
                          type: string
                          description: >-
                            Kept from the request payload so the subject can be
                            fulfilled later.
                        walletId:
                          type: string
                        context:
                          anyOf:
                            - type: string
                              enum:
                                - PAYMENT
                                - SPEND_REVIEW
                                - TRAVEL
                              description: The business surface a policy governs.
                            - type: string
                        subjectType:
                          type: string
                        subjectId:
                          type: string
                        requester:
                          type: object
                          properties:
                            userId:
                              type: string
                            name:
                              type: string
                            email:
                              type: string
                          required:
                            - userId
                            - name
                            - email
                        body:
                          type: object
                          additionalProperties: {}
                          description: Full subject entity snapshot.
                        policyId:
                          type: string
                          description: The matched business policy.
                        status:
                          type: string
                          enum:
                            - REQUESTED
                            - APPROVED
                            - DENIED
                            - CANCELED
                            - EXPIRED
                          description: >-
                            Root lifecycle: REQUESTED → APPROVED | DENIED |
                            CANCELED | EXPIRED (terminal).
                        executionStatus:
                          type: string
                          enum:
                            - WAITING
                            - PROCESSING
                            - EXECUTED
                            - FAILED
                          description: Runs only after the root reaches APPROVED.
                        executionFailReason:
                          type: string
                        approvalDeadline:
                          anyOf:
                            - type: string
                            - type: string
                              format: date-time
                          description: >-
                            createdAt + policy.actions.approvalDeadlineHours
                            (default 72h).
                        executionMoveBalance:
                          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
                          description: Copied from the matched policy at creation.
                        approvalHierarchy:
                          type: boolean
                          description: Copied from policy.actions.hierarchy.
                        approvals:
                          type: array
                          items:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - USER
                                  - GROUP
                              id:
                                type: string
                                description: >-
                                  userId when type=USER, groupId when
                                  type=GROUP.
                              name:
                                type: string
                              status:
                                type: string
                                enum:
                                  - WAITING
                                  - REQUESTED
                                  - APPROVED
                                  - DENIED
                                  - CANCELED
                                description: Per-approval / per-approver lifecycle.
                              users:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    userId:
                                      type: string
                                    userName:
                                      type: string
                                    userEmail:
                                      type: string
                                    status:
                                      type: string
                                      enum:
                                        - WAITING
                                        - REQUESTED
                                        - APPROVED
                                        - DENIED
                                        - CANCELED
                                      description: Per-approval / per-approver lifecycle.
                                  required:
                                    - userId
                                    - userName
                                    - userEmail
                                    - status
                                description: >-
                                  1 entry for USER, N for GROUP — resolved from
                                  identity at creation.
                              createdAt:
                                anyOf:
                                  - type: string
                                  - type: string
                                    format: date-time
                              requestedAt:
                                anyOf:
                                  - type: string
                                  - type: string
                                    format: date-time
                              decisionAt:
                                anyOf:
                                  - type: string
                                  - type: string
                                    format: date-time
                            required:
                              - type
                              - id
                              - name
                              - status
                              - users
                        createdAt:
                          anyOf:
                            - type: string
                            - type: string
                              format: date-time
                        updatedAt:
                          anyOf:
                            - type: string
                            - type: string
                              format: date-time
                      required:
                        - id
                        - realmId
                        - organizationId
                        - accountId
                        - walletId
                        - context
                        - subjectType
                        - subjectId
                        - requester
                        - body
                        - policyId
                        - status
                        - executionStatus
                        - approvalDeadline
                        - approvalHierarchy
                        - approvals
                required:
                  - next
                  - items
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````