# Finish a company bank link

Exchanges the public token returned by the bank login and stores the company bank connection. The bank access token never reaches the client.

Access class: `workspace:admin`.

## Endpoint

`POST /v1/accounting/plaid-connections/exchange`

## Request body

Content type: `application/json`.

```json
{
  "institutionId": "",
  "institutionName": "string",
  "publicToken": "string"
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "accounts": [
      {
        "availableBalanceMinor": "string",
        "currency": "string",
        "currentBalanceMinor": "string",
        "id": "",
        "mask": "string",
        "name": "string",
        "officialName": "string",
        "plaidAccountId": "",
        "subtype": "string",
        "type": "string"
      }
    ],
    "consentedAt": "2026-01-01T00:00:00Z",
    "consentedByEmail": "string",
    "consentedByKind": "string",
    "consentedByUserId": 1,
    "consentedIp": "string",
    "createdAt": "2026-01-01T00:00:00Z",
    "dealId": "",
    "dealName": "string",
    "environment": "string",
    "id": "",
    "institutionId": "",
    "institutionName": "string",
    "lastError": "string",
    "lastSyncedAt": "2026-01-01T00:00:00Z",
    "plaidItemId": "",
    "status": "string",
    "syncPending": true
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
