logo
Authentication

Generate Connection Portal URL

post
https://api.snaptrade.com/api/v1/snapTrade/login

Authenticates a SnapTrade user and returns the Connection Portal URL used for connecting brokerage accounts. Please check this guide for how to integrate the Connection Portal into your app.

Please note that the returned URL expires in 5 minutes.

Execute an API Request

Query
userIdstringrequired

SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.

userSecretstringrequired

SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the rotate user secret endpoint.

Request Body
brokerstring

Slug of the brokerage to connect the user to. See the integrations page for a list of supported brokerages and their slugs.

immediateRedirectboolean

When set to true, user will be redirected back to the partner's site instead of the connection portal. This parameter is ignored if the connection portal is loaded inside an iframe. See the guide on ways to integrate the connection portal for more information.

customRedirectstring

URL to redirect the user to after the user connects their brokerage account. This parameter is ignored if the connection portal is loaded inside an iframe. See the guide on ways to integrate the connection portal for more information.

reconnectstring

The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See the guide on fixing broken connections for more information.

connectionTypestring

Sets whether the connection should be read-only or trade-enabled.

connectionPortalVersionstring

Sets the version of the connection portal to render.

Authorization
Request
Installation
$
npm install snaptrade-typescript-sdk
1
Loading...

Response fields

object

Redirect uri upon successful login

redirectURIstring

Connection Portal link to redirect user to connect a brokerage account.

sessionIdstring

ID to identify the connection portal session.

1
{
2
"redirectURI": "https://app.snaptrade.com/snapTrade/redeemToken?token=npVKchZrL0MYIHTusGfADT74r4xXpHkmbxbQDmt0RINLXbQ5cWsvGkPSgMQRxz8/cnxjzL9T2NWLuHuDyidHiCNeXXTb/tVhzC2olSyfxWW6DRrkUppArGCdmkIHyBMzog6C55P8yoqzcGer5Hml0Q%3D%3D&clientId=WEALTHLY&broker=ROBINHOOD&connectionPortalVersion=v3&sessionId=cf371bb4-a475-4f17-ab94-d0fee699960d",
3
"sessionId": "cf371bb4-a475-4f17-ab94-d0fee699960d"
4
}