POST/connect_token

Create Connect Token

Creates a connect token

To create a connect token its only required to be preauthorized to Pluggy's API with API KEY.

Options#

  • clientUserId : Provide this value for end-to-end traceability of your user's connection, you can send any reference for the user that you want to use, and it will be available for each item created on the Pluggy Connect Widget, that used this connectToken
  • webhookUrl: When providing this value, it works the same way as creating an item with webhookUrl parameter. It will send all item events to that URL, besides the other webhooks configured at the client level.
  • oauthRedirectUri: Url to redirect the user after the connect flow.
  • avoidDuplicates: Avoids creating a new item if there is already one with the same credentials.

Updates#

Aside options object, when updating an item the itemId must be provided to securitize the connection of the widget to that specific Item. A security error will be provided if it's not provided and the update won't be available.



Request Body

Create connect token payload

object

Create a connect token request payload

itemIdstring (uuid)

Item identifier to allow Connect Widget to performan an update on it.

optionsobject

Item options available to send through connect tokens

clientUserIdstring

Client's external identifier for the user, it can be a ID, UUID or even an email. This is free for clients to use.

webhookUrlstring

Url to be notified of this specific item changes

oauthRedirectUristring

Url to redirect the user after the connect flow

avoidDuplicatesboolean

Avoids creating a new item if there is already one with the same credentials

Example

json
{
  "itemId": "5e9f8f8f-f8f8-4f8f-8f8f-8f8f8f8f8f8f",
  "options": {
    "webhookUrl": "https://example.com/webhook",
    "clientUserId": "My App UserId",
    "oauthRedirectUri": "https://pluggy.ai/demo",
    "avoidDuplicates": true
  }
}

Responses

200Created connect token
object

Connect token response

accessTokenrequiredstring

Connect token that's used to initialize Pluggy's Connect widget

Example response

json
{
  "accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRJZCI6IjI3MzY0YjRhLTM1NGUtNDc5ZC04OWJkLTA1Y2VmNDc2ZTFmNCIsImRhdGEiOiI4NmYyMjIwNDVkNjc3NDJjZjI5MjhjMGNmNjBlZjFkZjo5MjRmNGZlNjg5YWM1NGI2ZmVmMzkzZDc2ZTExNjAxZTI1MjliNmUyNDY1Y2I4ZDkxMWI3ZDY0ZjA5Y2NkYzBiMzg4YWFjZWNkZmQzMGMzZGZiNTBkNzk1OTA1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