Free during testing — sign up, no payment required.
On this page

API Reference#

The tramiro REST API gives you programmatic access to your trading platform data — accounts, trades, performance metrics, and alerts. Integrate tramiro into your own tools, dashboards, and automation pipelines.

Authentication#

Authentication is a two-step process: create an API client to get credentials, then exchange them for a short-lived JWT token.

  1. 1. Create an API client

    Log in to the tramiro app and create an API client. You will receive an appId and appSecret. The secret is shown once — store it securely.

  2. 2. Exchange credentials for a JWT

    Send your credentials to the token endpoint to receive a JWT:

    Request
    curl -X POST https://api.tramiro.com/api/1.0/auth/token \
      -H "Content-Type: application/json" \
      -d '{
        "appId": "YOUR_APP_ID",
        "appSecret": "YOUR_APP_SECRET"
      }'
    Response
    {
      "token": "eyJhbGciOiJIUzI1NiIs...",
      "expiresInSeconds": 3600
    }

    When the token expires, call the token endpoint again — there is no refresh token for API clients.

  3. 3. Use the JWT on every request

    Pass the token in the Authorization header:

    Header
    Authorization: Bearer <token>

Base URL#

All API endpoints are relative to the following base URL:

https://api.tramiro.com/api/1.0/

Endpoint Reference#

All paths below are relative to the base URL. Endpoints require a valid JWT unless noted otherwise.

Authentication#

Exchange API client credentials for a short-lived JWT token.

Exchange appId + appSecret for a JWT token. No authentication required.

Request Body
FieldTypeDescription
appId*stringYour API client ID
appSecret*stringYour API client secret
Example request
{
  "appId": "your-app-id",
  "appSecret": "your-app-secret"
}
Response
FieldTypeDescription
tokenstringJWT token to use in Authorization header
expiresInSecondsnumberToken lifetime in seconds
Example response
{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "expiresInSeconds": 3600
}

Me#

Retrieve information about the authenticated API client.

GET/me

Get current authenticated user or API client info.

Response
FieldTypeDescription
idUUIDUser ID
emailstringEmail address
firstNamestringFirst name
lastNamestringLast name
rolestringUser role
timezonestringTimezone setting
apiClientIdUUID | nullAPI client ID (only for API clients)
apiClientAppIdstring | nullAPI client app ID (only for API clients)
apiClientDescriptionstring | nullAPI client description (only for API clients)
Example response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "email": "[email protected]",
  "firstName": "John",
  "lastName": "Doe",
  "role": "API",
  "timezone": "Europe/Prague",
  "apiClientId": "660e8400-e29b-41d4-a716-446655440001",
  "apiClientAppId": "your-app-id",
  "apiClientDescription": "My integration"
}

Trading Platform Instances#

Manage trading platform instances — create, list, update, and delete.

List all trading platform instances for the authenticated user.

Query Parameters
FieldTypeDescription
identifierstringFilter by instance identifier
Response
FieldTypeDescription
idUUIDInstance ID
identifierstringUnique identifier
namestringDisplay name
descriptionstringDescription
createdAtUtcdatetimeCreation timestamp (UTC)
metricsobjectInstance metrics (status, last heartbeat, account metrics)
Example response
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "identifier": "my-mt5",
    "name": "My MT5 Account",
    "description": "Production trading account",
    "createdAtUtc": "2026-01-15T10:30:00",
    "metrics": {
      "status": "ONLINE",
      "lastHeartbeatAtUtc": "2026-04-13T12:00:00",
      "accountMetrics": {
        "balance": 10000.00,
        "equity": 10250.50,
        "profitLoss": 250.50,
        "currency": "USD"
      }
    }
  }
]

Get a single trading platform instance by ID.

Response

Same shape as a single item from the list endpoint.

Create a new trading platform instance.

Request Body
FieldTypeDescription
identifier*stringUnique identifier (min 2 chars)
name*stringDisplay name (min 2 chars)
description*stringDescription of this instance
Example request
{
  "identifier": "my-mt5",
  "name": "My MT5 Account",
  "description": "Production trading account"
}
Response

Returns the created instance (same shape as GET). Status 201.

Update an existing trading platform instance.

Request Body
FieldTypeDescription
namestringNew display name (min 2 chars)
descriptionstringNew description
Example request
{
  "name": "Updated Name",
  "description": "Updated description"
}
Response

Returns the updated instance. Status 200.

Delete a trading platform instance.

Response

No content. Status 204.

Trade History#

Query and export trade history for a trading platform instance.

List trades with pagination, filtering, and sorting.

Query Parameters
FieldTypeDescription
pageintegerPage number (default: 0)
sizeintegerPage size (default: 50, max: 500)
sortstringSort field: openTime, closeTime, profit, pips, symbol, ticket
tradeTypestring[]Filter by trade type
Response
FieldTypeDescription
tradesTradeRecord[]Array of trade records
pageintegerCurrent page number
sizeintegerPage size
totalElementsintegerTotal number of trades
totalPagesintegerTotal number of pages
Example response
{
  "trades": [
    {
      "ticket": 12345,
      "symbol": "EURUSD",
      "direction": "BUY",
      "lots": 0.10,
      "openPrice": 1.08500,
      "closePrice": 1.08750,
      "openTime": "2026-04-10T09:30:00",
      "closeTime": "2026-04-10T14:15:00",
      "profit": 25.00,
      "swap": -0.50,
      "commission": -0.70,
      "pips": 25.0,
      "netProfit": 23.80
    }
  ],
  "page": 0,
  "size": 50,
  "totalElements": 142,
  "totalPages": 3
}

Get the trade history synchronization state.

Response
FieldTypeDescription
lastSyncTimestampdatetimeLast sync timestamp (UTC)
totalClosedTradesintegerTotal number of closed trades
Example response
{
  "lastSyncTimestamp": "2026-04-13T12:00:00",
  "totalClosedTrades": 142
}

Export trade history as a CSV file.

Query Parameters
FieldTypeDescription
tradeTypestring[]Filter by trade type
sortstringSort field: openTime, closeTime, profit, pips, symbol, ticket
Response

Returns a streaming CSV file with Content-Type: text/csv.

Performance#

Retrieve performance metrics and time-series curves. All endpoints accept an optional range query parameter.

Three curve endpoints share the same shape. Each accepts an optional range query parameter ("1h", "24h", "7d", "30d", "90d", "365d" — default "30d").

PathPoints fieldDescription
/performance/cumulative-plcumulativePlCumulative profit/loss over time
/performance/equity-curveequityEquity value over time
/performance/percentage-curvepercentagePercentage change over time
Shared response shape
Example response (replace <field> with the points field name)
{
  "points": [
    { "timestamp": "2026-03-14T00:00:00", "<field>": 0 },
    { "timestamp": "2026-03-15T00:00:00", "<field>": 150.25 }
  ],
  "range": "30d"
}

Get performance statistics for a time range.

Query Parameters
FieldTypeDescription
rangestringTime range — "1h", "24h", "7d", "30d", "90d", "365d" (default: "30d")
Response
FieldTypeDescription
totalProfitLossnumberTotal P/L in account currency
roinumberReturn on investment (%)
profitFactornumberProfit factor (gross profit / gross loss)
winRatenumberWin rate (%)
totalTradesintegerNumber of trades in range
rangestringApplied range
historyMayBeIncompletebooleanTrue if trade history may not cover the full range
Example response
{
  "totalProfitLoss": 1250.50,
  "roi": 12.5,
  "profitFactor": 2.35,
  "winRate": 68.5,
  "totalTrades": 47,
  "range": "30d",
  "historyMayBeIncomplete": false
}

Average Spreads#

Retrieve average spread data for a trading platform instance.

Get average spreads by symbol for a time range.

Query Parameters
FieldTypeDescription
rangestringTime range — "1h", "24h", "7d" (default: "24h")
Response
FieldTypeDescription
spreadsarrayArray of { symbol, averageSpreadInPoints }
rangestringApplied range
Example response
{
  "spreads": [
    { "symbol": "EURUSD", "averageSpreadInPoints": 12 },
    { "symbol": "GBPUSD", "averageSpreadInPoints": 18 }
  ],
  "range": "24h"
}

Error Model#

All error responses return a JSON array. There are two shapes depending on the error type.

General errors

Returned for 401, 403, 404, and general 400 errors. Each object contains a message field.

General error
[
  { "message": "Unauthorized" }
]

Validation errors

Returned for 400 responses caused by invalid input. Each object contains a field and message.

Validation error
[
  { "field": "appId", "message": "must not be blank" },
  { "field": "appSecret", "message": "must not be blank" }
]

Examples#

Common API calls using curl. Replace placeholder values with your actual credentials and IDs.

Create a trading platform instance

POST /trading-platform-instance
curl -X POST https://api.tramiro.com/api/1.0/trading-platform-instance \
  -H "Authorization: Bearer $TRAMIRO_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "identifier": "my-mt5",
    "name": "My MT5 Account",
    "description": "Production trading account"
  }'

List trading platform instances

GET /trading-platform-instances
curl https://api.tramiro.com/api/1.0/trading-platform-instances \
  -H "Authorization: Bearer $TRAMIRO_JWT"

Get trade history

GET /trading-platform-instance/{id}/trade-history
curl https://api.tramiro.com/api/1.0/trading-platform-instance/1/trade-history \
  -H "Authorization: Bearer $TRAMIRO_JWT"

Get performance stats

GET /trading-platform-instance/{id}/performance/stats
curl "https://api.tramiro.com/api/1.0/trading-platform-instance/1/performance/stats?range=30d" \
  -H "Authorization: Bearer $TRAMIRO_JWT"