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

# Mint picker token

> Returns a short-lived provider access token for a browser file picker (file services with a token-based picker only). The refresh token is never returned. An optional body `{ resource }` names the resource the picker requested (used by the OneDrive picker, which requires a SharePoint-audience token); providers whose picker takes a single token ignore it. The OneDrive picker is available only for work or school (OneDrive for Business) accounts.



## OpenAPI

````yaml /api-reference/openapi.json post /workspaces/{workspaceId}/connections/{connectionId}/picker-token
openapi: 3.1.0
info:
  title: Nvisy API
  summary: Document detection and redaction platform
  description: >-
    Nvisy provides intelligent detection of sensitive content in documents,
    redaction pipelines, and reviewer workflows. This API enables document
    upload, detection analysis, redaction, and collaborative review across your
    workspaces.
  termsOfService: https://nvisy.com/legal/terms-of-service
  contact:
    name: Nvisy Support
    url: https://nvisy.com
    email: hello@nvisy.com
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 0.1.0
servers: []
security: []
tags:
  - name: Health
    description: Service health checks
  - name: Capabilities
    description: Read-only reference data describing this deployment
  - name: Accounts
    description: Account management and profile operations
  - name: Identities
    description: 'Account sign-in methods: password and linked providers'
  - name: Avatars
    description: Public avatar image serving
  - name: Authentication
    description: Login, signup, and token management
  - name: Workspaces
    description: Workspace creation and management
  - name: Activities
    description: Workspace activity log and export
  - name: Documents
    description: Document upload, download, and management
  - name: Analytics
    description: Aggregate metrics over a workspace's documents
  - name: Members
    description: Workspace member management
  - name: Invites
    description: Workspace invitation handling
  - name: API Tokens
    description: API token management
  - name: Connections
    description: External provider connections
  - name: Connection Syncs
    description: Connection synchronization runs
  - name: Providers
    description: Inference-provider configuration
  - name: Pipelines
    description: Redaction pipeline configuration
  - name: Detections
    description: Detection analysis and redaction
  - name: Redactions
    description: Redactions produced from a detection, with reviewer edits
  - name: Reviews
    description: Document reviews, the review queue, and their discussion
  - name: Policies
    description: Redaction policy configuration
  - name: Webhooks
    description: Webhook configuration
  - name: Notifications
    description: Account notification management
paths:
  /workspaces/{workspaceId}/connections/{connectionId}/picker-token:
    post:
      tags:
        - Connections
      summary: Mint picker token
      description: >-
        Returns a short-lived provider access token for a browser file picker
        (file services with a token-based picker only). The refresh token is
        never returned. An optional body `{ resource }` names the resource the
        picker requested (used by the OneDrive picker, which requires a
        SharePoint-audience token); providers whose picker takes a single token
        ignore it. The OneDrive picker is available only for work or school
        (OneDrive for Business) accounts.
      parameters:
        - in: path
          name: workspaceId
          description: Workspace identifier.
          required: true
          schema:
            description: Workspace identifier.
            type: string
            format: uuid
          style: simple
        - in: path
          name: connectionId
          description: Opaque identifier of the connection.
          required: true
          schema:
            $ref: '#/components/schemas/ConnectionId'
            description: Opaque identifier of the connection.
          style: simple
      requestBody:
        description: >-
          Body for minting a browser file-picker token.


          The `OneDrive` v8 picker requests a token per resource (it names the
          resource in

          each `authenticate` command); the caller passes that `resource` so the
          server

          mints a token scoped to exactly it. Ignored by providers whose picker
          takes a

          single provider token (Google Drive, Box); omit it for those.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkspacePickerTokenRequest'
        required: true
      responses:
        '200':
          description: >-
            A short-lived provider OAuth access token for a browser file picker.


            Carries only the access token and its expiry — never the refresh
            token, which

            stays server-side. The token is minted from the connection's stored

            credentials and is short-lived (the provider's access-token
            lifetime), so the

            browser holds a narrow, expiring credential rather than a durable
            one.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspacePickerToken'
        '400':
          description: >-
            The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
            view

            that [`Error`] renders to at the response boundary.


            It carries no builder logic — [`Error`] is the type handlers
            construct and

            thread through `Result`, and it builds an `ErrorResponse` directly
            in its

            `IntoResponse` impl. `context` and `status` are not part of the JSON
            body

            (`context` is logged, `status` sets the HTTP status line).


            [`Error`]: crate::response::Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
            view

            that [`Error`] renders to at the response boundary.


            It carries no builder logic — [`Error`] is the type handlers
            construct and

            thread through `Result`, and it builds an `ErrorResponse` directly
            in its

            `IntoResponse` impl. `context` and `status` are not part of the JSON
            body

            (`context` is logged, `status` sets the HTTP status line).


            [`Error`]: crate::response::Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
            view

            that [`Error`] renders to at the response boundary.


            It carries no builder logic — [`Error`] is the type handlers
            construct and

            thread through `Result`, and it builds an `ErrorResponse` directly
            in its

            `IntoResponse` impl. `context` and `status` are not part of the JSON
            body

            (`context` is logged, `status` sets the HTTP status line).


            [`Error`]: crate::response::Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
            view

            that [`Error`] renders to at the response boundary.


            It carries no builder logic — [`Error`] is the type handlers
            construct and

            thread through `Result`, and it builds an `ErrorResponse` directly
            in its

            `IntoResponse` impl. `context` and `status` are not part of the JSON
            body

            (`context` is logged, `status` sets the HTTP status line).


            [`Error`]: crate::response::Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    ConnectionId:
      description: Opaque conn identifier (conn_<uuid>).
      type: string
      pattern: >-
        ^conn_[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}$
    WorkspacePickerTokenRequest:
      description: >-
        Body for minting a browser file-picker token.


        The `OneDrive` v8 picker requests a token per resource (it names the
        resource in

        each `authenticate` command); the caller passes that `resource` so the
        server

        mints a token scoped to exactly it. Ignored by providers whose picker
        takes a

        single provider token (Google Drive, Box); omit it for those.
      type: object
      properties:
        resource:
          description: >-
            The resource the picker asked for (its `authenticate` command's

            `resource`), e.g. `https://contoso-my.sharepoint.com`. Optional;
            when

            absent the server uses the connection's default picker resource.
          type: string
          maxLength: 2048
          minLength: 1
    WorkspacePickerToken:
      description: >-
        A short-lived provider OAuth access token for a browser file picker.


        Carries only the access token and its expiry — never the refresh token,
        which

        stays server-side. The token is minted from the connection's stored

        credentials and is short-lived (the provider's access-token lifetime),
        so the

        browser holds a narrow, expiring credential rather than a durable one.
      type: object
      properties:
        accessToken:
          description: The provider OAuth access token to hand to the browser picker.
          type: string
        expiresAt:
          description: >-
            Unix seconds at which the access token expires, if the provider
            reports

            it. `None` means the provider did not return an expiry.
          type: integer
          format: int64
      required:
        - accessToken
    ErrorResponse:
      description: >-
        The serialized shape of an HTTP error: the inert wire/OpenAPI-schema
        view

        that [`Error`] renders to at the response boundary.


        It carries no builder logic — [`Error`] is the type handlers construct
        and

        thread through `Result`, and it builds an `ErrorResponse` directly in
        its

        `IntoResponse` impl. `context` and `status` are not part of the JSON
        body

        (`context` is logged, `status` sets the HTTP status line).


        [`Error`]: crate::response::Error
      type: object
      properties:
        message:
          description: User-friendly error message safe for client display.
          type: string
        name:
          description: The error name/type identifier.
          type: string
      required:
        - name
        - message

````