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

# Get all suggestion rows in a batch, grouped



## OpenAPI

````yaml get /api/govern/data-access/suggest/batch/{batch_id}
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/govern/data-access/suggest/batch/{batch_id}:
    get:
      tags:
        - Policy management
      summary: Get all suggestion rows in a batch, grouped
      operationId: get_suggestion_batch_api_govern_data_access_suggest_batch__batch_id__get
      parameters:
        - name: batch_id
          in: path
          required: true
          schema:
            type: string
            description: Suggestion batch ID.
            title: Batch Id
          description: Suggestion batch ID.
        - name: table_fqn
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Narrow the batch to a single `catalog.schema.table`.
            title: Table Fqn
          description: Narrow the batch to a single `catalog.schema.table`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicySuggestionBatchResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    PolicySuggestionBatchResponse:
      properties:
        batch_id:
          type: string
          title: Batch Id
        rows:
          items:
            $ref: '#/components/schemas/PolicySuggestionRowResponse'
          type: array
          title: Rows
      type: object
      required:
        - batch_id
      title: PolicySuggestionBatchResponse
      description: All suggestion rows in a batch, grouped.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PolicySuggestionRowResponse:
      properties:
        correlation_id:
          type: string
          title: Correlation Id
        batch_id:
          type: string
          title: Batch Id
        table_fqn:
          type: string
          title: Table Fqn
        status:
          type: string
          title: Status
        result:
          anyOf:
            - $ref: '#/components/schemas/PolicySuggestionResult'
            - type: 'null'
        created_by:
          type: string
          title: Created By
        created_at:
          type: string
          title: Created At
        decided_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Decided By
        decided_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Decided At
      type: object
      required:
        - correlation_id
        - batch_id
        - table_fqn
        - status
        - created_by
        - created_at
      title: PolicySuggestionRowResponse
      description: 'A single persisted suggestion row: status + parsed result.'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PolicySuggestionResult:
      properties:
        table_fqn:
          type: string
          title: Table Fqn
          description: Fully qualified table name.
        suggestions:
          items:
            $ref: '#/components/schemas/PolicySuggestion'
          type: array
          title: Suggestions
        skipped:
          items:
            type: string
          type: array
          title: Skipped
          description: Human-readable reasons a driver was skipped (e.g. already covered).
      type: object
      required:
        - table_fqn
      title: PolicySuggestionResult
      description: Complete crew output for one table.
    PolicySuggestion:
      properties:
        suggestion_id:
          type: string
          title: Suggestion Id
          description: Stable ID within this result.
        action:
          type: string
          enum:
            - create
            - extend
          title: Action
          description: '''create'' a new policy or ''extend'' an existing one.'
          default: create
        existing_policy_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Existing Policy Id
          description: Ranger policy ID to extend when action='extend'.
        policy:
          $ref: '#/components/schemas/PolicyCreateRequest-Output'
          description: The proposed policy, ready for the validated create/merge path.
        kind:
          type: string
          enum:
            - access
            - masking
            - row_filter
            - deny
          title: Kind
          description: >-
            Policy kind. Determined by the deterministic classification map for
            mapped classifications — the LLM cannot change it.
        driven_by:
          items:
            type: string
          type: array
          title: Driven By
          description: Accepted classifications that drove this suggestion.
        rationale:
          type: string
          title: Rationale
          description: Why this policy is suggested.
          default: ''
        confidence:
          type: number
          title: Confidence
          description: Confidence score between 0.0 and 1.0.
          default: 0
        requires_provisioning:
          $ref: '#/components/schemas/KcProvisioningPlan'
          description: Missing Keycloak principals to provision on acceptance.
      type: object
      required:
        - suggestion_id
        - policy
        - kind
      title: PolicySuggestion
      description: One proposed Ranger policy for a table.
    PolicyCreateRequest-Output:
      properties:
        name:
          type: string
          title: Name
          description: Policy name.
        description:
          type: string
          title: Description
          description: Policy description.
          default: ''
        resources:
          additionalProperties:
            $ref: '#/components/schemas/RangerResourceValue'
          type: object
          title: Resources
          description: >-
            Resource definitions keyed by resource type. For example, `catalog`,
            `schema`, `table`, `column`, `url`.
        policyType:
          type: integer
          title: Policytype
          description: 0=ACCESS, 1=MASKING, 2=ROWFILTER.
          default: 0
        policyPriority:
          type: integer
          title: Policypriority
          description: 0=NORMAL, 1=OVERRIDE. Controls evaluation order.
          default: 0
        isEnabled:
          type: boolean
          title: Isenabled
          default: true
        isAuditEnabled:
          type: boolean
          title: Isauditenabled
          default: true
        isDenyAllElse:
          type: boolean
          title: Isdenyallelse
          description: >-
            If true, Ranger denies any access not explicitly allowed by this
            policy.
          default: false
        policyItems:
          items:
            $ref: '#/components/schemas/RangerPolicyItemModel'
          type: array
          title: Policyitems
          description: Allow access items.
        denyPolicyItems:
          items:
            $ref: '#/components/schemas/RangerPolicyItemModel'
          type: array
          title: Denypolicyitems
          description: Deny access items.
        allowExceptions:
          items:
            $ref: '#/components/schemas/RangerPolicyItemModel'
          type: array
          title: Allowexceptions
          description: Allow exception items.
        denyExceptions:
          items:
            $ref: '#/components/schemas/RangerPolicyItemModel'
          type: array
          title: Denyexceptions
          description: Deny exception items.
        rowFilterPolicyItems:
          items:
            $ref: '#/components/schemas/RangerRowFilterItemModel'
          type: array
          title: Rowfilterpolicyitems
          description: Row filter items. Supports `policyType=2` only.
        dataMaskPolicyItems:
          items:
            $ref: '#/components/schemas/RangerDataMaskItemModel'
          type: array
          title: Datamaskpolicyitems
          description: Masking items. Supports `policyType=1` only.
        policyLabels:
          items:
            type: string
          type: array
          title: Policylabels
          description: Labels for grouping/filtering policies.
        overwrite:
          type: boolean
          title: Overwrite
          description: >-
            Defaults to `False`. If set to `False`, a name collision returns a
            409 error response. Set to `True` to intentionally update an
            existing policy of the same name.
          default: false
      type: object
      required:
        - name
        - resources
      title: PolicyCreateRequest
      description: Request to create or update a single Ranger policy.
    KcProvisioningPlan:
      properties:
        roles:
          items:
            type: string
          type: array
          title: Roles
          description: Realm roles to create if missing.
        groups:
          items:
            type: string
          type: array
          title: Groups
          description: Groups to create if missing.
        role_assignments:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Role Assignments
          description: >-
            Role→principal assignments, e.g. {'role': ..., 'group': ...} or
            {'role': ..., 'user': ...}.
      type: object
      title: KcProvisioningPlan
      description: >-
        Keycloak principals a suggestion needs that don't exist yet.


        Populated by the validator agent when a proposed principal is absent
        from

        Keycloak. Acceptance provisions these before the Ranger policy is

        created/merged. Empty when every referenced principal already exists.
    RangerResourceValue:
      properties:
        values:
          items:
            type: string
          type: array
          title: Values
          description: >-
            Resource values. For example, `['iceberg']`, `['my_schema']`, or
            `['*']`.
        isExcludes:
          type: boolean
          title: Isexcludes
          description: If set to `True`, NexusOne excludes the values.
          default: false
        isRecursive:
          type: boolean
          title: Isrecursive
          description: If set to `True`, applies recursively.
          default: false
      type: object
      required:
        - values
      title: RangerResourceValue
      description: >-
        A single resource entry in a Ranger policy. For example, `catalog`,
        `schema`, or `table`.
    RangerPolicyItemModel:
      properties:
        accesses:
          items:
            $ref: '#/components/schemas/RangerAccess'
          type: array
          title: Accesses
          description: Access types granted/denied.
        users:
          items:
            type: string
          type: array
          title: Users
          description: Users this item applies to.
        groups:
          items:
            type: string
          type: array
          title: Groups
          description: Groups this item applies to.
        roles:
          items:
            type: string
          type: array
          title: Roles
          description: Roles this item applies to.
        delegateAdmin:
          type: boolean
          title: Delegateadmin
          description: Whether grantees can delegate administrator rights.
          default: false
      type: object
      title: RangerPolicyItemModel
      description: An access control entry within a Ranger policy.
    RangerRowFilterItemModel:
      properties:
        accesses:
          items:
            $ref: '#/components/schemas/RangerAccess'
          type: array
          title: Accesses
        users:
          items:
            type: string
          type: array
          title: Users
        groups:
          items:
            type: string
          type: array
          title: Groups
        roles:
          items:
            type: string
          type: array
          title: Roles
        rowFilterInfo:
          additionalProperties: true
          type: object
          title: Rowfilterinfo
          description: 'Row filter definition. For example, `{''filterExpr'': ''col > 5''}`.'
      type: object
      required:
        - rowFilterInfo
      title: RangerRowFilterItemModel
      description: A row filter entry within a Ranger row-filter policy.
    RangerDataMaskItemModel:
      properties:
        accesses:
          items:
            $ref: '#/components/schemas/RangerAccess'
          type: array
          title: Accesses
        users:
          items:
            type: string
          type: array
          title: Users
        groups:
          items:
            type: string
          type: array
          title: Groups
        delegateAdmin:
          type: boolean
          title: Delegateadmin
          default: false
        dataMaskInfo:
          $ref: '#/components/schemas/RangerDataMaskInfoModel'
      type: object
      required:
        - dataMaskInfo
      title: RangerDataMaskItemModel
      description: A masking entry within a Ranger masking policy.
    RangerAccess:
      properties:
        type:
          type: string
          title: Type
          description: Access type. For example, `select`, `insert`, `use`, `show`.
        isAllowed:
          type: boolean
          title: Isallowed
          description: Whether you can use this Ranger access type.
          default: true
      type: object
      required:
        - type
      title: RangerAccess
      description: A single access type in a policy item.
    RangerDataMaskInfoModel:
      properties:
        dataMaskType:
          type: string
          title: Datamasktype
          description: >-
            Mask type name from the service-def. For example, `MASK`,
            `MASK_NULL`.
        conditionExpr:
          anyOf:
            - type: string
            - type: 'null'
          title: Conditionexpr
        valueExpr:
          anyOf:
            - type: string
            - type: 'null'
          title: Valueexpr
      type: object
      required:
        - dataMaskType
      title: RangerDataMaskInfoModel
      description: 'Masking spec: which mask type + optional expressions.'
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

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