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

# Switch Bank Account JWE

> Switch a bank account in a user's merchant account.



## OpenAPI

````yaml api-reference/openapi.json POST /bank-account
openapi: 3.1.0
info:
  title: Knot API
  description: An API to interact with the Knot merchant connectivity platform.
  version: 1.0.0
servers:
  - url: https://development.knotapi.com
    description: Development server
security:
  - basicAuth: []
paths:
  /bank-account:
    post:
      summary: Switch Bank Account JWE
      description: Switch a bank account in a user's merchant account.
      operationId: bank_account_switch
      requestBody:
        description: The input parameters required for switching a bank account.
        content:
          application/json:
            schema:
              type: object
              properties:
                jwe:
                  type: string
                  description: >-
                    JWE value. The encrypted payload contains a `user` object
                    and a `bank_account` object. Learn more
                    [here](card-switcher/sending-card-data).
                  example: eyJhbGciOiJSU0EtT0FFUC0yNTYiLC...
                task_id:
                  type: string
                  description: >-
                    `task_id` value provided in the
                    [`AUTHENTICATED`](/link/webhook-events/authenticated)
                    webhook.
                  example: '123456'
              required:
                - jwe
                - task_id
      responses:
        '200':
          description: >-
            Successful request. Receiving this response means your request has
            passed validations, including the `jwe`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Success message.
                    example: Success
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                UserFieldRequired:
                  summary: User object field required
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_JWE
                    error_message: The user.phone number is required.
                AccountNumberRequired:
                  summary: Account number required.
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_JWE
                    error_message: The bank_account.account_number is required.
                RoutingNumberRequired:
                  summary: Routing number required.
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_JWE
                    error_message: The bank_account.routing_number is required.
                AccountNumberInvalid:
                  summary: Account number invalid.
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_JWE
                    error_message: The bank_account.account_number is invalid.
                RoutingNumberInvalid:
                  summary: Routing number invalid.
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_JWE
                    error_message: The bank_account.routing_number is invalid.
                AccountTypeInvalid:
                  summary: Account type invalid.
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_JWE
                    error_message: The bank_account.type is invalid.
                FieldNotAllowed:
                  summary: Field not allowed.
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_JWE
                    error_message: The card field is not allowed.
                JWEInvalid:
                  summary: JWE invalid.
                  value:
                    error_type: INVALID_REQUEST
                    error_code: INVALID_JWE
                    error_message: The jwe is invalid.
        '403':
          description: Forbidden request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                NoAccess:
                  summary: No access
                  value:
                    error_type: INVALID_REQUEST
                    error_code: NO_ACCESS
                    error_message: Please contact Knot for access to this endpoint.
components:
  schemas:
    Error:
      type: object
      properties:
        error_type:
          type: string
          description: Type of error.
          enum:
            - INVALID_INPUT
            - INVALID_REQUEST
            - USER_ERROR
            - SESSION_ERROR
            - MERCHANT_ACCOUNT_ERROR
            - MERCHANT_ERROR
            - SUBSCRIPTION_ERROR
            - TRANSACTION_ERROR
            - CART_ERROR
            - WEBHOOK_ENDPOINT_ERROR
            - REQUEST_LOG_ERROR
          example: INVALID_REQUEST
        error_code:
          type: string
          description: Error code.
          enum:
            - INVALID_API_KEYS
            - INVALID_FIELD
            - INVALID_JWE
            - INVALID_CURSOR_FORMAT
            - USER_NOT_FOUND
            - MERCHANT_ACCOUNT_NOT_FOUND
            - MERCHANT_ACCOUNT_DISCONNECTED
            - SESSION_NOT_FOUND
            - EXTEND_NOT_SUPPORTED
            - MERCHANT_UNAVAILABLE
            - NO_ACCESS
            - TRANSACTION_NOT_FOUND
            - NO_TRANSACTIONS
            - SUBSCRIPTION_NOT_FOUND
            - CANCELLABLE_SUBSCRIPTION_NOT_FOUND
            - MULTIPLE_CANCELLABLE_SUBSCRIPTIONS_FOUND
            - ONGOING_OPERATION
            - CART_NOT_FOUND
            - FULFILLMENT_NOT_FOUND
            - INVALID_ACCESS_TOKEN
            - INSUFFICIENT_SCOPE
            - INSUFFICIENT_ROLE
            - WEBHOOK_ENDPOINT_NOT_FOUND
            - WEBHOOK_ENDPOINT_LIMIT_REACHED
            - WEBHOOK_ENDPOINT_ALREADY_EXISTS
            - RATE_LIMIT_EXCEEDED
            - ENVIRONMENT_MISMATCH
            - REQUEST_LOG_NOT_FOUND
            - REQUEST_LOG_QUERY_TIMEOUT
          example: INVALID_FIELD
        error_message:
          type: string
          description: Detailed error message.
          example: The limit may not be greater than 10.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Basic authentication header of the form `Basic <encoded-value>`, where
        `<encoded-value>` is the base64-encoded string `username:password`. Use
        your `client_id` as the `username` and your `secret` as the `password`
        value.

````

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