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

# Create re-authentication exchange session

> Creates a re-authentication exchange session to refresh a user's bank account connection when their existing authorization is no longer valid. Required when receiving an UpdateCredentials error during bank balance checks or when user re-authentication is needed.



## OpenAPI

````yaml post /exchanges/{id}/exchange-sessions
openapi: 3.1.0
info:
  title: Dwolla API
  description: Dwolla API Documentation
  contact:
    name: Dwolla Developer Relations Team
    url: https://developers.dwolla.com
    email: api@dwolla.com
  version: '2.0'
  termsOfService: https://www.dwolla.com/legal/tos/
  license:
    name: MIT
    url: https://github.com/Dwolla/dwolla-openapi/blob/master/LICENSE
servers:
  - url: https://api.dwolla.com
    description: Production server
  - url: https://api-sandbox.dwolla.com
    description: Sandbox server
security:
  - clientCredentials: []
tags:
  - name: tokens
    description: Operations related to Application Access Tokens
  - name: root
    description: Root API operations
  - name: accounts
    description: Operations related to Accounts
  - name: customers
    description: Operations related to Customers
  - name: kba
    description: Operations related to Knowledge-Based Authentication
  - name: beneficial owners
    description: Operations related to Beneficial Owners
  - name: documents
    description: Operations related to Documents
  - name: exchanges
    description: Operations related to Exchanges
  - name: exchange sessions
    description: Operations related to Exchange Sessions
  - name: funding sources
    description: Operations related to Funding Sources
  - name: transfers
    description: Operations related to Transfers
  - name: labels
    description: Operations related to Labels
  - name: mass payments
    description: Operations related to Mass Payments
  - name: events
    description: Operations related to Events
  - name: webhook subscriptions
    description: Operations related to Webhook Subscriptions
  - name: webhooks
    description: Operations related to Webhooks
  - name: client tokens
    description: Operations related to Client Tokens
  - name: sandbox simulations
    description: Sandbox-only operations for simulating processing of bank transfers
paths:
  /exchanges/{id}/exchange-sessions:
    post:
      tags:
        - exchange sessions
      summary: Create re-authentication exchange session
      description: >-
        Creates a re-authentication exchange session to refresh a user's bank
        account connection when their existing authorization is no longer valid.
        Required when receiving an UpdateCredentials error during bank balance
        checks or when user re-authentication is needed.
      operationId: createReAuthExchangeSession
      parameters:
        - name: id
          in: path
          description: Exchange's unique identifier
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/Accept'
      requestBody:
        required: false
        description: |
          Request body containing the redirect URL.
          Required for:
          - Plaid mobile sessions
          Not required for:
          - Plaid web sessions
        content:
          application/vnd.dwolla.v1.hal+json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/CreateReAuthExchangeSessionForWeb'
                - $ref: '#/components/schemas/CreateReAuthExchangeSessionWithRedirect'
      responses:
        '201':
          description: created
          headers:
            Location:
              $ref: '#/components/headers/Location'
        '400':
          description: validation error
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: ValidationError
                  message:
                    type: string
                    example: Invalid request parameters
        '403':
          description: forbidden
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: forbidden
                  message:
                    type: string
                    example: >-
                      Not authorized to create re-authentication exchange
                      session.
      x-codeSamples:
        - lang: bash
          source: >
            POST
            https://api.dwolla.com/exchanges/74a207b2-b7b7-4efa-8bf8-582148e7b980/exchange-sessions

            Accept: application/vnd.dwolla.v1.hal+json

            Content-Type: application/vnd.dwolla.v1.hal+json

            Authorization: Bearer
            pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY


            {
                "_links": {
                    "redirect-url": {
                        "href": "https://www.yourdomain.com/iav-callback"
                    }
                }
            }
        - lang: javascript
          source: |
            // Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node
            var exchangeUrl =
              "https://api.dwolla.com/exchanges/74a207b2-b7b7-4efa-8bf8-582148e7b980";
            var requestBody = {
              _links: {
                "redirect-url": {
                  href: "https://www.yourdomain.com/iav-callback",
                },
              },
            };

            dwolla
              .post(`${exchangeUrl}/exchange-sessions`, requestBody)
              .then((res) => res.headers.get("location")); // => 'https://api.dwolla.com/exchange-sessions/fcd15e5f-8d13-4570-a9b7-7fb49e55941d'
        - lang: python
          source: >
            # Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python

            exchange_url =
            'https://api.dwolla.com/exchanges/74a207b2-b7b7-4efa-8bf8-582148e7b980'

            request_body = {
              '_links': {
                'redirect-url': {
                  'href': 'https://www.yourdomain.com/iav-callback'
                }
              }
            }


            reauthExchange = app_token.post('%s/exchange-sessions' %
            exchange_url, request_body)

            reauthExchange.headers['location'] # =>
            'https://api.dwolla.com/exchange-sessions/fcd15e5f-8d13-4570-a9b7-7fb49e55941d'
        - lang: php
          source: |
            /**
             * No example for this language yet.
             **/
        - lang: ruby
          source: >
            # Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby

            exchange_url =
            'https://api.dwolla.com/exchanges/74a207b2-b7b7-4efa-8bf8-582148e7b980'

            request_body = {
              _links: {
                'redirect-url': {
                  href: "https://www.yourdomain.com/iav-callback"
                }
              }
            }


            reauthExchange = app_token.post "#{exchange_url}/exchange-sessions",
            request_body

            reauthExchange.response_headers[:location] # =>
            "https://api.dwolla.com/exchange-sessions/fcd15e5f-8d13-4570-a9b7-7fb49e55941d"
components:
  parameters:
    Accept:
      name: Accept
      in: header
      required: true
      description: >-
        The media type of the response. Must be
        application/vnd.dwolla.v1.hal+json
      schema:
        type: string
        enum:
          - application/vnd.dwolla.v1.hal+json
        default: application/vnd.dwolla.v1.hal+json
  schemas:
    CreateReAuthExchangeSessionForWeb:
      title: CreateReAuthExchangeSessionForWeb
      description: >-
        Create re-auth exchange session for web (Plaid web sessions where
        request body is optional)
      type: object
      properties: {}
    CreateReAuthExchangeSessionWithRedirect:
      title: CreateReAuthExchangeSessionWithRedirect
      description: >-
        Create re-auth exchange session with redirect URL (required for mobile
        sessions with Plaid)
      type: object
      required:
        - _links
      properties:
        _links:
          type: object
          required:
            - redirect-url
          properties:
            redirect-url:
              type: object
              required:
                - href
              properties:
                href:
                  type: string
                  format: uri
                  description: |
                    Required for Plaid mobile sessions.
                    For Android: use app URI scheme (e.g., com.example.app123)
                    For iOS: use HTTPS URL (e.g., https://example.com/app123)
                  example: https://example.com/app123
  headers:
    Location:
      description: The location of the created resource
      schema:
        type: string
  securitySchemes:
    clientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /token
          x-speakeasy-token-endpoint-authentication: client_secret_basic
          scopes: {}

````