---
title: "Exchange a Plaid public token"
method: POST
path: "/plaid/exchange"
tags: ["Bank Feeds"]
---

# Exchange a Plaid public token

`POST /plaid/exchange`

## Request

- Base URL: `https://ledgerhq.pro/api/v1`
- URL: `https://ledgerhq.pro/api/v1/plaid/exchange`
- Auth: one of:
  - HTTP bearer and API key in header `x-organization-id`
  - HTTP bearer and API key in header `x-organization-id`

Completes a Plaid Link connect: exchanges the public token, stores the encrypted access token, and inventories the connected accounts. Returns 409 when the account already exists or the institution is already connected without an explicit different-login choice.

## Request body

- object
  - `publicToken` string, required
  - `attemptId` string, uuid: Attempt id returned with the Link token.
  - `linkEvidence` PlaidLinkCallbackEvidence, nullable
    - `linkSessionId` string, nullable
    - `requestId` string, nullable
    - `institution` object, nullable
      - `institutionId` string, nullable
      - `name` string, nullable
    - `accounts` object[]
      - `providerAccountId` string, nullable
      - `name` string, nullable
      - `mask` string, nullable
      - `type` string, nullable
      - `subtype` string, nullable
  - `institution` object, nullable
    - `institutionId` string, nullable
    - `name` string, nullable
  - `allowSeparateInstitutionLogin` boolean: Set only after the user explicitly chooses a different login for an institution already connected.

## Response `201`

Connection created

- object
  - `itemId` string, uuid
  - `institutionName` string, nullable
  - `accounts` PlaidConnectedAccount[]
    - `id` string, uuid
    - `providerAccountId` string
    - `name` string, nullable
    - `officialName` string, nullable
    - `type` string, nullable
    - `subtype` string, nullable
    - `mask` string, nullable
    - `currentBalance` integer, nullable
    - `availableBalance` integer, nullable
    - `importEnabled` boolean
    - `bankAccountId` string, uuid, nullable
    - `mappedAt` string, date-time, nullable
    - `syncError` string, nullable
    - `lastSyncedAt` string, date-time, nullable

## Other responses

- `default`: Error response

---

[API](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api.md) · [All operations](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ledgerhq-pro/apis/ledgerhq-bookkeeping-api/revisions/9a8269f0a586?raw)
