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

# Effective app permissions (project)

> What the PUBLISHED policy actually allows for an app, per tool — a read-only reflection, not an editor. Replaces the retired `/rules/permissions/{provider}`, which returned stored permission rows; this resolves the rules instead, so a verdict set by any matching rule appears here.

Omit `agentId` for the all-agents baseline. `variesByIdentity` counts identity-scoped rules the baseline cannot show. An organization rule's name is visible only to organization admins; other viewers receive `redacted: true`.




## OpenAPI

````yaml /openapi.yaml get /policy/effective-app-permissions
openapi: 3.1.0
info:
  title: OneCLI API
  version: '1.0'
  description: >
    The OneCLI API lets you manage agents, secrets, policy rules, app
    connections, and user settings programmatically.


    **Base URL:** `https://api.onecli.sh/v1` (Cloud) or
    `http://localhost:10254/v1` (self-hosted)


    ## Authentication


    All endpoints require authentication via one of:


    - **API Key** — `Authorization: Bearer <key>` header. Generate keys in the
    dashboard or via `GET /v1/user/api-key`.

    - **Session** — Cookie-based session from the web dashboard.


    For organization-scoped API keys, include the `X-Project-Id` header to
    specify which project to operate on.
servers:
  - url: https://api.onecli.sh/v1
    description: OneCLI Cloud
  - url: http://localhost:10254/v1
    description: Self-hosted (Docker)
security:
  - bearerAuth: []
tags:
  - name: Agents
    description: Manage agents and their access tokens, secrets, and configuration.
  - name: Secrets
    description: Manage credentials that the gateway injects into outbound requests.
  - name: Policy
    description: >-
      Author project policy-engine rules that control how agents interact with
      external services (staged draft → publish).
  - name: Approvals
    description: >-
      Long-poll for pending manual-approval requests and submit approve/deny
      decisions.
  - name: User
    description: Manage your user profile and API keys.
  - name: Projects
    description: >-
      Manage projects within your organization. Requires admin role for
      create/update and owner role for delete. Cloud only.
  - name: Team
    description: Provision team members programmatically. Requires admin role. Cloud only.
  - name: Apps
    description: >-
      Manage app connections (OAuth and direct credentials), BYOC configuration,
      permission catalogs, and blocklists.
  - name: Connections
    description: App connections as a top-level resource.
  - name: Utility
    description: Health check and project resource summaries.
  - name: Agent Setup
    description: >-
      Endpoints agents and orchestrators use to bootstrap gateway access
      (container config, credential stubs, gateway skill).
  - name: Migration
    description: Migrate data from a self-hosted instance to OneCLI Cloud.
  - name: Organization Settings
    description: >-
      Organization-wide policy settings. Available on OneCLI Cloud and
      self-hosted Enterprise.
  - name: Organization Secrets
    description: >-
      Manage secrets at the organization level. Organization secrets apply
      across all projects. Available on OneCLI Cloud and self-hosted Enterprise.
  - name: Organization Policy
    description: >-
      Author policy-engine rules at the organization level. Organization rules
      apply across all projects. Available on OneCLI Cloud and self-hosted
      Enterprise.
  - name: Organization Connections
    description: >-
      Manage app connections at the organization level. Available on OneCLI
      Cloud and self-hosted Enterprise.
  - name: Organization App Config
    description: >-
      Connect apps (OAuth and direct credentials) and manage BYOC app
      configuration at the organization level. Available on OneCLI Cloud and
      self-hosted Enterprise.
  - name: Organization Approvals
    description: >-
      Long-poll for manual-approval requests across every project in the
      organization. Available on OneCLI Cloud and self-hosted Enterprise.
  - name: Partner Organizations
    description: >-
      Create and manage customer organizations as a partner. Requires a Partner
      API key. Cloud only.
  - name: Partner Projects
    description: Manage projects within an unclaimed partner organization. Cloud only.
  - name: Partner Secrets
    description: >-
      Manage partner-level secrets inherited by every organization you manage.
      Cloud only.
  - name: Partner Budgets
    description: >-
      Cap how much an organization can spend on a partner LLM key. Owner or
      admin only. Cloud only.
  - name: Partner Members
    description: >-
      Manage who can sign in to your partner portal. Owner or admin only. Cloud
      only.
  - name: Organization Partner
    description: Inspect and detach an organization's partner relationship. Cloud only.
paths:
  /policy/effective-app-permissions:
    get:
      tags:
        - Policy
      summary: Effective app permissions (project)
      description: >
        What the PUBLISHED policy actually allows for an app, per tool — a
        read-only reflection, not an editor. Replaces the retired
        `/rules/permissions/{provider}`, which returned stored permission rows;
        this resolves the rules instead, so a verdict set by any matching rule
        appears here.


        Omit `agentId` for the all-agents baseline. `variesByIdentity` counts
        identity-scoped rules the baseline cannot show. An organization rule's
        name is visible only to organization admins; other viewers receive
        `redacted: true`.
      operationId: getEffectiveAppPermissions
      parameters:
        - name: provider
          in: query
          required: true
          schema:
            type: string
          description: App provider, e.g. `gmail`.
        - name: agentId
          in: query
          schema:
            type: string
          description: Narrow to one agent's identity.
      responses:
        '200':
          description: Per-tool verdicts, grouped read/write
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EffectiveAppPermissions'
components:
  schemas:
    EffectiveAppPermissions:
      type: object
      properties:
        provider:
          type: string
        basis:
          type: object
          properties:
            agentId:
              type: string
              nullable: true
              description: Null = the all-agents baseline.
            credentialAttached:
              type: boolean
            scope:
              type: string
              enum:
                - organization
                - project
        variesByIdentity:
          type: integer
          description: Identity-scoped rules the baseline view cannot show.
        groups:
          type: array
          items:
            type: object
            properties:
              category:
                type: string
                enum:
                  - read
                  - write
              verdict:
                $ref: '#/components/schemas/EffectiveToolVerdict'
              tools:
                type: array
                items:
                  type: object
                  properties:
                    toolId:
                      type: string
                    verdict:
                      $ref: '#/components/schemas/EffectiveToolVerdict'
                    rateLimit:
                      type: integer
                      nullable: true
                    rateLimitWindow:
                      type: string
                      nullable: true
                    decidedBy:
                      allOf:
                        - $ref: '#/components/schemas/EffectiveProvenance'
                      nullable: true
    EffectiveToolVerdict:
      type: string
      description: >
        `mixed` means the tool's variants — or a group's tools — disagree.
        `unmanaged` means no rule applies and the traffic passes through under
        the enforce-deny carve (no credential attached, or an LLM host). A rate
        limit is not a verdict: it rides `rateLimit`/`rateLimitWindow` on an
        `allow`.
      enum:
        - allow
        - approval
        - block
        - mixed
        - unmanaged
    EffectiveProvenance:
      type: object
      description: >-
        Which rule decided a verdict. An organization rule's name is visible
        only to organization admins; other viewers get `redacted` set instead,
        with the name withheld.
      properties:
        scope:
          type: string
          enum:
            - organization
            - project
        redacted:
          type: boolean
        rule:
          type: object
          properties:
            logicalId:
              type: string
            name:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key obtained from the dashboard or `GET /user/api-key`

````