/signing/plaid-lab.
Which Plaid environment is active (sandbox or production) is configured by your workspace administrator. In sandbox mode, use Plaid’s test credentials to complete the flow without a real bank account.
How the Plaid Link flow works
Request a link token
Call The
POST /api/plaid/link-token from your signed-in session. Safeclose returns a short-lived link_token scoped to the current user.link_token expires quickly — pass it to the Plaid Link UI immediately.Initialize Plaid Link
Use the The user selects their institution and authenticates inside the Plaid Link modal. Your app code never handles credentials directly.
link_token to open the Plaid Link UI. In a React app, pass the token to usePlaidLink from the react-plaid-link package:Exchange the public token
After the user completes Plaid Link, Plaid calls your
onSuccess callback with a one-time public_token. Send it to POST /api/plaid/exchange to exchange it for a persistent item reference.| Field | Description |
|---|---|
item_id | Plaid’s stable identifier for the linked bank item. |
institution_id | Plaid’s identifier for the financial institution. |
persisted | true when the connection was saved to your account. |
persist_hint | Non-null message if the connection could not be saved (ask your admin to check encryption key configuration). |
API summary
| Method | Path | Auth | Description |
|---|---|---|---|
POST | /api/plaid/link-token | Session required | Returns a link_token to initialize Plaid Link. |
POST | /api/plaid/exchange | Session required | Exchanges a public_token for a stored item reference. Body: { "public_token": "..." }. |
GET | /api/plaid/status | Session required | Returns whether the current user has a linked Plaid item. |
Plaid webhook events
Plaid sends item update notifications to Safeclose automatically — for example, when new transactions are available or when a linked item needs re-authentication. These events arrive atPOST /api/webhooks/plaid and are processed asynchronously.
Webhook configuration
Learn how Safeclose verifies Plaid webhook events and what your administrator needs to configure.
