---
title: "Create Connect session"
method: POST
path: "/connect_sessions/create"
tags: ["Connect Sessions"]
---

# Create Connect session

`POST /connect_sessions/create`

Allows you to create a connect session, which will be used to access Salt Edge Connect for connection creation.

## Request body

- ConnectSessionRequestBody
  - `data` object, required
    - `customer_id` string, required — the `id` of the customer received from [customer create](#customers-create). This field is optional for ['app' authentication](/general/v5/#services_and_apps_authentication)
    - `consent` ConsentRequestBody, required
      - `scopes` string[], required — data to be allowed for fetching. The allowed values for this parameter must fall within the client's `allowed_fetch_scopes` and/or provider's `supported_fetch_scopes` restrictions. To change the client's allowed scopes, please <a href='https://www.saltedge.com/pages/contact' target="_blank">contact our Sales team</a>. <strong>Note:</strong> `account_details` scope covers both `accounts` and `accounts_without_balance` attempt's [fetch_scopes](#attempts).<br>
      - `from_date` string, date — date to be allowed for fetching the data from. This parameter is used when `scopes` parameter contains `transactions_details`. The allowed values for this parameter must be within exactly 365 days ago.
      - `to_date` string, date, nullable — date to be allowed for fetching the data until. The allowed values for this parameter must be equal or more than `from_date`.
      - `period_days` integer — determines the period the consent will be valid for. Defaults to `null` (limitless) or provider's `max_consent_days`. The allowed value for this parameter must not be higher than the provider's `max_consent_days`.
    - `attempt` AttemptRequestBody
      - `fetch_scopes` string[] — fetching mode. Defaults to [consent](#consents-object) scopes. The allowed values for this parameter must comply to the [consent](#consents-object) `scopes` restriction.
      - `from_date` string, date — date from which you want to fetch data for your connection. Defaults to [consent](#consents-object) `from_date`. The allowed values for this parameter must be within exactly 365 days ago and it should comply to the fetching period restrictions in the [consent](#consents-object).
      - `to_date` string, date — date until which you want to fetch data for your connection. Defaults to `null` (today). The allowed values for this parameter must be equal or more than `from_date` and less or equal than tomorrow. Also it should comply to the fetching period restrictions in the [consent](#consents-object).
      - `fetched_accounts_notify` boolean — whether Salt Edge should send a success callback after fetching accounts.
      - `custom_fields` object — a JSON object, which will be sent back on any of your callbacks.
      - `locale` string — the language of the Connect widget and of the returned error message(s) in the <a href='http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes' target="_blank">ISO 639-1</a> format. Possible values are: `bg`, `cz`, `de`, `en`, `es-MX`, `es`, `fi`, `fr`, `he`, `hr`, `hu`, `it`, `nl`, `pl`, `pt-BR`, `pt`, `ro`, `ru`, `si`, `sk`, `sv`, `tr`, `uk`, `zh-HK`(Traditional), `zh`(Simplified). Defaults to `en`.
      - `include_natures` string[], nullable — the natures of the accounts that need to be fetched. Check [accounts attributes](#accounts-attributes) for possible values. If `null`, all accounts will be fetched.
      - `customer_last_logged_at` string, date-time — the datetime when user was last active in your application
      - `exclude_accounts` string[] — array of [account `ids`](#accounts-list) which will not be fetched. Applied to `reconnect` and `refresh` atempts.
      - `store_credentials` boolean, required — whether the credentials should be stored on Salt Edge side
      - `unduplication_strategy` string — This parameter mandates how duplicated transactions are managed. Possible values include: `mark_as_pending`, `mark_as_duplicate`, `delete_transactions`. The default is set to `mark_as_pending`. The provided value remains unchanged until other value is sent on [connect_session/reconnect](/account_information/v5/#connections-reconnect) or [connect_session/refresh](/account_information/v5/#connections-refresh). - `mark_as_pending` - leaves identified duplicated transactions in `Pending` status for clients that establish connections with providers having a non-null `custom_pendings_period` - `mark_as_duplicate` - identifies transactions as duplicated and sets the `duplicated` flag to `true` - `delete_trasactions` - removes identified duplicated transactions
      - `user_present` boolean — whether the request was initiated by the end-user of your application. It is taken into account only for PSD2-compliant providers and used for `reconnect` and `refresh`.
      - `return_to` string — the URL the user will be redirected to, defaults to client's home URL. If the provider has `api` mode and interactive `true` then this field is `mandatory`.
    - `allowed_countries` string[], nullable — the list of countries that will be accessible in Salt Edge Connect, e.g.: `['US', 'DE']`.
    - `country_code` string, nullable — returns the list of providers only from given country. Possible values: any country code from <a href='http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2' target="_blank">ISO 3166-1 alpha-2</a>, e.g.: `'DE'`.
    - `provider_code` string — the code of the desired provider, defaults to `null`
    - `daily_refresh` boolean — whether the connection should be automatically refreshed by Salt Edge.
    - `disable_provider_search` boolean — whether the provider search will be disabled, works only if `provider_code` parameter is sent.
    - `return_connection_id` boolean — whether to append `connection_id` to `return_to` URL.
    - `provider_modes` string[] — restricts the list of the providers to only the ones that have the mode included in the array.
    - `categorization` 'none' | 'personal' | 'business' — the type of categorization applied.
    - `javascript_callback_type` 'iframe' | 'external_saltbridge' | 'external_notify' | 'post_message', nullable — allows you to specify what kind of callback type you are expecting.
    - `include_fake_providers` boolean — if sent as `true`, the customers of [live](/general/v5/#live) clients will be able to connect [fake providers](#providers-fake).
    - `lost_connection_notify` boolean — being sent as `true`, enables you to receive a javascript callback whenever the internet connection is lost during the fetching process. The type of the callback depends on the `javascript_callback_type` you specified. It has the following payload: `{data: {error_class: 'ConnectionLost', error_message: 'Internet connection was lost'}}`.
    - `show_consent_confirmation` boolean — if consent confirmation is handled on the client's side, this parameter should be sent as `false` so, upon submitting the form, the user will not be asked to give the consent to Salt Edge Inc.
    - `credentials_strategy` 'store' | 'do_not_store' | 'ask' — the strategy of storing customer's credentials. <strong>Note:</strong> If the value is `ask`, on the Connect page, the customer will be able to choose whether to save or not the credentials on Salt Edge side
    - `return_error_class` boolean — whether to append `error_class` to `return_to` URL.
    - `theme` 'default' | 'dark' — theme of Salt Edge Connect template. If not passed or available for the current template, will use `default`.
    - `connect_template` string — defaults to `Salt Edge Connect` template unless a different template is passed and available for the current client
    - `show_connect_overview` boolean — shows an overview of fetched accounts and balances after fetching was finished.

## Response `200`

OK

- ConnectSessionResponse
  - `data` object
    - `expires_at` string, date-time
    - `connect_url` string

## Other responses

- `400` — The passed `from_date` - `to_date` interval is out of consent `from_date` - `to_date` range
- `404` — A customer with such `customer_id` could not be found
- `406` — Invalid consent period_days value or not allowed by provider

---

[API](https://skmtc.net/saltedge/apis/salt-edge-account-information-api.md) · [All operations](https://skmtc.net/saltedge/apis/salt-edge-account-information-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/saltedge/salt-edge-account-information-api/versions/f18f4f36d0b3/schema)
