## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://developers.dwolla.com/llms.txt)

Use this file to discover all available pages before exploring further.

POST

https://api.dwolla.comhttps://api-sandbox.dwolla.com

/exchanges

/{id}

/exchange-sessions

### cURL

```bash
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"
        }
    }
}
```

### Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node
```javascript
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'
```

### Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
```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'
```

### Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby
```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"
```

### Error Responses

#### 400
```json
{
  "code": "ValidationError",
  "message": "Invalid request parameters"
}
```

#### 403
```json
{
  "code": "forbidden",
  "message": "Not authorized to create re-authentication exchange session."
}
```

#### Authorizations

- **Authorization**: string, header, required
  - The access token received from the authorization server in the OAuth 2.0 flow.

#### Headers

- **Accept**: enum<string>, default: application/vnd.dwolla.v1.hal+json, required
  - The media type of the response. Must be application/vnd.dwolla.v1.hal+json

Available options:

`application/vnd.dwolla.v1.hal+json`

#### Path Parameters

- **id**: string, required
  - Exchange's unique identifier

#### Body

- `application/vnd.dwolla.v1.hal+json`
  - Request body containing the redirect URL.
  - Required for:
    - Plaid mobile sessions
  - Not required for:
    - Plaid web sessions
    - CreateReAuthExchangeSessionForWeb
    - CreateReAuthExchangeSessionWithRedirect

#### Response

- **201** created.
