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

# Create a connection

> Use this endpoint to obtain a connect token, which can be used to initialize the Meld widget and start a bank linking connection.



## OpenAPI

````yaml /openapi/banklinking-20260203.json post /bank-linking/connect/start
openapi: 3.1.0
info:
  title: BANK LINKING
  termsOfService: urn:tos
  license:
    name: Apache 2.0
    url: https://springdoc.org
  version: '2026-02-03'
  description: ''
servers:
  - url: https://api-sb.meld.io
    description: Meld API sandbox
  - url: https://api.meld.io
    description: Meld API production
security: []
tags:
  - name: Financial Account Connect
  - name: Financial Account Transactions
  - name: Financial Accounts
  - name: Institutions
paths:
  /bank-linking/connect/start:
    post:
      tags:
        - Connect
      summary: Create a connection
      description: >-
        Use this endpoint to obtain a connect token, which can be used to
        initialize the Meld widget and start a bank linking connection.
      operationId: bank-linking-connect-create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectStartRequest_2022_11_10'
            example:
              externalCustomerId: testUser
        required: true
      responses:
        '201':
          description: Connect token was created
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ConnectStartResponse'
        '400':
          description: 'Bad Request : check request values and format'
        '401':
          description: Invalid credentials
        '403':
          description: Unauthenticated or authenticated with insufficient access
        '500':
          description: >-
            Server Error. This applies to all 5xx errors, including but not
            limited to 500, 501, 502, 503, and 504 errors. You should treat all
            of these errors the same.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ConnectStartRequest_2022_11_10:
      type: object
      properties:
        accountPreferenceOverride:
          description: The account preference overrides for this connection
          allOf:
            - $ref: '#/components/schemas/BankLinkingPreference'
        allowRedirect:
          type: boolean
          description: >-
            When searching financial institutions via the Meld bank picker,
            filters the results based on whether or not the service provider
            will cause a redirect as part of account linking.


            When false, will only include financial institutions which will not
            cause a redirect. When true, all financial institutions are included
            regardless of whether or not they may require a redirect. Default is
            true.
        externalCustomerId:
          type: string
          default: testUser
          description: >-
            Your unique identifier for your customer. If maintaining your own
            customer management system this can also be used for tracking
            customer activity.
          minLength: 1
          example: testUser
        institutionId:
          type: string
          description: Institution id to bypass the institution selection pane.
        institutionSearchString:
          type: string
          description: >-
            When searching financial institutions via the Meld bank picker,
            pre-populate the search string with this value
        optionalProducts:
          type: array
          description: >-
            Set of products to load from the financial institution via the
            service provider if supported.


            Can be empty as long as there is at least one required product
            specified. There must be at least one product specified somewhere
            for the connection to load some data.


            Financial institutions do not need to support any of these products
            in order to be included in the Meld bank picker search results.
          items:
            type: string
            enum:
              - BALANCES
              - IDENTIFIERS
              - INVESTMENT_HOLDINGS
              - INVESTMENT_TRANSACTIONS
              - OWNERS
              - TRANSACTIONS
        products:
          type: array
          description: >-
            Set of products to load from the financial institution via the
            service provider after the connection is completed.


            Can be empty as long as there is at least one optional product
            specified. There must be at least one product specified somewhere
            for the connection to load some data.


            When searching financial institutions via the Meld bank picker, only
            those which support all of the selected products will be included.
            When empty, financial institutions will not be filtered by supported
            products.


            ***Note:*** Each service provider handles products differently, and
            vary in which accounts they expose based on the inputted products.


            For more details, reference [Supported
            Products](https://docs.meld.io/docs/creating-connections#supported-products)
            and the relevant Provider Details pages, e.g.
            [Plaid](https://docs.meld.io/docs/plaid)
          items:
            type: string
            enum:
              - BALANCES
              - IDENTIFIERS
              - INVESTMENT_HOLDINGS
              - INVESTMENT_TRANSACTIONS
              - OWNERS
              - TRANSACTIONS
        redirectUrl:
          type: string
          description: >-
            If provided, the url to redirect to after completing the service
            provider's widget flow
        regions:
          type: array
          description: >-
            When searching financial institutions via the Meld bank picker,
            onlythose which service any of the regions provided will be
            included. A service region can be either an ISO 3166-1 alpha-2
            country code or an ISO 3166-2 subdivision code. National financial
            institutions which service an entire country are included for the
            corresponding country when only subdivision regions are provided.
          items:
            type: string
          uniqueItems: true
      required:
        - externalCustomerId
    ConnectStartResponse:
      type: object
      properties:
        connectToken:
          type: string
          description: Connect token needed to go through the connect flow
        customerId:
          type: string
          description: >-
            Meld will create a new customer or use the existing customer based
            on the external customer id provided in the request. Keep track of
            this customer id for use in other endpoints and webhook tracking.
        externalCustomerId:
          type: string
          description: External id for the customer as provided in the request
        id:
          type: string
          description: Connection id
        widgetUrl:
          type: string
          description: Widget url to go through the connect flow
    BankLinkingPreference:
      type: object
      properties:
        accountLogoUrl:
          type: string
          description: The path to the account's logo for displaying in the bank picker
        borderColor:
          type: string
          description: The color of the border for the bank picker
        borderTextColor:
          type: string
          description: >-
            The color of the text on the bank picker border (i.e. 'Integrations
            powered by Meld.io')
        font:
          type: string
          description: The desired font to use for the Meld picker
        institutionSelectionText:
          type: string
          description: The text to display at the top of bank picker
        routingRetry:
          type: boolean
          description: >-
            Whether to present the option to try to connect to the institution
            again with a different service provider if the last attempt failed.
            If a value is not set, it is assumed to be false.
        routingRetryBankButtonColor:
          type: string
          description: >-
            The color of the routing retry button to select a different
            institution
        routingRetryProviderButtonColor:
          type: string
          description: The color of the routing retry button to select a different provider
        selectionStyle:
          type: string
          description: The style in which the bank picker displays the institutions
          enum:
            - LIST
            - TILE
        showBorder:
          type: boolean
          description: >-
            Whether to show the border for the bank picker widget. If a value is
            not set, it is assumed to be false.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      x-default: BASIC <Meld API Key>

````