Short Grant Code
Authentication
Bearer authentication of the form Bearer <token>, where token is your auth token.
Request
Response
Non-empty if the request failed
Bearer authentication of the form Bearer <token>, where token is your auth token.
Non-empty if the request failed
Available to: Trader users of a configured NT Connect partner organization
Environments: Live. The endpoint is not blocked on Demo, but partner mode depends on a partner configuration, and those are provisioned on Live.
Rate Limit: No endpoint-specific time penalty. Partner-mode requests are limited per partner organization: 1,000 requests per hour by default, measured over a sliding window.
Use this endpoint when a user is already signed in to your application and you want to send their browser to a NinjaTrader-hosted URL (the trader dashboard, an account page, a funding page) without a second login.
Your backend calls this endpoint with the partner access token it already holds for that user (minted with the urn:ietf:params:oauth:grant-type:jwt-bearer grant on oAuthToken). NinjaTrader returns a short-lived, single-use code. You then redirect the user’s browser to the NinjaTrader application with that code attached, and exchangeShortGrantCode redeems it on arrival.
The partner access token never leaves your backend. Only the short code travels through the browser.
The handoff runs in three steps:
/auth/shortgrantcode with the partner access token.code and expires_in.errorText field in the response body to determine whether the request succeeded or failed.Partner Mode and expectedClientIp
expectedClientIp is what selects partner mode, and it is the field that makes the flow work end to end. Send the end user’s IP address as resolved by your own load-balancer-aware logic. The code is then bound to that address and redemption is rejected from anywhere else.
expectedClientIp does not return an error. The request silently falls back to the non-partner path, which binds the code to your backend’s IP address instead of the user’s, so the redirect fails at redemption with "Access denied from another IP". Always send it.In partner mode the caller must be a trader user belonging to an organization that has an enabled, non-archived partner configuration. Organization administrators and non-trader accounts are rejected.
Code Lifetime
ttl is a request, not a guarantee. The server clamps it to the per-environment maximum (30 seconds in production), and the response’s expires_in carries the value actually stored. Omitting ttl, or sending a value of zero or less, gives 15 seconds.
Mint the code at the moment you are ready to redirect, not in advance. Only one code exists per user at a time: minting a second code invalidates the first.
Response Fields
The response is an OAuthGrantResponse. Two fields matter for this flow:
code: the single-use code. Attach it to the NinjaTrader URL you redirect the user to.expires_in: the code’s lifetime in seconds, after clamping. Note the underscore: the JSON key is expires_in, not expiresIn.The idToken field is never populated by this endpoint.
Sample Call
Common Failure Scenarios
expectedClientIp is omitted, so the code is bound to your backend’s address instead of the user’s.expectedClientIp is not a valid IPv4 or IPv6 address, or exceeds 64 characters. Both are request-validation failures, so they return HTTP 400 with a field-violation body rather than the HTTP 200 shape below.HTTP 401, plain-text body).HTTP 429, plain-text body).Error Messages