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

# Replace the institution's connector configuration

> Replaces the connector type and the non-secret connector configuration of an existing institution. The stored sealed credentials are preserved untouched; a body carrying credential material is refused with 400 before any write (credentials are written only by PUT /v1/institutions/{institutionId}/connector-credentials). The connector cache is invalidated on success. Returns 404 when the institution has no configuration.



## OpenAPI

````yaml /es/openapi/v3-current/sisbajud-executor.yaml put /v1/institutions/{institutionId}/connector-config
openapi: 3.1.0
info:
  description: >-
    API for the Lerian SISBAJUD executor, which runs judicial orders on Midaz.
    It covers institution and Midaz connector configuration, orders that need
    attention, ledger-routing checks, credential key rotation and audit
    verification.
  title: Lerian SISBAJUD Executor API
  version: 1.0.0
servers:
  - url: https://api.example.com
    description: >-
      Replace the example host with the URL provided during environment
      onboarding.
security:
  - BearerAuth: []
tags:
  - description: >-
      Institution configuration lifecycle: create (with key provisioning), read,
      and partial update of a connector configuration addressed by institution
      id.
    name: Institution
  - description: >-
      Rotation of the key that wraps an institution's stored connector
      credentials, addressed by institution id.
    name: Security
  - description: 'Admin API: audit-trail integrity verification.'
    name: Admin
paths:
  /v1/institutions/{institutionId}/connector-config:
    put:
      tags:
        - Institution
      summary: Replace the institution's connector configuration
      description: >-
        Replaces the connector type and the non-secret connector configuration
        of an existing institution. The stored sealed credentials are preserved
        untouched; a body carrying credential material is refused with 400
        before any write (credentials are written only by PUT
        /v1/institutions/{institutionId}/connector-credentials). The connector
        cache is invalidated on success. Returns 404 when the institution has no
        configuration.
      operationId: put-institution-connector-config
      parameters:
        - description: The institution's unique identifier (UUID).
          in: path
          name: institutionId
          required: true
          schema:
            description: The institution's unique identifier (UUID).
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PutConnectorConfigRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InstitutionConfigResponse'
          description: OK
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Internal Server Error
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Error
components:
  schemas:
    PutConnectorConfigRequest:
      additionalProperties: false
      properties:
        connectorMetadata:
          description: >-
            The connector's NON-SECRET configuration bag. REPLACES the stored
            bag wholesale (baseUrl and organizations[] always required;
            authAddress whenever credentials are stored), while the stored
            sealed credentials subtree is PRESERVED untouched. A credentials
            subtree, or any secret-bearing key (secret, token, password, api
            key, client id, ...) at any depth, is refused with 400 before any
            write: credentials are written only by PUT
            /v1/institutions/{institutionId}/connector-credentials.
          examples:
            - authAddress: https://auth.example.com
              baseUrl: https://midaz.example.com
              blockableAccountTypes:
                - deposit
              blockableBalances:
                - default
              crmBaseUrl: https://midaz-crm.example.com
              organizations:
                - ledgers:
                    - 019fcd7c-1e18-7034-8cd3-9e39c1759e41
                  organizationId: 019fcd7b-97df-71a5-8023-6eb3c661968b
        connectorType:
          description: >-
            The outbound connector type. Replaces the stored value; an unknown
            type is refused with 400.
          examples:
            - midaz
          minLength: 1
          type: string
      required:
        - connectorType
        - connectorMetadata
      type: object
    InstitutionConfigResponse:
      additionalProperties: false
      properties:
        accountFormat:
          description: >-
            The regular expression the institution declared for the account
            number of a court-indicated target; omitted when none is declared.
          examples:
            - ^[0-9]{1,12}$
          type: string
        branchFormat:
          description: >-
            The regular expression the institution declared for the branch
            (agência) number of a court-indicated target; omitted when none is
            declared.
          examples:
            - ^[0-9]{4}$
          type: string
        connectorMetadata:
          description: >-
            Connector-specific configuration bag. The non-secret connector-owned
            keys (baseUrl, authAddress, crmBaseUrl, crmMode, organizations[],
            blockableBalances, blockableAccountTypes, salaryAccountTypes) are
            preserved verbatim; secret-bearing keys — the whole credentials
            subtree included — are removed and never echoed. blockableBalances
            carries the LEDGER's balance-key values — for Midaz, balanceKey
            (default/overdraft/a client-registered key), not the
            available/onHold fields of a balance.
          examples:
            - baseUrl: https://midaz.example.com
              blockableAccountTypes:
                - deposit
              blockableBalances:
                - default
              organizations:
                - ledgers:
                    - 019fcd7c-1e18-7034-8cd3-9e39c1759e41
                  organizationId: 019fcd7b-97df-71a5-8023-6eb3c661968b
        connectorMetadataValid:
          description: >-
            Present and false only when the stored connector metadata cannot be
            parsed by its connector; absent otherwise. The offending value is
            never echoed.
          examples:
            - false
          readOnly: true
          type: boolean
        connectorType:
          description: The outbound connector type for this institution.
          examples:
            - midaz
          type: string
        createdAt:
          description: RFC 3339 creation timestamp (UTC).
          examples:
            - '2024-01-15T10:30:00Z'
          type: string
        effectiveCrmMode:
          description: >-
            The CRM surface this institution resolves to (legacy|embedded): its
            own crmMode override when the connector metadata names one, the
            service-wide default otherwise. Derived and read-only; omitted when
            the connector metadata cannot be parsed.
          enum:
            - legacy
            - embedded
          examples:
            - legacy
          readOnly: true
          type: string
        enabled:
          description: Whether the connector configuration is active.
          examples:
            - true
          type: boolean
        institutionCode:
          description: >-
            The institution's BACEN CNPJ (8 digits) for return-file headers and
            file header validation.
          examples:
            - '12345678'
          type: string
        institutionId:
          description: The institution's unique identifier (UUID).
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        retryPolicyConfig:
          description: Operational retry policy (backoff/attempts) as arbitrary JSON.
          examples:
            - maxAttempts: 3
        updatedAt:
          description: RFC 3339 last-update timestamp (UTC).
          examples:
            - '2024-01-15T12:00:00Z'
          type: string
      required:
        - institutionId
        - connectorType
        - institutionCode
        - enabled
        - createdAt
        - updatedAt
      type: object
    Detail:
      additionalProperties: true
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````

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