Authentication and request IDs
Authentication and request IDs
All requests using the TT REST API must include:
- An Application Key in the header
x-api-key=<application key>
Additionally, most requests also require:
- A Token in the header.
Authorization=Bearer <token>-
A request ID passed as a query string
requestId=<app_name>-<company_name>--<new_guid>
Note: The TT REST API documentation provides the ability to create and send
test requests. These test requests also need the above-mentioned parameters where required by the endpoint.
Application keys
Application Keys are created using the Setup application. An Application
Key is associated with the login used to create it and the key will inherit the login’s permissions and
access to data for the environment in which the key was created. Separate application keys are
required for making requests from the UAT and Live environments.
Consult the documentation for more information on the environments used by
the TT REST API as well as creating application keys.
Tokens
For all TT REST endpoints, users must obtain a token.
To request a token, you send your application key and application secret within a POST request to the ‘/token’
endpoint. Full documentation can be found at the bottom of this page.
When using the token in subsequent requests, Bearer is added to the front of the token you receive.
Note: Tokens are set to expire after a given period of time. This period of time is communicated in
the response to your token request as the “seconds_until_expiry” value. Your application will need to generate a new
token before its token expires.
Providing a Request ID
All endpoints require a query parameter named requestId. Its value must be of the form:
<app_name>-<company_name>–<new_guid>
where:
- <app_name> is a user-generated string used to identify the specific application making the call.
- <company_name> is a user-generated string used to identify the user’s company.
-
<new_guid> is the globally
unique identifier for this request. Each separate request should have a distinct identifier so that it
can be traced. GUIDs can be created
using a GUID generator.
To avoid issues when submitting your request and requestId, you must adhere to the following format
requirements:
-
Do not use special characters: TT strongly recommends you avoid using special characters ($ & + , / :
; = ? @ ” <> # % { } | \ ^ ~ [ ] `) when creating your requestId. These characters may
cause failures when passed to some TT backend components. -
Do not include spaces: Your requestId cannot include blank spaces.
-
Match the case sensitivity of the requestId parameter: The request will only work if
the query parameter uses the appropriate ‘lower camelcase’ format: requestId. Alternate
case structures (e.g., requestid, requestID, or
requestiD) may result in a failed request.
Note Requests submitted without the requestId query parameter
will be rejected.
Creating a Globally Unique Identifier
To create a unique identifier, you can use an online GUID Generator like guid.one or
any other GUID generator available online.
These tools generate completely random values (e.g., 47a1e1c4-0c94-4fb3-94a9-d772382458a3) that meet
the criteria for creating a value used for identification.
Note: You must includes all characters, including hyphens, when using this value to access TT REST
API.
For additional information on GUID values, visit guid.one/guid.
Using Authentication and request IDs in test calls within documentation
The TT REST API documentation lets you make test calls for endpoints for all services. The Ledger, Monitor and Risk
services require a token for addtional authentication. The documentation simplifies the process of authorizing your
requests and for specifying a sample value for the new requestId parameter required for requests in these services.
Rather than requiring you to authorize each request individually, the documentation provides an
Authorize button that lets you enter the necessary authorization once for all calls in the service.
When you click the Authorize button, you can enter the API key and token in the dialog box, as shown.

- Enter your TT REST API Application Key from Setup.
- Enter “Bearer ” followed by the token (include a space, but do not include the quotes).
For any endpoint, you can click the Try it out button, populate the parameters, and execute the test
request. While using the documentation to test your requests, a sample requestId parameter, in the proper format, is
automatically populated so you need not generate a new GUID for each test request.

Note: The sample requestId is valid only for test calls made from the
documentation. When making requests from your application, you must generate a new and unique GUID for every
request.
Token Requests
To get a token, you send your application key and application secret within a POST request to generate a token.
Expand the ‘/token’ documentation below to view the required parameters for generating a token.
Before you begin
Application key usage plans and message limits
Using the TT REST API requires you to select a usage plan for the application key that can incur additional costs. TT offers the following usage plans for TT REST application keys:
For more information about the costs associated with the usage plans, contact TT Customer Success.
* Note: You can manage users, accounts, permissions and risk through the various endpoints in the TT REST API. Due to the amount of data that can be sent in POST endpoints, the TT REST API limits their frequency to one POST request every ten seconds. Most daily maintenance and activity will not be affected by these limits and can be accomplished normally on week days.
Getting an Application Key and Application Secret
Prerequisite
Prior to creating your own application key, your company’s administrator must enable the Can create TT Rest API key setting for the user. For more information, refer to the Enabling API Key Creation section in the Setup help.
Creating an Application Key
To create an application key:
Introduction to TT REST API
The TT REST API 2.0 gives you the tools you need to leverage the power of the TT platform within your own applications. You can access the same product information services, risk management and market connectivity used by the TT platform – all through an easy-to-use REST API.
The TT REST API provide a number of resources:
Note: When submitting requests, all API urls are case sensitive and should include the endpoint name in lowercase. For example, using https://ttrestapi.trade.tt/TTUser/ext_uat_cert/ results in a 403 server error.
You must use https://ttrestapi.trade.tt/ttuser/ext_uat_cert/ in order to properly reach the API.
To view a sample application which makes use of the TT REST API, visit TT’s public Github repository.
Note: The ttledger and ttmonitor services are not intended to be used as a real-time feed since there may be delays between the time at which order and fill events occur and the time when they are available via TT REST API. Applications requiring a real-time feed should use TT .NET SDK or TT FIX.
Environments: directing your requests
TT provides two environments for use with the TT REST API, a UAT environment which is used when developing and testing your application, and a production environment. Requests to the TT REST API target the environment and requested service use the following base URL:ttrestapi.trade.tt/<service>/<environment>.
Note: To ensure proper routing of all requests, users must use an HTTP library that supports 303 redirects.
Certificate/SSL Validation
Certificate pinning, sometimes known as SSL pinning, is a process that you can use in your application to validate a remote host by associating that host directly with its X.509 certificate or public key instead of with a certificate hierarchy. The application therefore uses pinning to bypass SSL/TLS certificate chain validation.
The typical SSL validation process checks signatures throughout the certificate chain from the root certificate authority (CA) certificate through the subordinate CA certificates, if any. It also checks the certificate for the remote host at the bottom of the hierarchy. Your application can instead pin to the certificate for the remote host to say that only that certificate and not the root certificate or any other in the chain is trusted.
You can add the remote host’s certificate or public key to your application during development. Alternatively, the application can add the certificate or key when it first connects to the host.
Warning
TT does not support certificate pinning for this service.
Response Payload Sizes
In cases where the TT REST API attempts to send too much data in response to a request, users may receive a 413 (content too large) error. In such cases, users should set the Accept-Encoding parameter in the HTTP header to “gzip”. As a result, the TT REST API will compress the data before transmitting it.
Staying Current with TT REST API Releases
It is important to stay current on all of the latest changes that TT makes in the TT REST API. You can subscribe for automated email notifications when new versions of the TT REST API are released by clicking the ‘Subscribe’ button on the TT Release Notes web page. Although we strive to keep the interface completely backwards compatible in new versions, there may be instances where this is not possible and, as such, will require developers to recompile and/or make code changes.
TT REST API endpoints accessed via apigateway.trade.tt are serviced through a single instance located in the U.S. To improve resiliency, TT deployed a new version of TT REST API to multiple instances around the globe in the past year. Non-U.S. client applications communicate with a local regional instance, and automatic failover occurs if that local instance becomes unavailable. This provides improved performance along with the seamless operation of all applications.
To access this new version, clients must update the target URL of their applications from apigateway.trade.tt to https://ttrestapi.trade.tt. Clients who continue to use the legacy URL will be impacted in the event of an outage of the single U.S. instance. Furthermore, non-U.S. clients will continue to be subject to possible latency timeouts. As such, TT strongly recommends that clients migrate to the endpoints via https://ttrestapi.trade.tt to avoid business continuity issues.
Contacting TT Support
If you need help with TT REST API issues, you can submit a support ticket. To submit a support ticket, visit the TT Support Center page in the Resources section of the TT website and click OPEN A TICKET.
Migrating from TT REST 1.0 to 2.0
TT REST API 1.0 was deprecated on June 30, 2021. The following can help with migrating applications to TT REST API
2.0.
A restructuring of the original version of the TT REST API was undertaken to improve its underlying design. As a
result, a new version was created in which the names of the individual services were changed so as to differentiate it
from the original version. Furthermore, the “RISK” service offered in the original version has been split up into
several smaller services in the new version.
| TT REST API Services 1.0 | TT REST API Services 2.0 |
|---|---|
| ttid |
|
| PDS |
|
| LEDGER |
|
| MONITOR |
|
| RISK |
|
However, the new version presents an interface which closely mimics that of the original version to minimize
migration efforts. The following is a list of the changes that were made to the interface which may impact your
application. Fields and endpoints that are marked as deprecated will remain in the new version until the original
version is no longer available.
NOTE: As a product, TT REST API 1.0 will be deprecated on June 30, 2021. Until then, TT REST API 1.0
will remain a fully supported production product, however, no additional enhancements will be made to it.
Key to Interface Changes
The tables below use the following colors to represent each interface change impact:
- The highlighted changes have a high impact to the interface. These
changes require most users to modify their code to reflect the change. - The highlighted changes have a medium impact to the interface. These
changes may impact fewer users but require all users to verify their code can adapt to the change. - The highlighted changes have a low impact to the interface. These
changes impact the fewer number of users. All users should verify their code can adapt to the change.
Interface Changes – ttid
No interface changes.
Interface Changes – PDS
information on tokens, refer to the Tokens section the help.
ttpds
ttpds – GET
| Method | Endpoint | Changes |
|---|---|---|
| GET | /currencyrates |
|
| GET | /instruments |
|
Interface Changes – Ledger
TTLEDGER
TTLEDGER – GET
| Method | Endpoint | Changes |
|---|---|---|
| GET | /fills |
|
| GET | /tradingaccountfills |
|
Interface Changes – Monitor
TTMONITOR
TTMONITOR – GET
| Method | Endpoint | Changes |
|---|---|---|
| GET | /position |
|
Interface Changes – Risk
TTSETUP
TTSETUP – GET
| Method | Endpoint | Changes |
|---|---|---|
| GET | /commondata |
|
| GET | /ordertagdefaults/fields |
|
TTSETUP – POST
| Method | Endpoint | Changes |
|---|---|---|
| POST | /company/productmargin |
|
| POST | /ordertagdefaults/profiles |
|
TTSETUP – DELETE
| Method | Endpoint | Changes |
|---|---|---|
| DELETE | /company/productmargin |
|
TTUSER
TTUSER – GET
| Method | Endpoint | Changes |
|---|---|---|
| GET | /user |
|
| GET | /user/accesslines |
|
| GET | /user/privatelines |
|
| GET | /user/{userId} |
|
| GET | /user/{userId}/risklimits |
|
| GET | /user/{userId}/marketdata |
|
| GET | /user/{userId}/profile |
|
TTUSER – POST
| Method | Endpoint | Changes |
|---|---|---|
| POST | /users/limits/contract |
|
| POST | /users/limits/ipspread |
|
| POST | /users/limits/product |
|
| POST | /users/limits/limitsettings |
|
| POST | /user/risklimit/contract |
|
| POST | /user/risklimit/ipspread |
|
| POST | /user/risklimit/product |
REQUEST and RESPONSE
|
| POST | /user/risklimitsettings |
|
TTUSER – DELETE
| Method | Endpoint | Changes |
|---|---|---|
| DELETE | /user/risklimit |
|
TTACCOUNT
TTACCOUNT – GET
| Method | Endpoint | Changes |
|---|---|---|
| GET | /accounts |
|
| GET | /account/{accountId} |
|
| GET | /account/{accountId}/children |
|
| GET | /account/{accountId}/limits |
|
| GET | /account/{accountId}/risksettings |
|
| GET | /accountuser |
|
TTACCOUNT – POST
| Method | Endpoint | Changes |
|---|---|---|
| POST | /accounts/risklimits/contract |
|
| POST | /accounts/risklimits/ipspread |
|
| POST | /accounts/risklimits/product |
|
| POST | /accounts/limits/contract |
|
| POST | /accounts/limits/ipspread |
|
| POST | /accounts/limits/product |
|
| POST | /accounts/limits/limitsettings |
|
| POST | /account/risklimit/contract |
|
| POST | /account/risklimit/ipspread |
|
| POST | /account/risklimit/product |
|
| POST | /account/risklimitsettings |
|
| POST | /account/risksettings |
|
| POST | /accountuser |
|
TTACCOUNT – DELETE
| Method | Endpoint | Changes |
|---|---|---|
| DELETE | /account/{accountId} |
|
| DELETE | /account/risklimit |
|
| DELETE | /accountuser/{Id} |
|
TTGROUP
TTGROUP – GET
| Method | Endpoint | Changes |
|---|---|---|
| GET | /riskgroups |
|
| GET | /riskgroups/{riskgroupid}/limits |
|
| GET | /usergroups/{userGroupId} |
|
| GET | /usergroups/{userGroupId}/connectivity |
|
| GET | /usergroups/{userGroupId}/settings |
|
TTGROUP – POST
| Method | Endpoint | Changes |
|---|---|---|
| POST | /riskgroups/riskgrouprisklimits/contract |
|
| POST | /riskgroups/riskgrouprisklimits/ipspread |
|
| POST | /riskgroups/riskgrouprisklimits/product |
|
| POST | /riskgroups/riskgrouprisklimitsettings |
|
| POST | /usergroups/connectivity/privatelines |
|
| POST | /usergroups/connectivity/settings |
|
TTGROUP – DELETE
| Method | Endpoint | Changes |
|---|---|---|
| DELETE | /riskgroups/{riskgroupid} |
|
| DELETE | /riskgroups/riskgroupaccounts |
|
| DELETE | /riskgroups/riskgrouprisklimits |
|
| DELETE | /usergroups/connectivity/privatelines |
|
| DELETE | /usergroups/users/{userId} |
|