> ## 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.

# Update provider

> Updates provider name or encrypted data.



## OpenAPI

````yaml /api-reference/openapi.json patch /workspaces/{workspaceId}/providers/{providerId}
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}/providers/{providerId}:
    patch:
      tags:
        - Providers
      summary: Update provider
      description: Updates provider name or encrypted data.
      parameters:
        - in: path
          name: workspaceId
          description: Workspace identifier.
          required: true
          schema:
            description: Workspace identifier.
            type: string
            format: uuid
          style: simple
        - in: path
          name: providerId
          description: Opaque identifier of the provider.
          required: true
          schema:
            $ref: '#/components/schemas/ProviderId'
            description: Opaque identifier of the provider.
          style: simple
      requestBody:
        description: Request payload for updating an existing workspace provider.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWorkspaceProvider'
        required: true
      responses:
        '200':
          description: >-
            Response type for a workspace inference provider.


            Note: The encrypted provider data is never exposed in API responses.
            Only

            metadata about the provider is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceProvider'
        '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'
        '415':
          description: 'Expected request with `Content-Type: application/json`'
          content:
            text/plain:
              schema:
                type: string
        '422':
          description: Failed to deserialize the JSON body into the target type
          content:
            text/plain:
              schema:
                type: string
      security:
        - BearerAuth: []
components:
  schemas:
    ProviderId:
      description: Opaque prov identifier (prov_<uuid>).
      type: string
      pattern: >-
        ^prov_[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}$
    UpdateWorkspaceProvider:
      description: Request payload for updating an existing workspace provider.
      type: object
      properties:
        config:
          $ref: '#/components/schemas/ProviderConfig'
          description: >-
            Typed provider configuration. If provided, fully replaces the stored
            config

            (and, with it, the provider). Omit to leave it unchanged.
        displayName:
          description: Human-readable provider display name.
          type: string
          maxLength: 255
          minLength: 1
        isActive:
          description: Whether the provider is enabled. Omit to leave unchanged.
          type: boolean
    WorkspaceProvider:
      description: >-
        Response type for a workspace inference provider.


        Note: The encrypted provider data is never exposed in API responses.
        Only

        metadata about the provider is returned.
      type: object
      properties:
        createdAt:
          description: When the provider was created.
          type: string
          format: date-time
        createdBy:
          description: Account that created this provider.
          allOf:
            - $ref: '#/components/schemas/AccountRef'
        displayName:
          description: Human-readable provider display name.
          type: string
        id:
          description: Opaque identifier of the provider.
          allOf:
            - $ref: '#/components/schemas/ProviderId'
        isActive:
          description: Whether the provider is enabled.
          type: boolean
        provider:
          description: Provider identifier (`openai`, `ollama`, `anthropic`, ...).
          type: string
        providerType:
          description: Inference model type of the provider (llm, ner).
          allOf:
            - $ref: '#/components/schemas/ProviderType'
        updatedAt:
          description: When the provider was last updated.
          type: string
          format: date-time
        workspaceHandle:
          description: URL-safe workspace handle. Display-only.
          allOf:
            - $ref: '#/components/schemas/Handle'
        workspaceId:
          description: Unique identifier of the workspace.
          type: string
          format: uuid
      required:
        - id
        - workspaceId
        - workspaceHandle
        - createdBy
        - displayName
        - provider
        - providerType
        - isActive
        - createdAt
        - updatedAt
    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
    ProviderConfig:
      description: >-
        A fully-typed inference-provider configuration.


        Untagged: the inner config's `provider` tag is the sole discriminator,
        so the

        stored/wire form is flat. A new inference kind is added as a variant of

        [`InferenceConfig`] with no change here.
      allOf:
        - $ref: '#/components/schemas/InferenceConfig'
    AccountRef:
      description: >-
        Public reference to the account behind a resource — whoever created it,

        uploaded it, triggered it, or performed it.


        Reused across resource responses so an account is always presented the
        same

        way: its immutable id (the durable reference) plus a handle and optional

        avatar for display.
      type: object
      properties:
        avatarUrl:
          description: Serve path of the account's avatar, when set.
          type: string
        displayName:
          description: Human-readable display name, when set.
          type: string
        id:
          description: Immutable id of the account.
          type: string
          format: uuid
        username:
          description: Handle of the account (display).
          allOf:
            - $ref: '#/components/schemas/Handle'
      required:
        - id
        - username
    ProviderType:
      description: >-
        The inference model type backing a workspace provider.


        Corresponds to the `PROVIDER_TYPE` `PostgreSQL` enum. A workspace
        provider is

        an inference service the platform calls; this says which kind of model
        it

        is — a language model for chat, or a named-entity-recognition model for

        extraction. The concrete vendor (the `provider` column, e.g. `openai`)
        is

        orthogonal and stays open; this type is a stable, closed set used to
        find a

        workspace's provider of a given type without decrypting its config.
      oneOf:
        - description: A language model (chat / completion).
          type: string
          const: llm
        - description: A named-entity-recognition model (entity extraction).
          type: string
          const: ner
    Handle:
      description: >-
        Lowercase, dash-separated identifier used in URLs and as account
        handles.
      type: string
      maxLength: 32
      minLength: 3
      pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
    InferenceConfig:
      description: >-
        A fully-typed inference connection configuration, across every inference
        kind.


        Inference is a family: a language model for chat today, and other model
        kinds

        (e.g. named-entity recognition) as they are added. Each kind owns its
        own

        config with its own `provider` tag, and this enum is untagged, so the
        flat

        payload's `provider` remains the sole discriminator — an inference kind
        is

        added as a new variant with no change to the wire format or storage.
      allOf:
        - $ref: '#/components/schemas/LlmConfig'
    LlmConfig:
      description: >-
        A fully-typed LLM inference connection configuration.


        The `provider` tag selects the variant and thereby the credential shape,
        so

        an `OpenAI` connection cannot carry Anthropic credentials. The
        key-bearing

        variants hold an [`AuthenticatedProvider`], which masks the key in
        `Debug`;

        serialization exists only to persist the config encrypted at rest, never
        to

        return it in API responses.
      oneOf:
        - description: '`OpenAI` (or an OpenAI-compatible endpoint).'
          type: object
          properties:
            provider:
              type: string
              const: openai
          allOf:
            - $ref: '#/components/schemas/AuthenticatedProvider'
          required:
            - provider
        - description: Ollama, typically self-hosted.
          type: object
          properties:
            provider:
              type: string
              const: ollama
          allOf:
            - $ref: '#/components/schemas/UnauthenticatedProvider'
          required:
            - provider
        - description: Anthropic (Claude).
          type: object
          properties:
            provider:
              type: string
              const: anthropic
          allOf:
            - $ref: '#/components/schemas/AuthenticatedProvider'
          required:
            - provider
    AuthenticatedProvider:
      description: >-
        Configuration for a provider reached with an API key (`OpenAI`,
        Anthropic).


        The `api_key` is masked in [`Debug`], so neither this struct nor any
        config

        that embeds it leaks the key.
      type: object
      properties:
        apiKey:
          description: The provider API key.
          type: string
        baseUrl:
          description: >-
            Override the API base URL (for a compatible endpoint or a proxy).
            Optional.
          type: string
        defaultModel:
          description: Default model to use when a request does not specify one. Optional.
          type: string
      required:
        - apiKey
    UnauthenticatedProvider:
      description: >-
        Configuration for a provider reached without an API key (Ollama),
        addressed

        by a caller-supplied base URL. Carries no secret, so it derives
        [`Debug`].
      type: object
      properties:
        baseUrl:
          description: Base URL of the server (e.g. `http://localhost:11434`).
          type: string
        defaultModel:
          description: Default model to use when a request does not specify one. Optional.
          type: string
      required:
        - baseUrl

````