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

# Create a Bank Link API: Connect or Renew a Bank

> Didit's Create a Bank Link endpoint starts one run of Bank Link on your server and returns the hosted url where the person connects a bank.

Didit's Create a Bank Link endpoint starts one run of Bank Link on your server, to connect a bank or renew a connection, and returns the hosted `url`.
Every field has a default, so the smallest request is `{}` plus what you want.
Keep the returned `id` with your user and confirm the outcome yourself with [Get a bank link](https://docs.didit.me/standalone-apis/bank-link-get.md) or the `bank.link.completed` webhook.
See the [quickstart](https://docs.didit.me/core-technology/bank-verification/quickstart.md) and [Bank Link](https://docs.didit.me/core-technology/bank-verification/bank-link.md).


## OpenAPI

````yaml openapi-25.json POST /v3/bank/links/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: Identity verification API. Authenticate with x-api-key header.
servers:
  - url: https://verification.didit.me
security: []
tags:
  - name: Bank Data
    description: >-
      Bank Link, connections, accounts, balances, transactions, institutions and
      coverage. Bank data is available for sandbox applications. A live
      application's calls answer `404` until live access is announced. Nothing
      is charged in sandbox. A call made with an API key needs a key that
      carries the Bank data permission (`bank-data`): read for reads, write for
      operations that change something. The account check is the exception: it
      needs write access to sessions, or full access, and not the Bank data
      permission. Bank data is not part of full access: a full-access key is
      refused, and the call answers `403 bank_data_access_denied` until you
      create a key that carries the permission. Raw bank data (accounts,
      balances, transactions and the change feed) also refuses a request that
      carries no API key.


      Every refusal under `/v3/bank/` except the account check's has the same
      JSON body (`code`, `message`, `request_id`, `field`, `next_action`,
      `retry_after`). A path that is not an operation, an id that is not a UUID
      or an unknown sub-resource answers `404 not_found` for every method, and
      any unexpected error answers `500 internal_error` with a `request_id`.
      Where Bank data is not available, every operation answers the platform's
      standard `404`, exactly as an unknown route does.
paths:
  /v3/bank/links/:
    post:
      tags:
        - Bank Data
      summary: Create a bank link
      description: >-
        Creates a Bank Link: one run of the flow in which a person connects a
        bank, or renews a connection. Send the person to `url`. The
        `client_token` is for Didit's embedded Bank Link, which is not released
        yet: open the `url` today. A completed link yields a connection.


        The smallest request is `{}` plus what you want. Defaults: `mode`
        connect, `access` one_time, `data` accounts only, `history_days` 90,
        `ownership.compare` none, `segment` any, `duplicates` reuse,
        `allow_one_time_fallback` false, and for ongoing access a consent as
        long as the bank allows.


        The response carries the quote: the price is pinned to the link and
        charged as quoted. The API key never reaches a browser or an app: only
        the `url` does.


        Confirm the outcome yourself with `get_link` or the
        `bank.link.completed` webhook; never trust a link id sent by the
        browser. History: send `history_from` or `history_days`, not both. Where
        the bank allows, ongoing access keeps working until the consent ends;
        the real date is on each connection.


        Needs an API key with the Bank data permission (`bank-data`): write for
        this operation, which changes something. A key with full access does not
        include it: grant it explicitly when you create the key, or the call
        answers `403 bank_data_access_denied`.
      operationId: createBankLink
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BankLinkCreateRequest'
            example:
              mode: connect
              access: ongoing
              country: ESP
              segment: business
              data:
                - accounts
                - balances
                - transactions
              history_from: '2026-01-01'
              consent_days: 180
              ownership:
                compare: none
              end_user:
                reference: client-7731
                email: ana@example.com
              redirect_url: https://app.example.com/bank/return
              allowed_origins:
                - https://app.example.com
              language: es
              vendor_data: client-7731
      responses:
        '201':
          description: The link was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankLink'
              examples:
                Ongoing business connection:
                  summary: Ongoing access for a business account in Spain
                  value:
                    id: 0b9c4f1e-6a2d-4e8b-9f31-7c5d2e1a8b40
                    mode: connect
                    access: ongoing
                    status: created
                    url: https://verify.didit.me/bank/link/example-link-token
                    client_token: example-client-token
                    expires_at: '2026-11-21T13:00:00Z'
                    connection_id: null
                    check_id: null
                    reused: false
                    error: null
                    quote:
                      id: 7a3e9c52-1d84-4b06-8f2a-c5e0b9d17a43
                      lines:
                        - meter: bank_data_connection_month
                          unit: connection_month
                          price_usd: '0.9000'
                      fallback_lines: null
                      total_usd: '0.9000'
                      valid_until: '2026-11-21T13:00:00Z'
                      scopes:
                        - accounts
                        - balances
                        - transactions
                    vendor_data: client-7731
        '400':
          description: >-
            The request was refused before any screen. `field` names what to
            correct: `invalid_request` for a value outside its range or a
            combination that is not allowed, and the more specific codes shown
            here.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankDataError'
              examples:
                Bank cannot keep access open:
                  summary: Bank cannot keep access open
                  value:
                    code: ongoing_access_not_available
                    message: >-
                      This bank cannot keep access open. Use access one_time or
                      choose another bank.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: institution_id
                    next_action: create_link
                    retry_after: null
                History window ambiguous:
                  summary: History window ambiguous
                  value:
                    code: history_window_ambiguous
                    message: Send history_from or history_days, not both.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: history_from
                    next_action: null
                    retry_after: null
                Redirect URL not registered:
                  summary: Redirect URL not registered
                  value:
                    code: redirect_url_not_registered
                    message: >-
                      This redirect_url is not one of the return addresses
                      registered for your application. Addresses are matched
                      exactly (scheme, host, port, path and query); in sandbox a
                      plain http localhost address needs no registration. Send a
                      registered address, or leave redirect_url out (automatic
                      return to your page is then not promised).
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: redirect_url
                    next_action: null
                    retry_after: null
                Segment not available:
                  summary: Segment not available
                  value:
                    code: segment_not_available
                    message: >-
                      This bank does not offer this kind of account through Bank
                      Link.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: segment
                    next_action: null
                    retry_after: null
                Window not available:
                  summary: Window not available
                  value:
                    code: window_not_available
                    message: This bank cannot deliver the requested history window.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: history_from
                    next_action: null
                    retry_after: null
                Invalid request:
                  summary: Invalid request
                  value:
                    code: invalid_request
                    message: The request is not valid.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: expires_in
                    next_action: null
                    retry_after: null
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: The balance cannot cover the quoted price. Top up, then try again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankDataError'
              examples:
                Insufficient credits:
                  summary: Insufficient credits
                  value:
                    code: insufficient_credits
                    message: The balance cannot cover the quoted price.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: null
                    next_action: top_up_balance
                    retry_after: null
        '403':
          description: >-
            Refused: your contract has no rate for this country, or the key
            lacks the Bank data permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankDataError'
              examples:
                No contract rate:
                  summary: No contract rate
                  value:
                    code: contract_rate_missing
                    message: Your contract has no rate for bank data in this country.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: null
                    next_action: null
                    retry_after: null
                Bank data not allowed:
                  summary: Bank data not allowed
                  value:
                    code: bank_data_access_denied
                    message: >-
                      Bank data calls need an API key that carries the Bank data
                      permission.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: null
                    next_action: enable_bank_data_access
                    retry_after: null
        '404':
          description: The resource does not exist in this application and environment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankDataError'
              examples:
                Not found:
                  summary: Not found
                  value:
                    code: not_found
                    message: The resource does not exist.
                    request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
                    field: null
                    next_action: null
                    retry_after: null
        '429':
          $ref: '#/components/responses/RateLimitedWrite'
        '500':
          $ref: '#/components/responses/BankDataInternalError'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X POST 'https://verification.didit.me/v3/bank/links/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{
                "mode": "connect",
                "access": "ongoing",
                "country": "ESP",
                "segment": "business",
                "data": [
                  "accounts",
                  "balances",
                  "transactions"
                ],
                "history_from": "2026-01-01",
                "consent_days": 180,
                "ownership": {
                  "compare": "none"
                },
                "end_user": {
                  "reference": "client-7731",
                  "email": "ana@example.com"
                },
                "redirect_url": "https://app.example.com/bank/return",
                "allowed_origins": [
                  "https://app.example.com"
                ],
                "language": "es",
                "vendor_data": "client-7731"
              }'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.bank.create_link(
                mode="connect",
                access="ongoing",
                country="ESP",
                segment="business",
                data=["accounts", "balances", "transactions"],
                history_from="2026-01-01",
                consent_days=180,
                ownership={
                    "compare": "none",
                },
                end_user={
                    "reference": "client-7731",
                    "email": "ana@example.com",
                },
                redirect_url="https://app.example.com/bank/return",
                allowed_origins=["https://app.example.com"],
                language="es",
                vendor_data="client-7731",
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY.
            const didit = new Didit();

            const result = await didit.bank.createLink({
              mode: "connect",
              access: "ongoing",
              country: "ESP",
              segment: "business",
              data: ["accounts", "balances", "transactions"],
              history_from: "2026-01-01",
              consent_days: 180,
              ownership: {
                compare: "none",
              },
              end_user: {
                reference: "client-7731",
                email: "ana@example.com",
              },
              redirect_url: "https://app.example.com/bank/return",
              allowed_origins: ["https://app.example.com"],
              language: "es",
              vendor_data: "client-7731",
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Bank.CreateLink(ctx, didit.BankCreateLinkParams{\n\tBody: didit.BankLinkCreateRequest{\n\t\tMode:        didit.Some(didit.BankLinkCreateRequestMode(\"connect\")),\n\t\tAccess:      didit.Some(didit.BankLinkCreateRequestAccess(\"ongoing\")),\n\t\tCountry:     didit.String(\"ESP\"),\n\t\tSegment:     didit.Some(didit.BankLinkCreateRequestSegment(\"business\")),\n\t\tData:        didit.Some([]didit.BankLinkCreateRequestData{\"accounts\", \"balances\", \"transactions\"}),\n\t\tHistoryFrom: didit.String(\"2026-01-01\"),\n\t\tConsentDays: didit.Int(180),\n\t\tOwnership: didit.Some(didit.BankLinkOwnershipRequest{\n\t\t\tCompare: didit.Some(didit.BankLinkOwnershipRequestCompare(\"none\")),\n\t\t}),\n\t\tEndUser: didit.Some(didit.BankLinkEndUser{\n\t\t\tReference: didit.String(\"client-7731\"),\n\t\t\tEmail:     didit.String(\"ana@example.com\"),\n\t\t}),\n\t\tRedirectURL:    didit.String(\"https://app.example.com/bank/return\"),\n\t\tAllowedOrigins: didit.Some([]string{\"https://app.example.com\"}),\n\t\tLanguage:       didit.String(\"es\"),\n\t\tVendorData:     didit.String(\"client-7731\"),\n\t},\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.time.LocalDate;

            import java.util.List;

            import me.didit.Didit;

            import me.didit.types.BankLinkCreateRequest;

            import me.didit.types.BankLinkEndUser;

            import me.didit.types.BankLinkOwnershipRequest;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.bank().createLink(BankLinkCreateRequest.builder()
                    .mode(BankLinkCreateRequest.Mode.of("connect"))
                    .access(BankLinkCreateRequest.Access.of("ongoing"))
                    .country("ESP")
                    .segment(BankLinkCreateRequest.Segment.of("business"))
                    .data(List.of(BankLinkCreateRequest.Data.of("accounts"), BankLinkCreateRequest.Data.of("balances"), BankLinkCreateRequest.Data.of("transactions")))
                    .historyFrom(LocalDate.parse("2026-01-01"))
                    .consentDays(180L)
                    .ownership(BankLinkOwnershipRequest.builder()
                            .compare(BankLinkOwnershipRequest.Compare.of("none"))
                            .build())
                    .endUser(BankLinkEndUser.builder()
                            .reference("client-7731")
                            .email("ana@example.com")
                            .build())
                    .redirectUrl("https://app.example.com/bank/return")
                    .allowedOrigins(List.of("https://app.example.com"))
                    .language("es")
                    .vendorData("client-7731")
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;

            // Reads DIDIT_API_KEY.
            $didit = new DiditClient();

            $result = $didit->bank->createLink([
                'mode' => 'connect',
                'access' => 'ongoing',
                'country' => 'ESP',
                'segment' => 'business',
                'data' => ['accounts', 'balances', 'transactions'],
                'history_from' => '2026-01-01',
                'consent_days' => 180,
                'ownership' => [
                    'compare' => 'none',
                ],
                'end_user' => [
                    'reference' => 'client-7731',
                    'email' => 'ana@example.com',
                ],
                'redirect_url' => 'https://app.example.com/bank/return',
                'allowed_origins' => ['https://app.example.com'],
                'language' => 'es',
                'vendor_data' => 'client-7731',
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.bank.create_link(
              mode: "connect",
              access: "ongoing",
              country: "ESP",
              segment: "business",
              data: ["accounts", "balances", "transactions"],
              history_from: "2026-01-01",
              consent_days: 180,
              ownership: {
                compare: "none",
              },
              end_user: {
                reference: "client-7731",
                email: "ana@example.com",
              },
              redirect_url: "https://app.example.com/bank/return",
              allowed_origins: ["https://app.example.com"],
              language: "es",
              vendor_data: "client-7731"
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await client.Bank.CreateLinkAsync(new
            BankLinkCreateRequest

            {
                Mode = new BankLinkCreateRequestMode("connect"),
                Access = new BankLinkCreateRequestAccess("ongoing"),
                Country = "ESP",
                Segment = new BankLinkCreateRequestSegment("business"),
                Data = new BankLinkCreateRequestData[] { "accounts", "balances", "transactions" },
                HistoryFrom = "2026-01-01",
                ConsentDays = 180,
                Ownership = new BankLinkOwnershipRequest
                {
                    Compare = new BankLinkOwnershipRequestCompare("none"),
                },
                EndUser = new BankLinkEndUser
                {
                    Reference = "client-7731",
                    Email = "ana@example.com",
                },
                RedirectUrl = "https://app.example.com/bank/return",
                AllowedOrigins = new string[] { "https://app.example.com" },
                Language = "es",
                VendorData = "client-7731",
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Optional retry-safety key you choose for one operation, up to 255
        characters (a UUID works). A request repeated with the same key,
        endpoint, query and body is answered with the first response, same
        status and same body, and runs and bills nothing a second time. The same
        key with another endpoint, query or body returns `409`
        `idempotency_key_reused`, and while the first request is still running,
        `409` `idempotency_key_in_progress` with `Retry-After`. A failed request
        (any `4xx` or `5xx`) is not stored, so you can send it again with the
        same key. Keys belong to your application, whether you call with an API
        key or an access token. See [Retries and
        idempotency](/integration/api-errors#retries-and-idempotency).
      schema:
        type: string
        minLength: 1
        maxLength: 255
  schemas:
    BankLinkCreateRequest:
      type: object
      description: >-
        Create a Bank Link. The smallest request is `{}` plus what you want:
        every field has a default.
      properties:
        mode:
          type: string
          enum:
            - connect
            - renew
          description: >-
            `connect` (default) creates a new connection. `renew` needs
            `connection_id` and reuses that connection's settings.
          default: connect
        connection_id:
          type: string
          description: 'The connection to renew. Only with `mode: renew`.'
          format: uuid
        access:
          type: string
          enum:
            - one_time
            - ongoing
          description: >-
            `one_time` (default) reads the data once. `ongoing` keeps access
            open until the consent ends or someone stops it. With
            `institution_id` set, a bank that cannot keep access open answers
            `400 ongoing_access_not_available` before any screen. Without it,
            the bank picker lists only banks that can.
          default: one_time
        country:
          type: string
          description: >-
            Optional. Without it the person picks among the countries your
            application enabled. It has to be a country Bank Link serves; any
            other, `ZZZ` included, answers `400 invalid_request` with `field:
            country`. An empty request body stays valid.
          pattern: ^[A-Z]{3}$
        institution_id:
          type: string
          description: >-
            Optional bank to preselect, from `list_institutions`. Skips the
            picker.
          maxLength: 64
        segment:
          type: string
          enum:
            - personal
            - business
            - any
          description: >-
            Filters the picker and tells the bank which login to open where the
            bank separates them. Default `any`.
          default: any
        data:
          type: array
          items:
            type: string
            enum:
              - accounts
              - balances
              - transactions
          description: >-
            What to read. `accounts` is always included: name, type, currency,
            identifiers and the holder name where the bank shares it. Default
            `["accounts"]`.
          default:
            - accounts
          maxItems: 3
        history_days:
          type: integer
          description: >-
            Days of transaction history to request, 1 to 365, default 90. The
            bank may deliver less: each account reports what it delivered in
            `history_coverage`. Cannot be sent with `history_from`.
          minimum: 1
          maximum: 365
          default: 90
        history_from:
          type: string
          description: >-
            Start date of the history to request, instead of `history_days`.
            Cannot be sent with `history_days`: both together answer `400
            history_window_ambiguous`. A date older than 365 days, or in the
            future, answers `400 window_not_available`.
          format: date
        extended_history:
          type: string
          enum:
            - standard
            - allow_extra_auth
          description: >-
            `allow_extra_auth` lets a bank that asks for one more confirmation
            release older history.
          default: standard
        consent_days:
          type: integer
          description: >-
            Ongoing only. How many days to ask the bank to keep access open, 1
            or more. Default: the longest the bank allows. The connection
            reports the date the bank actually granted in `consent.expires_at`.
            With `access: one_time` it answers `400 invalid_request` with
            `field: consent_days`.
          minimum: 1
          maximum: 32767
        ownership:
          $ref: '#/components/schemas/BankLinkOwnershipRequest'
        end_user:
          $ref: '#/components/schemas/BankLinkEndUser'
        redirect_url:
          type: string
          description: >-
            Where the browser goes at the end, with `link_id`, `status` and a
            signed `state` (for display only: the webhook and `get_link` are
            authoritative). In a sandbox application a plain `http` address of
            `localhost`, `127.0.0.1` or `[::1]` (any port and path, no
            credentials, no fragment) needs no registration. Any other address
            answers `400 redirect_url_not_registered`: registering other
            addresses is not available yet. Without a `redirect_url` the person
            finishes on Didit's own result page.
          format: uri
          maxLength: 2048
        allowed_origins:
          type: array
          items:
            type: string
            format: uri
          description: >-
            Accepted and not used today: reserved for Didit's embedded Bank
            Link, which is not released yet. HTTPS origins, up to 50.
          maxItems: 50
        language:
          type: string
          description: >-
            Optional language code such as `es` or `pt-BR`. Otherwise the
            browser language.
          pattern: ^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})?$
          maxLength: 16
        vendor_data:
          type: string
          description: Your own reference, returned on the link and the connection.
          maxLength: 255
        expires_in:
          type: integer
          description: Lifetime of the link in seconds, 300 to 86400. Default 3600.
          minimum: 300
          maximum: 86400
          default: 3600
        duplicates:
          type: string
          enum:
            - reuse
            - allow
          description: >-
            `reuse` (default) completes a link that resolves to accounts you
            already share as a renewal of that connection. `allow` creates an
            independent second connection.
          default: reuse
        allow_one_time_fallback:
          type: boolean
          description: >-
            With `ongoing`, lets the person continue with a one-time read at a
            bank that cannot keep access open, after confirming the reduced
            access on its own screen. The quote shows what that costs. Only with
            `access: ongoing`: with one-time access it answers `400
            invalid_request` with `field: allow_one_time_fallback`.
          default: false
        accept_reduced_grant:
          type: boolean
          description: >-
            When the bank or the person grants less than you asked for, complete
            the link and charge only the granted scopes. Otherwise the link ends
            `failed` with `reduced_grant` and nothing is charged.
          default: false
        sandbox:
          type: object
          description: >-
            Sandbox applications only: picks the Didit Test Bank customer.
            Ignored in a live application.
          properties:
            persona:
              type: string
              enum:
                - personal_basic
                - business_multi
                - long_history
                - pending
                - sparse_fields
                - no_ongoing
              description: >-
                The Test Bank customer: `personal_basic` (one current account,
                60 movements), `business_multi` (three accounts held by a
                company), `long_history` (one account with 400 days and 1,400
                movements; a read returns the last 365 days, so set
                `history_days` to 365), `pending` (includes pending
                transactions), `sparse_fields` (no value date, no counterparty
                IBAN, no bank reference) or `no_ongoing` (a bank that only
                allows one-time access: use `allow_one_time_fallback`).
            switches:
              type: array
              items:
                type: string
                enum:
                  - partial_grant
                  - renewal_other_login
                  - expired_cursor
                  - webhook_twice
                  - midnight_booking
                  - blocked_popup
                  - bank_app_return
              description: >-
                Accepted and reserved for the sandbox simulator: the values
                change nothing today.
    BankLink:
      type: object
      description: >-
        One run of Bank Link for one person: connect a bank, or renew a
        connection. Confirm a link yourself with `get_link`: never trust an id
        sent by the browser.
      properties:
        id:
          type: string
          description: Identifier of the link.
          format: uuid
        mode:
          type: string
          enum:
            - connect
            - renew
        access:
          type: string
          enum:
            - one_time
            - ongoing
        status:
          type: string
          enum:
            - created
            - opened
            - connecting
            - completed
            - cancelled
            - expired
            - failed
          description: >-
            State of the link. `completed`, `cancelled`, `expired` and `failed`
            are final.
        url:
          type: string
          description: >-
            The hosted page to send the person to. Returned only when the link
            is created; `null` on later reads, because the token is not stored.
          nullable: true
          format: uri
        client_token:
          type: string
          description: >-
            The token for Didit's embedded Bank Link, which is not released yet:
            open `url` today. Returned only when the link is created; `null` on
            later reads. Single purpose and short lived. It carries no personal
            data. Never log it.
          nullable: true
        expires_at:
          type: string
          description: When an unredeemed link stops working.
          format: date-time
        connection_id:
          type: string
          description: >-
            The connection this link created or renewed, once `status` is
            `completed`.
          format: uuid
          nullable: true
        check_id:
          type: string
          description: >-
            The ownership result of this link, when it asked for
            `ownership.compare` other than `none`.
          format: uuid
          nullable: true
        reused:
          type: boolean
          description: >-
            `true` when the link completed as a renewal of an existing
            connection because the person already shares exactly these accounts
            (`duplicates: reuse`). Nothing is charged twice.
        error:
          allOf:
            - $ref: '#/components/schemas/BankLinkError'
          nullable: true
          description: Why the link failed, when `status` is `failed`. Otherwise `null`.
        quote:
          $ref: '#/components/schemas/BankLinkQuote'
        vendor_data:
          type: string
          description: Your reference from the request.
          nullable: true
      required:
        - id
        - mode
        - access
        - status
        - url
        - client_token
        - expires_at
        - connection_id
        - check_id
        - reused
        - error
        - quote
        - vendor_data
    BankDataError:
      type: object
      description: Error body of every Bank data operation. Every field is always present.
      properties:
        code:
          type: string
          enum:
            - ongoing_access_not_available
            - segment_not_available
            - window_not_available
            - history_window_ambiguous
            - redirect_url_not_registered
            - link_origin_not_allowed
            - bank_data_access_denied
            - connection_not_active
            - consent_expired
            - renewal_not_needed
            - renewal_window_expired
            - access_removed
            - refresh_limit_reached
            - cursor_expired
            - page_expired
            - invalid_cursor
            - page_token_mismatch
            - contract_rate_missing
            - insufficient_credits
            - invalid_request
            - not_found
            - internal_error
          description: Machine-readable error code. Branch on this, never on `message`.
        message:
          type: string
          description: >-
            Plain-language explanation for a developer. The wording can change;
            do not parse it.
        request_id:
          type: string
          description: Identifier of this request. Quote it when you contact support.
        field:
          type: string
          description: >-
            The request field to correct, when the error is about one field.
            Otherwise `null`.
          nullable: true
        next_action:
          type: string
          enum:
            - retry_later
            - renew_connection
            - create_link
            - restart_from_cursor
            - restart_read
            - top_up_balance
            - enable_bank_data_access
            - contact_support
            - null
          description: >-
            What to do next, so a client can act without guessing. `null` when
            there is no standard next step.
          nullable: true
        retry_after:
          type: integer
          description: >-
            Seconds to wait before retrying. Set on rate-limit and temporary
            errors, otherwise `null`.
          nullable: true
      required:
        - code
        - message
        - request_id
        - field
        - next_action
        - retry_after
      example:
        code: ongoing_access_not_available
        message: >-
          This bank cannot keep access open. Use access one_time or choose
          another bank.
        request_id: 3f6a1c8e-92b5-4d07-a1e3-8c4b7f0d2e59
        field: institution_id
        next_action: create_link
        retry_after: null
    BankLinkOwnershipRequest:
      type: object
      description: Optional comparison of the account holder with a person or a company.
      properties:
        compare:
          type: string
          enum:
            - none
            - person
            - business
          description: >-
            What the holder of the account is compared with. `none` (default)
            gives no verdict and needs no reference. `person` needs
            `reference_identity` or `session_id`. `business` needs `business` or
            `business_session_id`. Send exactly one reference of the kind you
            compare with, and none with `none`.
          default: none
        match:
          type: string
          enum:
            - any_holder
            - all_holders
          description: >-
            Whether one legal holder or every legal holder must match.
            Representatives never count.
          default: any_holder
        reference_identity:
          type: object
          description: >-
            Caller-supplied values to compare with the account holder. Cannot be
            sent with `session_id`.
          properties:
            full_name:
              type: string
              maxLength: 255
            date_of_birth:
              type: string
              format: date
            address:
              type: string
              maxLength: 500
            phone:
              type: string
              maxLength: 64
            email:
              type: string
              maxLength: 255
        session_id:
          type: string
          description: >-
            A completed Didit verification session of the person to compare
            with. Cannot be sent with `reference_identity`.
          format: uuid
        business:
          type: object
          description: The company to compare with the account holder.
          properties:
            legal_name:
              type: string
              maxLength: 255
            registration_id:
              type: string
              maxLength: 128
          required:
            - legal_name
        business_session_id:
          type: string
          description: >-
            A Didit business verification to compare with. Cannot be sent with
            `business`.
          format: uuid
    BankLinkEndUser:
      type: object
      description: The person or company that connects the account.
      properties:
        reference:
          type: string
          description: >-
            Your own id for the person or company. Searchable with
            `end_user_reference`, and used to recognise a repeat connection.
          maxLength: 255
        email:
          type: string
          description: >-
            Optional. Where the bank route needs a verified address for the
            person and you did not send one, Bank Link asks the person for it.
            Never used for marketing.
          format: email
          maxLength: 254
    BankLinkError:
      type: object
      description: The reason a link ended `failed`. Nothing was published or charged.
      properties:
        code:
          type: string
          enum:
            - duplicate_conflict
            - renewal_login_mismatch
            - reduced_grant
            - corporate_approval_not_supported
            - ongoing_access_not_available
            - bank_unavailable
            - bank_cancelled
            - consent_declined
            - read_limit
            - renewal_not_needed
            - renewal_window_expired
            - first_sync_failed
          description: >-
            Why the link failed. A failed link is not an HTTP error: the link
            reads with `status: failed` and this object. A renew link whose
            connection changed meanwhile reads `renewal_not_needed` or
            `renewal_window_expired`.
        message:
          type: string
          description: Plain-language explanation for a developer.
        conflicts_with:
          type: array
          nullable: true
          items:
            type: string
            format: uuid
          description: >-
            With `duplicate_conflict`: the ids of the active connections that
            overlap. Renew one of them, or create the link again with
            `duplicates: allow`.
      required:
        - code
        - message
        - conflicts_with
    BankLinkQuote:
      type: object
      description: >-
        The price of a link, pinned when it is created. The price charged is the
        quote's. Reads never bill.
      properties:
        id:
          type: string
          description: Identifier of the quote.
          format: uuid
        lines:
          type: array
          items:
            $ref: '#/components/schemas/BankLinkQuoteLine'
          description: The lines this link charges, for the scopes it asks for.
        fallback_lines:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/BankLinkQuoteLine'
          description: >-
            What a one-time fallback would charge, only when the link was
            created with `allow_one_time_fallback`. It is shown on the create
            response and is `null` otherwise. A one-time read with data can cost
            more than a first month of ongoing access.
        total_usd:
          type: string
          description: >-
            Total of `lines` in USD. The total can only go down: with a reduced
            grant, or when the person picks a country with a lower price.
          pattern: ^-?\d+(\.\d+)?$
        valid_until:
          type: string
          description: >-
            The quote is pinned to the link and valid for the link's whole
            lifetime, so it equals `expires_at`.
          format: date-time
        scopes:
          type: array
          items:
            type: string
            enum:
              - accounts
              - balances
              - transactions
          description: The data scopes the quote prices.
      required:
        - id
        - lines
        - fallback_lines
        - total_usd
        - valid_until
        - scopes
    RateLimitBudgetError:
      type: object
      description: >-
        Returned only for a rate-limit middleware budget refusal. Other 429
        errors, including idempotency conflicts and endpoint-specific caps, do
        not promise these metadata fields.
      required:
        - detail
        - reference
        - limit
        - remaining
        - reset
        - window_seconds
      properties:
        detail:
          type: string
          description: Existing human-readable budget refusal message.
        reference:
          type: string
          pattern: ^RL-[0-9a-f]{32}$
          description: >-
            Opaque support reference: RL- followed by 32 lowercase UUID
            hexadecimal characters.
        limit:
          type: integer
          description: Budget for the exceeded scope; equals X-RateLimit-Limit.
        remaining:
          type: integer
          minimum: 0
          description: Remaining budget, clamped to zero; equals X-RateLimit-Remaining.
        reset:
          type: integer
          format: int64
          description: Window reset time in Unix seconds; equals X-RateLimit-Reset.
        window_seconds:
          type: integer
          description: >-
            Fixed-window duration in seconds, not the remaining wait. Honor
            Retry-After before retrying.
      example:
        detail: >-
          Write request rate limit exceeded. You can make up to 300 requests per
          minute.
        reference: RL-00000000000040008000000000000001
        limit: 300
        remaining: 0
        reset: 1794358860
        window_seconds: 60
    BankLinkQuoteLine:
      type: object
      description: One priced line of a quote.
      properties:
        meter:
          type: string
          description: >-
            What is charged, for example `bank_data_connection_month`,
            `bank_verification`.
          example: bank_data_connection_month
        unit:
          type: string
          description: >-
            What one unit is, for example `connection_month` or
            `completed_sign_in`.
          example: connection_month
        price_usd:
          type: string
          description: >-
            Price of one unit in USD, a decimal string with 4 decimals. Amounts
            in examples are illustrative; the price for a country is shown on
            the pricing page.
          pattern: ^-?\d+(\.\d+)?$
          example: '0.9000'
      required:
        - meter
        - unit
        - price_usd
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          examples:
            Invalid API Key:
              summary: Invalid API Key
              value:
                detail: Invalid API Key.
    RateLimitedWrite:
      description: >-
        The shared write limit of 300 requests per minute per API key was
        exceeded. Honor `Retry-After` before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitBudgetError'
          example:
            detail: >-
              Write request rate limit exceeded. You can make up to 300 requests
              per minute.
            reference: RL-00000000000040008000000000000001
            limit: 300
            remaining: 0
            reset: 1794358860
            window_seconds: 60
      headers:
        Retry-After:
          $ref: '#/components/headers/BudgetRetryAfter'
        X-RateLimit-Scope:
          $ref: '#/components/headers/BudgetXRateLimitScope'
        X-RateLimit-Limit:
          $ref: '#/components/headers/BudgetXRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/BudgetXRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/BudgetXRateLimitReset'
    BankDataInternalError:
      description: >-
        Something went wrong on Didit's side. Any unexpected error under
        `/v3/bank/` answers in the Bank error shape, never an HTML page: quote
        `request_id` to support.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BankDataError'
          examples:
            Internal error:
              summary: An unexpected error
              value:
                code: internal_error
                message: >-
                  Something went wrong on our side. Quote the request_id to
                  support.
                request_id: 3f6a1c8e92b54d07a1e38c4b7f0d2e59
                field: null
                next_action: contact_support
                retry_after: null
  headers:
    BudgetRetryAfter:
      description: >-
        Seconds to wait, rounded up to the next window. Present on middleware
        budget refusals.
      schema:
        type: integer
    BudgetXRateLimitScope:
      description: >-
        The scope whose budget was exceeded. Present on middleware budget
        refusals.
      schema:
        type: string
    BudgetXRateLimitLimit:
      description: >-
        Budget for the exceeded scope; equals body limit. Present on middleware
        budget refusals.
      schema:
        type: integer
    BudgetXRateLimitRemaining:
      description: >-
        Remaining budget, clamped to zero; equals body remaining. Present on
        middleware budget refusals.
      schema:
        type: integer
    BudgetXRateLimitReset:
      description: >-
        Reset time in Unix seconds; equals body reset. Present on middleware
        budget refusals.
      schema:
        type: integer
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your application's API key, from Developers -> API keys in the Business
        Console. The primary key has full access. A named key can be scoped:
        none, read or write per resource, limited to some workflows or to
        approved sessions, to a list of IP addresses, and to an expiry date. 401
        means the key is wrong, revoked or expired; 403 means no key was sent,
        the key has no access to this resource or action, or the request came
        from an address outside its IP list; 404 on a session route means the
        session is outside the key's workflows or statuses. A key without media
        access receives image, video and PDF URLs as null, and a key without
        sessions write receives session links and tokens as null. See
        https://docs.didit.me/console/api-keys.

````

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