---
title: "Create a Data Session"
method: POST
path: "/api/service/data/session/create"
tags: ["Data"]
---

# Create a Data Session

`POST /api/service/data/session/create`

Creates a data session for the merchant corresponding to the API key.

## Request body

- CreateDataSessionDto
  - `referenceId` string, required — An internal reference id which will be stored with the data session. Needs to be unique per data session. Maximum length is 200 characters.
  - `displayId` string — Currently only visible in the merchant dashboard. This id used to be displayed to the user during the checkout.
  - `locale` 'de' | 'nl' | 'en' | 'fr' | 'es' | 'fi' | 'it' | 'pt' | 'sv' | 'pl' | 'sk' | 'lt' — The locale of the data session. If not provided, the default locale will be used.
  - `market` 'AF' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ' | 'AG' | 'AR' | 'AM' | 'AW' | 'AU' | 'AT' | 'AZ' | 'BS' | 'BH' | 'BD' | 'BB' | 'BY' | 'BE' | 'BZ' | 'BJ' | 'BM' | 'BT' | 'BO' | 'BA' | 'BW' | 'BV' | 'BR' | 'IO' | 'BN' | 'BG' | 'BF' | 'BI' | 'KH' | 'CM' | 'CA' | 'CV' | 'KY' | 'CF' | 'TD' | 'CL' | 'CN' | 'CX' | 'CC' | 'CO' | 'KM' | 'CG' | 'CD' | 'CK' | 'CR' | 'CI' | 'HR' | 'CU' | 'CY' | 'CZ' | 'DK' | 'DJ' | 'DM' | 'DO' | 'EC' | 'EG' | 'SV' | 'GQ' | 'ER' | 'EE' | 'ET' | 'FK' | 'FO' | 'FJ' | 'FI' | 'FR' | 'GF' | 'PF' | 'TF' | 'GA' | 'GM' | 'GE' | 'DE' | 'GH' | 'GI' | 'GR' | 'GL' | 'GD' | 'GP' | 'GU' | 'GT' | 'GN' | 'GW' | 'GY' | 'HT' | 'HM' | 'VA' | 'HN' | 'HK' | 'HU' | 'IS' | 'IN' | 'ID' | 'IR' | 'IQ' | 'IE' | 'IL' | 'IT' | 'JM' | 'JP' | 'JO' | 'KZ' | 'KE' | 'KI' | 'KP' | 'KR' | 'KW' | 'KG' | 'LA' | 'LV' | 'LB' | 'LS' | 'LR' | 'LY' | 'LI' | 'LT' | 'LU' | 'MO' | 'MG' | 'MW' | 'MY' | 'MV' | 'ML' | 'MT' | 'MH' | 'MQ' | 'MR' | 'MU' | 'YT' | 'MX' | 'FM' | 'MD' | 'MC' | 'MN' | 'MS' | 'MA' | 'MZ' | 'MM' | 'NA' | 'NR' | 'NP' | 'NL' | 'NC' | 'NZ' | 'NI' | 'NE' | 'NG' | 'NU' | 'NF' | 'MP' | 'MK' | 'NO' | 'OM' | 'PK' | 'PW' | 'PS' | 'PA' | 'PG' | 'PY' | 'PE' | 'PH' | 'PN' | 'PL' | 'PT' | 'PR' | 'QA' | 'RE' | 'RO' | 'RU' | 'RW' | 'SH' | 'KN' | 'LC' | 'PM' | 'VC' | 'WS' | 'SM' | 'ST' | 'SA' | 'SN' | 'SC' | 'SL' | 'SG' | 'SK' | 'SI' | 'SB' | 'SO' | 'ZA' | 'GS' | 'ES' | 'LK' | 'SD' | 'SR' | 'SJ' | 'SZ' | 'SE' | 'CH' | 'SY' | 'TW' | 'TJ' | 'TZ' | 'TH' | 'TL' | 'TG' | 'TK' | 'TO' | 'TT' | 'TN' | 'TR' | 'TM' | 'TC' | 'TV' | 'UG' | 'UA' | 'AE' | 'GB' | 'US' | 'UM' | 'UY' | 'UZ' | 'VU' | 'VE' | 'VN' | 'VG' | 'VI' | 'WF' | 'EH' | 'YE' | 'ZM' | 'ZW' | 'AX' | 'BQ' | 'CW' | 'GG' | 'IM' | 'JE' | 'ME' | 'BL' | 'MF' | 'RS' | 'SX' | 'SS' | 'XK' — ISO 3166-1 alpha-2 country code of the market. If set, the market's default banks will be displayed during the Data Session.
  - `successCallbackUrl` string — Required if not set in the dashboard. Users will be redirected here after a successful session.
  - `errorCallbackUrl` string — Required if not set in the dashboard. Users will be redirected here after a unsuccessful session.
  - `metadata` object — Any data which will be stored and returned for this data session. See [here](https://docs.getivy.de/reference/metadata) for more info.
  - `expiresAt` number — The Epoch time in seconds at which the Session should expire. It can be anywhere from 30 minutes to 24 hours after Session creation. By default, this value is 1 hour from creation. When setting this field, you also need to set `created`.
  - `createdAt` number — Required when setting expiresAt. The Epoch time in seconds at which the Session was created.
  - `themeVariant` 'light' | 'dark' — The theme variant which will be used in the data session. If not provided, the default light theme will be used.
  - `prefill` object — Prefill options for the data session
    - `bankId` string — The preselected bank. Provide a valid bankId from the bank endpoints. If given, the user will skip the bank selection.
  - `disableBankSelection` boolean — False by default. If set to true, customers cannot choose another bank than the pre-selected one.

## Response `201`

Returns the details of the data session

- CreateDataSessionResponseDto
  - `id` string, required — The id of the data session.
  - `referenceId` string, required — An internal reference id for the data session.
  - `redirectUrl` string, required — The redirect URL of the data session.
  - `displayId` string, required — Currently only visible in the merchant dashboard. This id used to be displayed to the user during the checkout.
  - `merchantId` string, required — The id of the merchant.
  - `status` 'open' | 'closed' | 'expired', required — The status of the data session.
  - `createdAt` number, required — The Epoch time in seconds at which the Session was created.
  - `updatedAt` number, required — The Epoch time in seconds at which the Session was updated.
  - `expiresAt` number, required — The Epoch time in seconds at which the Session will expire.
  - `availableMarkets` string[], required — The markets where the user of the Data Session can select banks from.
  - `locale` 'de' | 'nl' | 'en' | 'fr' | 'es' | 'fi' | 'it' | 'pt' | 'sv' | 'pl' | 'sk' | 'lt' — The locale of the data session.
  - `market` 'AF' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ' | 'AG' | 'AR' | 'AM' | 'AW' | 'AU' | 'AT' | 'AZ' | 'BS' | 'BH' | 'BD' | 'BB' | 'BY' | 'BE' | 'BZ' | 'BJ' | 'BM' | 'BT' | 'BO' | 'BA' | 'BW' | 'BV' | 'BR' | 'IO' | 'BN' | 'BG' | 'BF' | 'BI' | 'KH' | 'CM' | 'CA' | 'CV' | 'KY' | 'CF' | 'TD' | 'CL' | 'CN' | 'CX' | 'CC' | 'CO' | 'KM' | 'CG' | 'CD' | 'CK' | 'CR' | 'CI' | 'HR' | 'CU' | 'CY' | 'CZ' | 'DK' | 'DJ' | 'DM' | 'DO' | 'EC' | 'EG' | 'SV' | 'GQ' | 'ER' | 'EE' | 'ET' | 'FK' | 'FO' | 'FJ' | 'FI' | 'FR' | 'GF' | 'PF' | 'TF' | 'GA' | 'GM' | 'GE' | 'DE' | 'GH' | 'GI' | 'GR' | 'GL' | 'GD' | 'GP' | 'GU' | 'GT' | 'GN' | 'GW' | 'GY' | 'HT' | 'HM' | 'VA' | 'HN' | 'HK' | 'HU' | 'IS' | 'IN' | 'ID' | 'IR' | 'IQ' | 'IE' | 'IL' | 'IT' | 'JM' | 'JP' | 'JO' | 'KZ' | 'KE' | 'KI' | 'KP' | 'KR' | 'KW' | 'KG' | 'LA' | 'LV' | 'LB' | 'LS' | 'LR' | 'LY' | 'LI' | 'LT' | 'LU' | 'MO' | 'MG' | 'MW' | 'MY' | 'MV' | 'ML' | 'MT' | 'MH' | 'MQ' | 'MR' | 'MU' | 'YT' | 'MX' | 'FM' | 'MD' | 'MC' | 'MN' | 'MS' | 'MA' | 'MZ' | 'MM' | 'NA' | 'NR' | 'NP' | 'NL' | 'NC' | 'NZ' | 'NI' | 'NE' | 'NG' | 'NU' | 'NF' | 'MP' | 'MK' | 'NO' | 'OM' | 'PK' | 'PW' | 'PS' | 'PA' | 'PG' | 'PY' | 'PE' | 'PH' | 'PN' | 'PL' | 'PT' | 'PR' | 'QA' | 'RE' | 'RO' | 'RU' | 'RW' | 'SH' | 'KN' | 'LC' | 'PM' | 'VC' | 'WS' | 'SM' | 'ST' | 'SA' | 'SN' | 'SC' | 'SL' | 'SG' | 'SK' | 'SI' | 'SB' | 'SO' | 'ZA' | 'GS' | 'ES' | 'LK' | 'SD' | 'SR' | 'SJ' | 'SZ' | 'SE' | 'CH' | 'SY' | 'TW' | 'TJ' | 'TZ' | 'TH' | 'TL' | 'TG' | 'TK' | 'TO' | 'TT' | 'TN' | 'TR' | 'TM' | 'TC' | 'TV' | 'UG' | 'UA' | 'AE' | 'GB' | 'US' | 'UM' | 'UY' | 'UZ' | 'VU' | 'VE' | 'VN' | 'VG' | 'VI' | 'WF' | 'EH' | 'YE' | 'ZM' | 'ZW' | 'AX' | 'BQ' | 'CW' | 'GG' | 'IM' | 'JE' | 'ME' | 'BL' | 'MF' | 'RS' | 'SX' | 'SS' | 'XK' — ISO 3166-1 alpha-2 country code of the market.
  - `metadata` object — Any data stored with this data session.
  - `prefill` object — Prefill options for the data session
    - `bankId` string — The preselected bank ID.
  - `disableBankSelection` boolean, required — Whether customers can choose another bank than the pre-selected one.
  - `successCallbackUrl` string, required — The URL where users will be redirected after a successful session.
  - `errorCallbackUrl` string, required — The URL where users will be redirected after an unsuccessful session.

## Changes

- **2025-12-08** `59707ad8c8bb` — 1 breaking
  - added the pattern `^[a-z]{2}-[a-z0-9+/-]{1,}$` to the request property `prefill/bankId`

[Change history](https://skmtc.dev/augustus/apis/ivy-api/changes/api/service/data/session/create/post.md)

---

[API](https://skmtc.dev/augustus/apis/ivy-api.md) · [All operations](https://skmtc.dev/augustus/apis/ivy-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/augustus/ivy-api/revisions/59707ad8c8bb/schema)
