Plaid Link Token API.
Link tokens are the entry point to every Plaid integration. They authorize a specific Link session with configured products, user identity, and customization.
Link token lifecycle
- Your server calls
create_token/2— server-side only, never client-side - Pass the
link_tokento the Plaid Link SDK (iOS, Android, Web) - User completes Link, your frontend receives a
public_token - Your server calls
PlaidEx.API.Items.exchange_public_token/3 - Store the returned
access_token— this is the permanent credential
Link tokens expire after 4 hours. Do not persist them.
Summary
Functions
Creates a Link token.
Retrieves metadata about an existing link token.
Lists all Link sessions for debugging (sandbox only).
Functions
@spec create_token(PlaidEx.Config.t(), keyword() | map(), keyword()) :: {:ok, PlaidEx.Schemas.LinkToken.t()} | {:error, PlaidEx.Error.t()}
Creates a Link token.
Required params
user: %{client_user_id: "your-user-id"},
client_name: "Your App Name",
products: ["transactions"],
country_codes: ["US"],
language: "en"
@spec get_token(PlaidEx.Config.t(), String.t(), keyword()) :: {:ok, map()} | {:error, PlaidEx.Error.t()}
Retrieves metadata about an existing link token.
@spec list_sessions( PlaidEx.Config.t(), keyword() ) :: {:ok, map()} | {:error, PlaidEx.Error.t()}
Lists all Link sessions for debugging (sandbox only).