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

# Platform file policies for the browser upload gate

> Returns the platform-level `client` hooks the browser applies before
an upload: enabled ones (or `immutable`, which are always applied),
listening to `before_upload`, with a non-empty `policy`, reduced to
the fields the upload gate reads. Open to any signed-in session.
Organization hooks reach the browser with the user's session. An
anonymous session is served only within an organization that enables
anonymous access.

The browser treats a `404` as "no platform policy". On a server or
network error, a timeout or a malformed answer, it reuses the answer
it loaded in the last 15 minutes; otherwise, and on any other `4xx`,
it blocks uploads (fail closed).




## OpenAPI

````yaml /api-reference/ai-governance-v2/swagger.yml get /v1/hooks/client
openapi: 3.0.3
info:
  version: 1.0.0
  title: AI Governance API
  description: |
    Public REST API for the Prisme.ai AI Governance workspace -
    announcements, legal documents, notifications, observability
    dashboards, audit logs, active-org listing, and the file upload
    policies (`client` hooks) of the platform and organizations.
  contact:
    name: Prisme.ai
    url: https://prisme.ai
servers:
  - url: https://{host}/v2/workspaces/slug:ai-governance-v2/webhooks
    description: Prisme.ai workspace webhooks
    variables:
      host:
        default: api.studio.prisme.ai
        description: API host (override for self-hosted or sandbox)
security:
  - BearerAuth: []
  - OrgApiKeyAuth: []
tags:
  - name: Announcements
    description: Platform announcements (CRUD + audience targeting).
  - name: Legal
    description: Versioned legal documents (terms, privacy, etc.).
  - name: Notifications
    description: Per-user notifications derived from announcements.
  - name: Observability
    description: >-
      Cross-workspace and per-workspace observability dashboards, traces, and
      feeds.
  - name: Orgs
    description: Organization listing and audit logs.
  - name: Hooks
    description: >
      File policies (`client` hooks on `before_upload`) that the browser

      applies before uploads from the chat, Knowledge, the Builder and CSV

      imports, at the platform and organization levels. Only `client` targets go
      through this API; server-side

      (`http` / `workspace`) hooks stay in each product's configuration and,

      for an organization, in its settings written by the org owner.
paths:
  /v1/hooks/client:
    get:
      tags:
        - Hooks
      summary: Platform file policies for the browser upload gate
      description: |
        Returns the platform-level `client` hooks the browser applies before
        an upload: enabled ones (or `immutable`, which are always applied),
        listening to `before_upload`, with a non-empty `policy`, reduced to
        the fields the upload gate reads. Open to any signed-in session.
        Organization hooks reach the browser with the user's session. An
        anonymous session is served only within an organization that enables
        anonymous access.

        The browser treats a `404` as "no platform policy". On a server or
        network error, a timeout or a malformed answer, it reuses the answer
        it loaded in the last 15 minutes; otherwise, and on any other `4xx`,
        it blocks uploads (fail closed).
      operationId: getClientHooks
      responses:
        '200':
          description: Platform client hooks, possibly empty.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HooksList'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HooksError'
        '403':
          description: >-
            `ANONYMOUS_NOT_ALLOWED` - an anonymous session outside an
            organization that enables anonymous access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HooksError'
      security:
        - BearerAuth: []
components:
  schemas:
    HooksList:
      type: object
      required:
        - hooks
      properties:
        hooks:
          type: array
          items:
            $ref: '#/components/schemas/ClientHook'
    HooksError:
      type: object
      description: >-
        Error body of the Hooks routes. Validation answers may carry extra
        context from the validator.
      required:
        - error
        - code
      additionalProperties: true
      properties:
        error:
          type: string
          description: Human-readable message.
        code:
          type: string
          description: >-
            Stable code - UNAUTHORIZED, FORBIDDEN, METHOD_NOT_ALLOWED,
            VALIDATION_ERROR, TARGET_NOT_SUPPORTED, HOOK_ID_CONFLICT,
            HOOK_LOCKED, ANONYMOUS_NOT_ALLOWED, ORG_READ_FAILED,
            ORG_UPDATE_FAILED, PLATFORM_HOOKS_SAVE_FAILED,
            HOOK_VALIDATION_UNAVAILABLE.
        status:
          type: integer
          description: HTTP status, repeated in some bodies.
        valid:
          type: boolean
          description: '`false` on a validation answer.'
        hook_id:
          type: string
          description: Hook the error is about, when known.
    ClientHook:
      type: object
      required:
        - id
        - events
        - target
      properties:
        id:
          type: string
          pattern: ^[a-zA-Z0-9_-]{1,64}$
          description: Unique in the list.
        display_name:
          type: string
          maxLength: 256
        events:
          type: array
          description: Exactly `[before_upload]`.
          items:
            type: string
            enum:
              - before_upload
        enabled:
          type: boolean
          default: true
        immutable:
          type: boolean
          description: >-
            Locks this id against lower levels; a locked hook is applied even
            when `enabled` is false.
        target:
          $ref: '#/components/schemas/ClientHookTarget'
    ClientHookTarget:
      type: object
      required:
        - type
        - policy
      properties:
        type:
          type: string
          enum:
            - client
        policy:
          type: array
          minItems: 1
          maxItems: 32
          description: Rules, all of which must pass.
          items:
            $ref: '#/components/schemas/ClientPolicyRule'
        applies_to:
          type: array
          maxItems: 32
          description: >-
            MIME types the hook evaluates, without whitespace, `*` only as the
            last character (wildcard). Absent or `[]` = every file. A file in an
            OLE container (legacy or encrypted Office, `.msg`) also matches any
            pattern naming a `.doc`, `.xls`, `.ppt`, `.msg`, `.docx`, `.xlsx` or
            `.pptx` type.
          items:
            type: string
            minLength: 1
            maxLength: 128
        mip_tenant_id:
          type: string
          pattern: >-
            ^$|^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          description: >-
            GUID. Only the active label of this tenant feeds `mip:label:*`.
            Absent or `""` = the first active label.
        on_unreadable:
          type: string
          enum:
            - allow
            - deny
          default: deny
          description: >-
            A file the browser cannot open (Purview-encrypted Office, OLE) when
            a rule reads a property outside `file.*` - refuse it or skip this
            hook. A policy on `file.*` properties only is evaluated as usual.
    ClientPolicyRule:
      type: object
      required:
        - property
        - operator
        - on_fail
      properties:
        property:
          type: string
          minLength: 1
          maxLength: 128
          description: Metadata key, e.g. `mip:label:id`, `file.readable`.
        operator:
          type: string
          enum:
            - in
            - not_in
            - equals
            - exists
            - matches
        allowed:
          type: array
          maxItems: 256
          description: >-
            Values for `in`, `not_in`, `equals` and `matches`; at most 65536
            characters once serialized as JSON.
          items:
            type: string
        on_fail:
          type: string
          enum:
            - allow
            - deny
        message:
          type: string
          maxLength: 1024
          description: Shown to the user when the rule refuses a file.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        User-bound credential carrying an identity: either a session JWT
        or a user access token (`at:*`) generated from the user settings UI.
        Send as `Authorization: Bearer <token>`.
        Org API keys (`iak_*`) are **not** accepted here - they carry
        no user identity. Use the `x-prismeai-api-key` header instead
        (see `OrgApiKeyAuth`).
    OrgApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key
      description: |
        Organization API key (`iak_{orgSlug}_{uuid}`), managed from the
        AI Governance UI. Unlike `Authorization: Bearer`, this credential
        is **not** tied to a user identity - it is bound to the org and
        its effective access is defined by the scopes / permission rules
        attached to it (it can be restricted to a single project, or kept
        broader - e.g. usable across AI Governance, Agent Factory and
        LLM Gateway).
        Send as `x-prismeai-api-key: iak_...`.

````

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