logo
Authentication

Login user & generate connection link

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

Logs in a SnapTrade user and returns an authenticated connection portal URL for them to use to connect a brokerage account.

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 (generated when registering user)

Request Body
brokerstring

Slug of the brokerage to connect the user to

immediateRedirectboolean

When set to True, user will be redirected back to the partner's site instead of the connection portal

customRedirectstring

URL to redirect the user to after the user connects their brokerage account

reconnectstring

The UUID of the brokerage connection to be reconnected. This parameter should be left empty unless you are reconnecting a disabled connection. See ‘Reconnecting Accounts’ for more information.

connectionTypestring

Sets whether the connection should be read or trade

connectionPortalVersionstring

Sets the version of the connection portal to render, with a default to 'v2'

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

Response fields

object

Redirect uri upon successful login

redirectURI
sessionIdstring
1
{
2
"redirectURI": "https://app.snaptrade.com/snapTrade/redeemToken?token=this$token1does2ntactu4allyexist==&clientId=example",
3
"sessionId": "string"
4
}