API Cheat Sheet

This cheat sheet provides quick access to the most commonly used Tradovate Partner API endpoints, authentication methods, and operations. It’s designed to help you quickly find the information you need while developing your integration.

Resource/OperationExampleDetails
API Base URLsThe API is split into two environments (Development and Production). Each environment has two domains - LIVE and DEMO. LIVE represents real trading, and DEMO represents simulated trading. Below are URLs associated with each configuration.
Development Simulation URLhttps://demo-api.staging.ninjatrader.dev
Development LIVE URLhttps://live-api.staging.ninjatrader.dev
Production Simulation URLhttps://demo.tradovateapi.com/v1
Production LIVE URLhttps://live.tradovateapi.com/v1
Development Real Time User Data WebSocketwss://demo-api.staging.ninjatrader.dev/v1/websocket
or
wss://live-api.staging.ninjatrader.dev/v1/websocket
Use of live or demo URLs will give real time updates for their respective environments.
Production Real Time User Data WebSocketwss://demo.tradovateapi.com/v1/websocket
or
wss://live.tradovateapi.com/v1/websocket
See above.
Development Market Data WebSocketmd-api.staging.ninjatrader.dev
Production Market Data WebSocketwss://md.tradovateapi.com/v1/websocket
Development Market Replay Socketwss://replay.staging.ninjatrader.devWhen using a Market Replay Socket, forward all messages (both market data and real time user data) through the replay socket. Expect all messages from the replay session to come through the replay socket.
Production Market Replay WebSocketwss://replay.tradovateapi.com/v1/websocketSee above.
What headers should I use?For everything except /auth/accessTokenRequest:
{
“Authorization”: “Bearer ${accessToken}”,
“Content-Type”: “application/json”
}

For the access token request only, omit the Authorization field.
Basic Entity OpsNote: The angle brackets represent variable placeholders. Real requests shouldn’t contain any angle brackets. Don’t include the angle brackets.

These operations are valid on any entity type (except where noted).
Get an entity by its ID

/item
HTTP:
BaseURL + /<entityName>/item?id=<id>

WSS:
<entityName>/item
<msg_id>
ids=<id>

Ex:
https://demo-api.staging.ninjatrader.dev/v1/user/item?id=123456
Retrieves an entity by its ID. Valid for all Entity types.
Get multiple entities by their IDs

/items
HTTP:
BaseURL + /<entityName>/items?ids=<id_a>,…

WSS:
<entityName>/items
<msg_id>
ids=<id_a>,…

Ex:
https://live-d.tradovateapi.com/user/items?ids=12345,23456,34567
Retrieves all entities in the provided list of IDs.
Get a list of all entities of a given type

/list
HTTP:
BaseURL + /<entityName>/list

WSS:
<entityName>/list
<msg_id>

Ex:
https://live-api.staging.ninjatrader.dev/v1/user/list
Retrieves a list of all of the entities that are within the logged on user’s visible scope. As an org admin, you should be able to see lists of entities related to your organization.
Find an entity by its name

/find
HTTP:
BaseURL + /<entityName>/find?name=<name>

WSS:
<entityName>/find
<msg_id>
name=<name>

Ex:
https://live-d.tradovateapi.com/product/find?name=ES
Only works for entities with a ‘name’ field. The Position entity type for example has no ‘name’ field, and therefore calls to /position/find (although valid) will always return nothing.
Suggest/search entities based on a text query

/suggest
HTTP:
BaseURL + /<entityName>/suggest?t=<query>&l=<quantity>

WSS:
<entityName>/suggest
<msg_id>
t=<query>&l=<quantity>

Ex:
https://demo-api.staging.ninjatrader.dev/v1/contract/suggest?t=ES&l=5
Returns an array of suggested entities based on the query text t. Returns as many as l elements.
Find dependent/related entities

/deps
HTTP:
BaseURL + /<entityName>/deps?masterid=<id>

WSS:
<entityName>/deps
<msg_id>
masterid=<id>

Ex:
https://demo-api.staging.ninjatrader.dev/v1/position/deps?masterid=12345
Retrieves entities dependent on the entity with ID masterid. The expected entity type may vary depending on the target entity type, so be sure to read the exact specification for the entity in question.
Find dependent entities from multiple master entities

/ldeps
HTTP:
BaseURL + /<entityName>/ldeps?masterids=<id>,…

WSS:
<entityName>/ldeps
<msg_id>
masterids=<id1>,…<idN>

Ex:
https://demo-api.staging.ninjatrader.dev/v1/executionReport
Retrieves entities dependent on any of the passed ‘masterids’ entities.
Organization Specific Ops
Create a new user for your organization

/user/signUpOrganizationMember
LiveURL + /user/signUpOrganizationMember

Request {
name: string,
email: string,
password: string,
firstName: string,
lastName: string
}

Response (Success) {
errorCode: ‘Success’,
userId: number, //created user id
emailVerified: boolean
}

Response (Fail) {
errorCode: string,
errorText: string,
}

Should be called from a LIVE URL (in either dev or prod). Adds a new user entity with the credentials provided to the request body. All fields of the request body are required.
Add a Tradovate Membership to an organization user

/user/addTradovateSubscription
LiveURL + /user/addTradovateSubscription

Request {
tradovateSubscriptionPlanId: number,
userId: number
}

Response (Success) {
errorCode: ‘Success’,
tradovateSubscription: Object
}

Response (Fail) {
errorText: string,
errorCode: string
}

To find the ‘tradovateSubscriptionPlanId’ value, you can use the /tradovateSubscriptionPlan/list operation to find all the available plans for your Organization, however you should use the YOUR_ORG_MONTHLY subscription type (where YOUR_ORG is replaced with your actual org name)

The accountId and creditCardId field should be left null in this case, as all sub-vendors will be assigning a $0 cost plan for these users.
Open a demo account for an organization user

/user/openDemoAccount
DemoURL + /user/openDemoAccount

Request {
templateAccountId: number,
name: string,
initialBalance: number,
defaultAutoLiq: {
changesLocked: bool,
doNotUnlock: bool,
dailyLossAutoLiq: number,
weeklyLossAutoLiq: number,
trailingMaxDrawdown: number,
trailingMaxDrawdownMode: string, //“EOD” or “RealTime”
trailingMaxDrawdownLimit: number
}
}

Response (Success) {
accountId: number
}

Response (Fail) {
}

Opens a demo account. Be sure to use a DEMO base url for this operation. All parameters are optional. If you want to use account templates, provide the template’s id to the ‘templateAccountId’ field.

The ‘name’ parameter must be unique.

New — you can now set a default autoLiq profile right away. The defaultAutoLiq field will accept any of the fields listed there.
Update a user’s Contact Info

/contactInfo/updateContactInfo
LiveURL + /contactInfo/updateContactInfo

Request {
firstName: string,
lastName: string,

streetAddress1: string,
streetAddress2: string,
city: string,
state: string,
postCode: int,
country: string,
userId: int,
archived: boolean,
phone: string
}


*Undocumented*
state is only required if country == “US”.

country should be a 2-letter string (ISO Alpha-2 code).

phone can include leading + signs.

archived is required, but should always be false.
Create a Trading Permission by associating a user’s ID with an account ID

/user/createTradingPermission
DemoURL + /user/createTradingPermission

Request {
accountId: number,
userId: number,
}

Response (Success) {
tradingPermission: Object
}

Response (Fail) {
errorText: string
}

The accountId parameter should refer to a sim account that is owned by the API Admin.

The userId can be the ID of any user that is a part of your organization.
Grant an organization user a Market Data subscription

/user/addMarketDataSubscription
LiveURL + /user/addMarketDataSubscription

Request {
marketDataSubscriptionPlanIds: number[],
year: number,
month: number,
creditCardId: number,
accountId: number,
userId: number
}

Response (Success) {
errorCode: ‘Success’,
marketDataSubscription: Object
}

Response (Fail) {
errorCode: string,
errorText: string
}

Requires the target user to have logged on and signed the Non-Professional Self Attestation.

marketDataSubscriptionPlanIds is an array of market data subscription entity IDs and should contain at least one ID. To get a list of these IDs use the /marketDataSubscriptionPlanList operation.

accountId is the entity ID of an account owned by the Organization Admin user.

userId should be the entity ID of the target user to grant permission to.
Revoke trading permission from a user

/user/revokeTradingPermission
LiveURL + /user/revokeTradingPermission

Request {
tradingPermissionId: number
}

Response (Success) {
errorText: string
}

Response (Fail) {
tradingPermission: Object
}

The tradingPermissionId is the ID of the TradingPermission Object created when the user was originally granted trading permission.

The tradingPermission field in the return object is the TradingPermission entity that has had its status field changed to Revoked.
Cancel a user’s existing Tradovate Subscription

/user/cancelTradovateSubscription
LiveURL + /user/cancelTradovateSubscription

Request {
tradovateSubscriptionId: number,
expire: boolean,
cancelReason: string
}

Response (Success) {
errorText: string,
errorCode: string
}

Response (Fail) {
tradovateSubscription: object
}

The subscription ID parameter

Cancel a user’s subscription. The expire field will immediately expire their subscription (rather than at the set expirationDate field from the TradovateSubscription object itself).

You can use the optional ‘cancelReason’ string to specify a reason for canceling the subscription. This could be useful for differentiating subscription cancellation reasons.
(New) Bulk revoke Trading Permissions

/user/revokeTradingPermissions
DemoURL + /user/revokeTradingPermissions

Request {
tradingPermissionIds: number[]
}

Response {
ok: boolean
}
Accepts up to 1024 ID arguments in the tradingPermissionIds array.