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

# Update aggregator connection

> Edits an existing Open-Finance data-aggregator (Pluggy/Belvo) connection by id so a mistyped baseUrl is not permanent. The vendor is immutable. clientId/secret are optional: supply both to rotate the sealed credential, or omit both to leave the stored secret intact. The supplied credential is sealed before persistence and is never returned. A non-aggregator connection id returns 404.



## OpenAPI

````yaml /pt/openapi/v3-current/matcher.yaml put /v1/discovery/aggregator-connections/{id}
openapi: 3.1.0
info:
  title: Matcher APIs
  description: >-
    Complete API reference for the Matcher reconciliation engine, providing
    automated transaction matching between Midaz Ledger and external systems.
  version: 6.1.0
  license:
    name: Lerian Studio General License
servers:
  - url: https://matcher.sandbox.lerian.net
security: []
paths:
  /v1/discovery/aggregator-connections/{id}:
    put:
      tags:
        - Discovery
      summary: Update aggregator connection
      description: >-
        Edits an existing Open-Finance data-aggregator (Pluggy/Belvo) connection
        by id so a mistyped baseUrl is not permanent. The vendor is immutable.
        clientId/secret are optional: supply both to rotate the sealed
        credential, or omit both to leave the stored secret intact. The supplied
        credential is sealed before persistence and is never returned. A
        non-aggregator connection id returns 404.
      operationId: updateAggregatorConnection
      parameters:
        - description: Opaque aggregator connection id
          in: path
          name: id
          required: true
          schema:
            description: Opaque aggregator connection id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAggregatorConnectionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AggregatorConnectionResponse'
          description: OK
        '400':
          description: The request contains invalid parameters or payload.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                400-clientid-and-secret-must-both-be-supplied-to-rotate-the-cred:
                  $ref: >-
                    #/components/examples/400-clientid-and-secret-must-both-be-supplied-to-rotate-the-cred
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: The requested resource was not found.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
              examples:
                mtch-0005-aggregator-connection-not-found:
                  $ref: >-
                    #/components/examples/mtch-0005-aggregator-connection-not-found
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    UpdateAggregatorConnectionRequest:
      additionalProperties: false
      properties:
        accountRef:
          description: >-
            Opaque vendor account reference (Pluggy itemId, Belvo link id).
            Supply it to bind (or re-bind) the connection after the vendor's
            consent widget returns one; omit it to leave the stored value
            untouched.
          examples:
            - a1b2c3d4-5678-90ab-cdef-1234567890ab
          type: string
        baseUrl:
          description: >-
            Vendor API base URL, stored as the connection host. Omit it to leave
            the stored URL untouched.
          examples:
            - https://api.pluggy.ai
          format: uri
          type: string
        clientId:
          description: >-
            Aggregator API client id (optional; supply with secret to rotate,
            omit both to keep the stored credential; sealed; never emitted)
          type: string
        configName:
          description: >-
            Unique connection config name (tenant-scoped); the mint endpoint
            binds a token to this name. Omit it to leave the stored name
            untouched.
          examples:
            - pluggy-main
          type: string
        secret:
          description: >-
            Aggregator API client secret (optional; supply with clientId to
            rotate, omit both to keep the stored credential; sealed; never
            emitted)
          type: string
      type: object
    AggregatorConnectionResponse:
      additionalProperties: false
      properties:
        accountRef:
          description: >-
            Stored opaque vendor account reference (Pluggy itemId, Belvo link
            id); empty while the connection is awaiting consent
          examples:
            - a1b2c3d4-5678-90ab-cdef-1234567890ab
          type: string
        awaitingConsent:
          description: >-
            Whether the connection is still awaiting the end customer's vendor
            consent (no vendor item/link bound yet)
          examples:
            - false
          type: boolean
        baseUrl:
          description: Stored vendor API base URL
          examples:
            - https://api.pluggy.ai
          format: uri
          type: string
        configName:
          description: Connection config name the operator mints a token against
          examples:
            - pluggy-main
          type: string
        vendor:
          description: Aggregator vendor the connection is bound to
          enum:
            - pluggy
            - belvo
          examples:
            - pluggy
          type: string
      required:
        - vendor
        - configName
        - baseUrl
        - accountRef
        - awaitingConsent
      type: object
    Detail:
      additionalProperties: false
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          examples:
            - ERR-0001
          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
    RateLimitErrorResponse:
      description: >-
        Flat body that the rate limiter returns. `code` is the HTTP status as a
        number.
      type: object
      required:
        - code
        - title
        - message
      properties:
        code:
          type: integer
          description: HTTP status code.
          example: 429
        title:
          type: string
          description: Error type.
          example: rate_limit_exceeded
        message:
          type: string
          description: Human-readable error message.
          example: rate limit exceeded
  examples:
    400-clientid-and-secret-must-both-be-supplied-to-rotate-the-cred:
      summary: >-
        clientId and secret must both be supplied to rotate the credential, or
        both...
      value:
        title: Bad Request
        status: 400
        detail: >-
          clientId and secret must both be supplied to rotate the credential, or
          both omitted to keep it
    mtch-0005-aggregator-connection-not-found:
      summary: Aggregator connection not found
      value:
        type: https://errors.lerian.studio/v1/MTCH-0005
        title: Not Found
        status: 404
        detail: >-
          The aggregator connection could not be found; check the connection id
          and try again
        code: MTCH-0005
  responses:
    Unauthorized:
      description: The request lacks valid authentication credentials.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Detail'
          examples:
            MissingToken:
              summary: Missing token
              value:
                type: https://errors.lerian.studio/v1/AUT-0006
                title: Token Missing
                status: 401
                detail: >-
                  A valid token must be provided in the request header. Please
                  include a token and try again.
                code: AUT-0006
            InvalidToken:
              summary: Invalid token
              value:
                type: https://errors.lerian.studio/v1/AUT-0007
                title: Invalid Token
                status: 401
                detail: >-
                  The provided token is expired, invalid or malformed. Please
                  provide a valid token and try again.
                code: AUT-0007
    Forbidden:
      description: You do not have permission to access this resource.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Detail'
          examples:
            TenantClaimRequired:
              summary: Tenant claim missing
              value:
                type: https://errors.lerian.studio/v1/MTCH-0004
                title: Forbidden
                status: 403
                detail: tenant claim required
                code: MTCH-0004
            PermissionDenied:
              summary: Permission denied
              value:
                type: https://errors.lerian.studio/v1/AUT-1020
                title: Permission Denied
                status: 403
                detail: >-
                  the credential is not allowed to perform contexts:read on this
                  request
                code: AUT-1020
    ValidationFailed:
      description: >-
        The request failed validation. The `errors` list names each value that
        failed.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Detail'
          example:
            title: Unprocessable Entity
            status: 422
            detail: validation failed
            errors:
              - message: expected required property name to be present
                location: body
    TooManyRequests:
      description: >-
        The request exceeded the rate limit. Wait the number of seconds in
        `Retry-After`, then retry.
      headers:
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitErrorResponse'
          example:
            code: 429
            title: rate_limit_exceeded
            message: rate limit exceeded
    InternalServerError:
      description: An unexpected error occurred on the server.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Detail'
          example:
            type: https://errors.lerian.studio/v1/MTCH-0002
            title: Internal Server Error
            status: 500
            detail: internal error
            code: MTCH-0002
        text/plain:
          schema:
            type: string
          example: Internal Server Error
  headers:
    RetryAfter:
      description: Seconds to wait before you retry.
      schema:
        type: integer
        example: 30
    XRateLimitLimit:
      description: Requests allowed in the current window.
      schema:
        type: integer
        example: 100
    XRateLimitRemaining:
      description: Requests left in the current window. Always `0` on a `429`.
      schema:
        type: integer
        example: 0
    XRateLimitReset:
      description: Unix time, in seconds, when the current window resets.
      schema:
        type: integer
        example: 1767225600
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: 'Bearer token authentication (format: "Bearer {token}")'
      scheme: bearer
      type: http

````

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