---
title: "Exchange token (GoCardLess)"
method: POST
path: "/auth/gocardless/exchange"
---

# Exchange token (GoCardLess)

`POST /auth/gocardless/exchange`

## Request body

- GoCardLessExchangeBodySchema
  - `institutionId` string, required
  - `transactionTotalDays` number, required

## Response `200`

Retrieve Exchange

- GoCardLessExchangeSchema
  - `data` object, required
    - `id` string, required
    - `access_valid_for_days` number, required
    - `max_historical_days` number, required
    - `institution_id` string, required

## Other responses

- `400` — Returns an error

## Changes

- **2024-07-24** `7a388bdc5a89` — 2 breaking, 2 warning
  - added the new required request property `institutionId`
  - added the new required request property `transactionTotalDays`
  - removed the request property `institution_id`
  - removed the request property `transaction_total_days`
- **2024-07-23** `1515e7c2644a` — 1 breaking, 1 warning
  - the `code` response's property type/format changed from `number`/`` to `string`/`` for status `400`
  - removed the optional property `details` from the response with the `400` status
- **2024-07-23** `85b4f43c2bb3` — 2 info
  - added the optional property `details` to the response with the `400` status
  - added the required property `requestId` to the response with the `400` status
- **2024-07-05** `b620765f2663` — 6 breaking, 2 warning, 1 info
  - added the new required request property `institution_id`
  - added the new required request property `transaction_total_days`
  - removed the required property `access_valid_for_days` from the response with the `200` status
  - removed the required property `id` from the response with the `200` status
  - …5 more
- **2024-06-19** `4b6f2f46a13d` — 4 breaking, 1 warning, 5 info
  - added the new required request property `institutionId`
  - added the new required request property `transactionTotalDays`
  - the request's body type/format changed from ``/`` to `object`/``
  - the response's body type/format changed from ``/`` to `object`/`` for status `200`
  - …6 more

[Change history](https://skmtc.dev/midday-ai/apis/midday-engine-api/changes/auth/gocardless/exchange/post.md)

---

[API](https://skmtc.dev/midday-ai/apis/midday-engine-api.md) · [All operations](https://skmtc.dev/midday-ai/apis/midday-engine-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/midday-ai/midday-engine-api/revisions/bf3c1ab4d60d/schema)
