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

# Refresh bank statements with MFA

> ## Refresh account statements with MFA (Multi Factor Authentication)

This API should be called only when the call to **/api/v2/statements/refresh** returns a MFA challenge, Http code: **203** or when the call to this API returns another MFA challenge.

## Params

**bankAccountId**: Id of the bank account to be refreshed.
**accountId**: Id of the account to be refreshed.
**pullIndex**: Represents the month to be refreshed. Please use the same value provided during the call to **/api/v2/statements/refresh**.
**mfaRequest**: MFA challenge that could be a simple question, an image, a multiple choice question or multiple images.
- **mfaSession**: Provided in the response of **/api/v2/statements/refresh**
 - **mfaBody**: Wrapper for questions.
    - **questions**: Represents different types of challenges.
        - **text**: Challenge text. E.g *Enter name of your first pet*.
        - **image**: Not required.
        - **choices**: Not required.
        - **imageChoices**: Not required.
        - **answer**: Answer to the question in text format.



## OpenAPI

````yaml /openapi-v2.json post /api/v2/statements/refresh/mfa
openapi: 3.1.0
info:
  title: LedgerSync V2 API
  version: '2.0'
servers:
  - url: https://ledgersyncappv2.com
    description: Production
  - url: https://staging.ledgersyncappv2.com
    description: Sandbox
security: []
tags:
  - name: account-api
    description: Account REST APIs
  - name: password-api
    description: Password REST APIs
  - name: transaction-api
    description: Transaction REST APIs
  - name: phone-verification-api
    description: Phone Verification REST APIs
  - name: employee-api
    description: Employee REST APIs
  - name: client-api
    description: Client REST APIs
  - name: check-api
    description: Check REST APIs
  - name: accounting-ai-api
    description: AI rule suggestion endpoints for external accounting integrations
  - name: institution-api
    description: Institution REST APIs
  - name: statement-api
    description: Statement REST APIs
  - name: authentication-api
    description: Auth REST APIs
paths:
  /api/v2/statements/refresh/mfa:
    post:
      tags:
        - statement-api
      summary: Refresh bank statements with MFA
      description: >-
        ## Refresh account statements with MFA (Multi Factor Authentication)


        This API should be called only when the call to
        **/api/v2/statements/refresh** returns a MFA challenge, Http code:
        **203** or when the call to this API returns another MFA challenge.


        ## Params


        **bankAccountId**: Id of the bank account to be refreshed.

        **accountId**: Id of the account to be refreshed.

        **pullIndex**: Represents the month to be refreshed. Please use the same
        value provided during the call to **/api/v2/statements/refresh**.

        **mfaRequest**: MFA challenge that could be a simple question, an image,
        a multiple choice question or multiple images.

        - **mfaSession**: Provided in the response of
        **/api/v2/statements/refresh**
         - **mfaBody**: Wrapper for questions.
            - **questions**: Represents different types of challenges.
                - **text**: Challenge text. E.g *Enter name of your first pet*.
                - **image**: Not required.
                - **choices**: Not required.
                - **imageChoices**: Not required.
                - **answer**: Answer to the question in text format.
      operationId: mfaRefreshStatements
      parameters:
        - name: Auth-Token
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StatementMfaChallenge'
        required: true
      responses:
        '200':
          description: Statements were successfully refreshed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/StatementRefreshResponse'
        '203':
          description: Some statements require MFA
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/StatementRefreshResponse'
        '403':
          description: Failed to refresh statements
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/StatementRefreshResponse'
components:
  schemas:
    StatementMfaChallenge:
      type: object
      properties:
        bankAccountId:
          type: integer
          format: int64
        accountId:
          type: integer
          format: int64
        pullIndex:
          type: integer
          format: int32
        source:
          type: string
          description: 'Bank-data provider: FINICITY (default) or MX.'
          enum:
            - DEFAULT
            - FINICITY
            - FDE
            - MX
        mfaChallenge:
          $ref: '#/components/schemas/MfaChallenge'
    StatementRefreshResponse:
      type: object
      properties:
        responseList:
          type: array
          items:
            $ref: '#/components/schemas/StatementRefreshInfo'
        errorMsg:
          type: string
    MfaChallenge:
      type: object
      properties:
        mfaSession:
          type: string
        mfaBody:
          $ref: '#/components/schemas/MfaBody'
    StatementRefreshInfo:
      type: object
      properties:
        refreshStatus:
          type: string
          enum:
            - SUCCESS
            - MFA
            - ERROR
            - FAILED
            - STMT_NOT_AVAILABLE
        bankAccountId:
          type: integer
          format: int64
        accountId:
          type: integer
          format: int64
        pullIndex:
          type: integer
          format: int32
        mfaWrapper:
          $ref: '#/components/schemas/MfaWrapper'
    MfaBody:
      type: object
      properties:
        questions:
          type: array
          items:
            $ref: '#/components/schemas/MfaQuestion'
    MfaWrapper:
      type: object
      properties:
        statusCode:
          type: string
          enum:
            - 100 CONTINUE
            - 101 SWITCHING_PROTOCOLS
            - 102 PROCESSING
            - 103 EARLY_HINTS
            - 103 CHECKPOINT
            - 200 OK
            - 201 CREATED
            - 202 ACCEPTED
            - 203 NON_AUTHORITATIVE_INFORMATION
            - 204 NO_CONTENT
            - 205 RESET_CONTENT
            - 206 PARTIAL_CONTENT
            - 207 MULTI_STATUS
            - 208 ALREADY_REPORTED
            - 226 IM_USED
            - 300 MULTIPLE_CHOICES
            - 301 MOVED_PERMANENTLY
            - 302 FOUND
            - 302 MOVED_TEMPORARILY
            - 303 SEE_OTHER
            - 304 NOT_MODIFIED
            - 305 USE_PROXY
            - 307 TEMPORARY_REDIRECT
            - 308 PERMANENT_REDIRECT
            - 400 BAD_REQUEST
            - 401 UNAUTHORIZED
            - 402 PAYMENT_REQUIRED
            - 403 FORBIDDEN
            - 404 NOT_FOUND
            - 405 METHOD_NOT_ALLOWED
            - 406 NOT_ACCEPTABLE
            - 407 PROXY_AUTHENTICATION_REQUIRED
            - 408 REQUEST_TIMEOUT
            - 409 CONFLICT
            - 410 GONE
            - 411 LENGTH_REQUIRED
            - 412 PRECONDITION_FAILED
            - 413 PAYLOAD_TOO_LARGE
            - 413 REQUEST_ENTITY_TOO_LARGE
            - 414 URI_TOO_LONG
            - 414 REQUEST_URI_TOO_LONG
            - 415 UNSUPPORTED_MEDIA_TYPE
            - 416 REQUESTED_RANGE_NOT_SATISFIABLE
            - 417 EXPECTATION_FAILED
            - 418 I_AM_A_TEAPOT
            - 419 INSUFFICIENT_SPACE_ON_RESOURCE
            - 420 METHOD_FAILURE
            - 421 DESTINATION_LOCKED
            - 422 UNPROCESSABLE_ENTITY
            - 423 LOCKED
            - 424 FAILED_DEPENDENCY
            - 425 TOO_EARLY
            - 426 UPGRADE_REQUIRED
            - 428 PRECONDITION_REQUIRED
            - 429 TOO_MANY_REQUESTS
            - 431 REQUEST_HEADER_FIELDS_TOO_LARGE
            - 451 UNAVAILABLE_FOR_LEGAL_REASONS
            - 500 INTERNAL_SERVER_ERROR
            - 501 NOT_IMPLEMENTED
            - 502 BAD_GATEWAY
            - 503 SERVICE_UNAVAILABLE
            - 504 GATEWAY_TIMEOUT
            - 505 HTTP_VERSION_NOT_SUPPORTED
            - 506 VARIANT_ALSO_NEGOTIATES
            - 507 INSUFFICIENT_STORAGE
            - 508 LOOP_DETECTED
            - 509 BANDWIDTH_LIMIT_EXCEEDED
            - 510 NOT_EXTENDED
            - 511 NETWORK_AUTHENTICATION_REQUIRED
        noMfaResponse: {}
        mfaRequest:
          $ref: '#/components/schemas/MfaChallenge'
        errorMessage:
          type: string
    MfaQuestion:
      type: object
      properties:
        text:
          type: string
        image:
          type: string
        choices:
          type: array
          items:
            $ref: '#/components/schemas/MfaTextOption'
        imageChoices:
          type: array
          items:
            $ref: '#/components/schemas/MfaImageOption'
        answer:
          type: string
    MfaTextOption:
      type: object
      properties:
        choice:
          type: string
        value:
          type: string
    MfaImageOption:
      type: object
      properties:
        imageChoice:
          type: string
        value:
          type: string

````

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