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

# Returns the add account widget's URL



## OpenAPI

````yaml /openapi-v2.json post /api/v2/account/add
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/account/add:
    post:
      tags:
        - account-api
      summary: Returns the add account widget's URL
      operationId: addAccount
      parameters:
        - name: Auth-Token
          in: header
          description: Authentication token provided during the authentication process
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddAccountRequest'
        required: true
      responses:
        '200':
          description: "Returns the add account URL widget to be invoked by the client\n\nSet the optional **source** field to **MX** to connect a bank via MX (for banks Finicity does not support); omit it (or use FINICITY) for the default Finicity flow. When **source=MX**, widgetUrl is an MX Connect URL (moneydesktop.com) loaded with the MX Connect widget instead of the Finicity SDK below; omit institutionId to let the user search for their bank in the widget.\n\nWhen the call succeed, returning code 200, grab the content of widgetUrl and make a call to this url. See below:\n\nExample of returning JSON:\n{\n  \"status\": \"OK\",\n  \"widgetUrl\": \"https://connect.finicity.com?analytics=google%3AUA-123456789-1&customerId=53829905&partnerId=2445582741601&redirectUri=https%3A%2F%2Fce5d9f86.ngrok.io%2Fapi%2Fpublic%2Fredirect-handler&signature=4837879cbdab90530c5191bec7209719cbb25657d38b6d6e862f809d44aaf661&timestamp=1589996840006&ttl=1590004040006&type=aggregation&webhook=https%3A%2F%2Fce5d9f86.ngrok.io%2Fapi%2Fpublic%2Fwebhook-handler&webhookContentType=application%2Fjson\"\n}\n\n** Include the below script on your page ** \n\t<script&nbsp;src=\"https://connect.finicity.com/assets/sdk/finicity-connect.min.js\"></script>\n\n** Make this call to trigger the widget ** \n\t\t\twindow['finicityConnect']['connectIFrame']('**ADD THE CONTENT OF widgetUrl HERE**', {\n                            success: () => {\n                                console.log('success');\n                            },\n                            cancel : () => {\n                                console.log('cancel');\n                            },\n                            error  : () => {\n                                console.log('error');\n                            },\n                            loaded : () => {\n                                console.log('loaded');\n                            }\n                        });\n"
          content:
            '*/*':
              schema:
                type: string
        '401':
          description: Unauthorized. Bad credentials or the authentication system is down
          content:
            '*/*':
              schema:
                type: string
components:
  schemas:
    AddAccountRequest:
      type: object
      properties:
        username:
          type: string
        redirectUri:
          type: string
        institutionId:
          type: string
        source:
          type: string
          description: >-
            Bank-data provider: FINICITY (default) or MX. Omit for Finicity.
            Applies to both /api/v2/account/add and /api/v2/account/add/lite.
            Use /api/v2/institutions/provider-options to find which providers
            cover a given bank.
          enum:
            - DEFAULT
            - FINICITY
            - FDE
            - MX

````

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