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

# Crear link bancario

> Crea un link con credenciales del usuario y dispara el primer sync en background. Requiere secret key (rail_sk_*). Para flujo white-label sin pasar credenciales por tu servidor, usar `/v1/widget_tokens` en su lugar.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/links
openapi: 3.1.0
info:
  title: Rail API
  description: >-
    Agregador bancario chileno read-only (Santander, Banco de Chile, BCI,
    BancoEstado, Banco Falabella, BICE, Itaú). API REST para integrar lectura de
    cuentas y movimientos en aplicaciones B2B.
  version: 1.0.0
  contact:
    name: Rail Soporte
    url: https://docs.rail.cl
    email: soporte@rail.cl
  license:
    name: Propietaria
servers:
  - url: https://api.rail.cl
    description: Production
  - url: http://localhost:3100
    description: Local dev
security:
  - ApiKeyAuth: []
tags:
  - name: Links
    description: Conexiones de usuarios a bancos (crear, listar, eliminar).
  - name: Accounts
    description: Cuentas sincronizadas desde el banco (saldos, productos).
  - name: Movements
    description: Movimientos / transacciones por cuenta con paginación.
  - name: Refresh Intents
    description: Sync on-demand con backoff y MFA async.
  - name: Widget
    description: Tokens efímeros (widget_token, exchange_token) para flujo white-label.
  - name: Webhooks
    description: Eventos asíncronos con HMAC y reintentos exponenciales.
  - name: Events
    description: Audit log inmutable de eventos.
  - name: API Keys
    description: Emisión y rotación de claves sk_/pk_ test/live.
  - name: Admin
    description: Operaciones internas (pause global, audit). Solo admins.
  - name: Dashboard
    description: Endpoints consumidos por dashboard.rail.cl (JWT-only).
  - name: Health
    description: Liveness probe (sin auth).
paths:
  /v1/links:
    post:
      tags:
        - Links
      summary: Crear link bancario
      description: >-
        Crea un link con credenciales del usuario y dispara el primer sync en
        background. Requiere secret key (rail_sk_*). Para flujo white-label sin
        pasar credenciales por tu servidor, usar `/v1/widget_tokens` en su
        lugar.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                bank_id:
                  type: string
                  enum:
                    - santander
                    - banco_chile
                    - banco_estado
                    - banco_falabella
                    - bci
                    - itau
                    - scotia
                    - bice
                    - cencosud
                    - mercado_pago
                    - liderbci
                credentials:
                  type: object
                  properties:
                    rut:
                      type: string
                    password:
                      type: string
                      default: ''
                    rut_empresa:
                      type: string
                  required:
                    - rut
                  additionalProperties: false
                external_user_id:
                  type: string
                  minLength: 1
                holder_type:
                  type: string
                  enum:
                    - individual
                    - business
                consent_version:
                  type: string
                consent_text_hash:
                  type: string
              required:
                - bank_id
                - credentials
              additionalProperties: false
      responses:
        '200':
          description: Default Response
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: rail_sk_live_* | rail_sk_test_* | rail_pk_*
      description: >-
        API key emitida desde el dashboard. Servidor-a-servidor con sk_,
        browser-to-server con pk_. El prefijo identifica modo (test/live).

````