Every request carries one credential in the X-API-KEY header. There are two kinds, issued by two endpoints, and the difference between them is scope.
| Credential | Issued by | Lives | Reaches |
|---|---|---|---|
| API Key | POST /authAPI | 2 hours | Every endpoint. Server-side only. |
| Connect Token | POST /connect_tokenAPI | 30 minutes | The Item it was issued for and a reduced view of its Accounts. Safe to hand to a client. |
API Key#
Response 200:
clientId and clientSecret come from the Dashboard. They identify your application, so POST /auth belongs on your server and nowhere else. New secrets start with pluggy_sk_ (56 characters); secrets issued before that format have no prefix and keep working. A 401 with codeDescription CLIENT_KEYS_UNAUTHORIZED means the pair is wrong; CLIENT_SECRET_EXPIRED means the pair is right but the secret has expired; CLIENT_DISABLED means the application is switched off. A 403 with CLIENT_IP_NOT_ALLOWED means the application has an IP allowlist and the request came from an IP that is not on it.
A client secret is valid for 180 days from when it is generated. Secrets generated before November 24, 2026 expire on November 24, 2027 at 00:00 UTC. The Dashboard shows each secret's expiry date; generate a new one before then — see Client secret expiration. API Keys already issued keep working until their own expiry.
The key expires 2 hours after it is issued. Reuse it until then — POST /auth has its own rate limitAPI, and requesting a key per call is the usual way to hit it.
Connect Token#
Response 200:
Everything in the body is optional. itemId scopes the token to an existing Item, for an update. options are applied to every Item created with the token:
| Option | Effect |
|---|---|
clientUserId | Your identifier for the end user, stored on the Item and echoed in every item/* webhook. |
webhookUrl | Where the events of those Items are delivered. |
oauthRedirectUri | Where the user lands after an OAuth connect flow. |
avoidDuplicates | Do not create a second Item for credentials that already have one. |
Options go inside options
The only keys read at the root of the body are itemId and options. A clientUserId sent at the root is discarded — the call still returns 200, and the Items end up with clientUserId: null. Backfill an affected Item with PATCH /items/{id}API.
The token expires 30 minutes after it is issued. Issue one per connection: a new one each time you create or update an Item.
Scope#
A Connect Token is sent exactly like an API Key, in X-API-KEY. It can call GET /items/{id}API for its own Item and GET /accounts?itemId=API with a reduced view of the data; anything else returns 403. A token issued for one Item cannot read another, including Items created earlier with a different token.
The flow, end to end#
- Your server calls
POST /authwithclientIdandclientSecretand keeps the API Key. - Your server calls
POST /connect_tokenwith that key and hands theaccessTokento your client. - Your client — the Connect Widget or your own UI — creates or updates the Item with the token.
- Your server reads the Item's data with the API Key.
Read the guide: Authentication.
