Reference
Trails
What happened, with the request id that caused it: the audit trail (every write and every security event), each account's connection history, and an equity curve sampled once a minute. Rows are written off the request path and pruned hourly: audit 90 days or 200,000 rows, connection events 90 days or 50,000 rows, equity 7 days. Also who is connected right now and what they receive (in memory, since the server started).
Read the audit trail
/api/v1/auditEvery write and every security event, newest first: trades (one row per broker call with the request in short JSON, the retcode, the result and the broker latency; none for an idempotent replay), account and key changes, sign-ins, wrong passwords, lockouts, password changes, setup, server checks and server starts. Each row carries the X-Request-Id of the request that caused it, so a bot's log, the server log and the trail line up. Every filter given must match; an empty one is ignored. request_id finds the rows of one request (exact, indexed). q finds a piece of text, case-insensitive, in the request id, actor, account, route, summary or result; it reads from the newest row down and stops at limit matches (a search that matches little reads the whole trail, 40 to 60 ms at the 200,000-row cap). Page with before = the id of the last row seen, with or without a search.
Query parameters
accountstringOnly rows about this account.
kindstringOnly rows of this kind.
tradeaccountkeysigninauth_failedlockoutpasswordsetupserver_checkserver_truststartactorstringOnly rows by this actor (a key id, admin, an IP, termlessd).
request_idstringOnly rows caused by the request with this X-Request-Id (exact match).
qstringOnly rows whose request_id, actor, account, route, summary or result contains this text, ignoring case (
%and_are plain characters). More than 200 characters is 400.beforeintegerOnly rows with an id below this: the id of the last row of the previous page.
limitinteger default100min 1, max 1000Most rows to return, at most 1000.
Headers
X-Request-IdstringYour own id for the request, kept and echoed in the response header of the same name (and written on every log line and audit row of the request). Anything else is replaced by one the server makes.
Response 200 Rows, newest first.
A JSON array of AuditRow objects.
idinteger requiredRow id, increasing. Page with
before.atinteger requiredWhen it happened, unix milliseconds (UTC).
kindstring requiredWhat kind of thing happened.
tradeaccountkeysigninauth_failedlockoutpasswordsetupserver_checkserver_truststartactorstring requiredWho did it: the key id for a key, admin for the dashboard, the client IP before sign-in, termlessd for the server itself.
actor_kindstring requiredadmin for the dashboard session, key for an API key, anonymous before sign-in, system for the server.
adminkeyanonymoussystemaccountstring or null requiredThe account it concerned, when one did.
routestring requiredWhat was done. For a trade: market order, pending order, order change, order cancel, SL/TP change, close, partial close or order_send. For an account: add, update or delete. For a key: create or delete.
summarystring requiredOne line a person can read.
requeststring or null requiredFor a trade: the request sent to the broker, in short JSON (cut to 400 characters).
statusinteger or null requiredThe HTTP status the caller got.
retcodeinteger or null requiredFor a trade the broker answered: its return code.
resultstring or null requiredFor a trade: the broker's answer in words with the order and deal tickets, or the error when it did not answer.
latency_msinteger or null requiredFor a trade: the broker round trip in milliseconds.
request_idstring or null requiredThe X-Request-Id of the request that caused the row; the same id is on its log lines.
ipstring or null requiredThe client IP, recorded for sign-ins, wrong passwords and lockouts.
Errors
- 400
bad_requestA field is missing or not valid, or the query string has a parameter the route does not take (the message names the ones it takes;key=is accepted anywhere). - 401
unauthorizedNo valid API key or session. - 403
forbiddenThe key lacks the scope, or may not use this account, or a cookie request came from another site. - 429
too_many_requestsThis IP is locked out for 15 minutes (5 wrong passwords or setup tokens lock it out of sign-in, 30 unknown API keys in 15 minutes lock it out of key auth), or a stream cap was hit (1,024 open streams per server, 256 per key or dashboard session), or a password check could not start (one at a time per IP, two at a time per server). Retry-After has the seconds to wait.
curl -s "$TERMLESS_URL/api/v1/audit?account=pepperstone-12345678&kind=trade&request_id=bot-20261003-0042&q=xauusd&limit=100" \
-H "Authorization: Bearer $TERMLESS_KEY"import os
import requests
base = os.environ["TERMLESS_URL"] + "/api/v1"
auth = {"Authorization": "Bearer " + os.environ["TERMLESS_KEY"]}
r = requests.get(f"{base}/audit", headers=auth, params={"account": "pepperstone-12345678", "kind": "trade", "request_id": "bot-20261003-0042", "q": "xauusd", "limit": 100})
r.raise_for_status()
print(r.json())import json
import os
import urllib.error
import urllib.request
base = os.environ["TERMLESS_URL"] + "/api/v1"
headers = {"Authorization": "Bearer " + os.environ["TERMLESS_KEY"]}
req = urllib.request.Request(f"{base}/audit?account=pepperstone-12345678&kind=trade&request_id=bot-20261003-0042&q=xauusd&limit=100", data=None, headers=headers, method="GET")
with urllib.request.urlopen(req, timeout=35) as r:
print(json.load(r))const base = `${process.env.TERMLESS_URL}/api/v1`;
const res = await fetch(`${base}/audit?account=pepperstone-12345678&kind=trade&request_id=bot-20261003-0042&q=xauusd&limit=100`, {
headers: { Authorization: `Bearer ${process.env.TERMLESS_KEY}` }
});
if (!res.ok) throw new Error((await res.json()).error.message);
console.log(await res.json());[
{
"id": 4821,
"at": 1790981179473,
"kind": "trade",
"actor": "key_3f9a1c07",
"actor_kind": "key",
"account": "pepperstone-12345678",
"route": "market order",
"summary": "market buy 0.10 XAUUSD",
"request": "{\"symbol\":\"XAUUSD\",\"volume\":0.1,\"type\":0,\"price\":0.0,\"sl\":2380.0,\"tp\":2420.0,\"order\":0,\"position\":0,\"comment\":\"breakout\"}",
"status": 200,
"retcode": 10009,
"result": "Request completed order 51830031 deal 81200131",
"latency_ms": 212,
"request_id": "bot-20261003-0042",
"ip": null
},
{
"id": 4790,
"at": 1790968301004,
"kind": "signin",
"actor": "203.0.113.7",
"actor_kind": "anonymous",
"account": null,
"route": "signin",
"summary": "dashboard sign-in from 203.0.113.7 (Mozilla/5.0 ...)",
"request": null,
"status": 200,
"retcode": null,
"result": null,
"latency_ms": null,
"request_id": "7c1e2a9f4b3d8e60",
"ip": "203.0.113.7"
}
]Get connection history
/api/v1/accounts/{id}/eventsThe account's connection events, newest first: started, connected (with the broker's build and how long it had been disconnected), reconnected, lost (why: connection lost: ... with the cause, and how long it had been connected), connect_failed, login_rejected, stopped. Kept 90 days or 50,000 rows. Page with before = the id of the last row seen.
Path parameters
idstring requiredAccount id.
Query parameters
beforeintegerOnly rows with an id below this: the id of the last row of the previous page.
limitinteger default100min 1, max 1000Most rows to return, at most 1000.
Headers
X-Request-IdstringYour own id for the request, kept and echoed in the response header of the same name (and written on every log line and audit row of the request). Anything else is replaced by one the server makes.
Response 200 Events, newest first.
A JSON array of ConnectionEvent objects.
idinteger requiredRow id, increasing. Page with
before.atinteger requiredWhen it happened, unix milliseconds (UTC).
accountstring requiredAccount id.
kindstring requiredstarted when the session began; connected (reason: the broker's build) the first time it logged in and reconnected after that; lost (reason: the session's last error) when the link dropped; connect_failed or login_rejected when an attempt failed; stopped when the account was turned off or removed.
startedconnectedreconnectedlostconnect_failedlogin_rejectedstoppedreasonstring or null requiredThe build for connected and reconnected, the error for lost, connect_failed and login_rejected.
duration_msinteger or null requiredFor connected and reconnected: how long the account had been disconnected. For lost and stopped: how long it had been connected.
quiet_sinceinteger or null requiredOn a lost event cut for missed pings (0.6.0): when the first unanswered ping was sent, unix milliseconds (UTC), so when the broker went quiet; null otherwise.
Errors
- 400
bad_requestA field is missing or not valid, or the query string has a parameter the route does not take (the message names the ones it takes;key=is accepted anywhere). - 401
unauthorizedNo valid API key or session. - 403
forbiddenThe key lacks the scope, or may not use this account, or a cookie request came from another site. - 404
not_foundNo such account, symbol, ticket, key or route. - 429
too_many_requestsThis IP is locked out for 15 minutes (5 wrong passwords or setup tokens lock it out of sign-in, 30 unknown API keys in 15 minutes lock it out of key auth), or a stream cap was hit (1,024 open streams per server, 256 per key or dashboard session), or a password check could not start (one at a time per IP, two at a time per server). Retry-After has the seconds to wait.
curl -s "$TERMLESS_URL/api/v1/accounts/pepperstone-12345678/events?limit=100" \
-H "Authorization: Bearer $TERMLESS_KEY"import os
import requests
base = os.environ["TERMLESS_URL"] + "/api/v1"
auth = {"Authorization": "Bearer " + os.environ["TERMLESS_KEY"]}
r = requests.get(f"{base}/accounts/pepperstone-12345678/events", headers=auth, params={"limit": 100})
r.raise_for_status()
print(r.json())import json
import os
import urllib.error
import urllib.request
base = os.environ["TERMLESS_URL"] + "/api/v1"
headers = {"Authorization": "Bearer " + os.environ["TERMLESS_KEY"]}
req = urllib.request.Request(f"{base}/accounts/pepperstone-12345678/events?limit=100", data=None, headers=headers, method="GET")
with urllib.request.urlopen(req, timeout=35) as r:
print(json.load(r))const base = `${process.env.TERMLESS_URL}/api/v1`;
const res = await fetch(`${base}/accounts/pepperstone-12345678/events?limit=100`, {
headers: { Authorization: `Bearer ${process.env.TERMLESS_KEY}` }
});
if (!res.ok) throw new Error((await res.json()).error.message);
console.log(await res.json());[
{
"id": 310,
"at": 1790968298412,
"account": "pepperstone-12345678",
"kind": "connected",
"reason": "build 6090",
"duration_ms": 1840,
"quiet_since": null
},
{
"id": 309,
"at": 1790968296572,
"account": "pepperstone-12345678",
"kind": "lost",
"reason": "connection lost: 2 pings unanswered in a row (the broker keeps the socket open but has stopped answering)",
"duration_ms": 73284110,
"quiet_since": 1790968282572
}
]Get the equity curve
/api/v1/accounts/{id}/equityBalance, equity, margin and profit sampled about once a minute while the account is connected (the first sample right after connecting), oldest first, for the last hours hours, and gaps: the periods in that window when the account was not connected (to: null while it still is not), so a chart can break there. Kept 7 days (168 hours). Read from the database: an account that is disconnected or turned off still shows its curve.
Path parameters
idstring requiredAccount id.
Query parameters
hoursinteger default24min 1, max 168How far back, 1 to 168.
Headers
X-Request-IdstringYour own id for the request, kept and echoed in the response header of the same name (and written on every log line and audit row of the request). Anything else is replaced by one the server makes.
Response 200 The curve.
A EquityCurve object.
accountstring requiredAccount id.
hoursinteger requiredThe window asked for, ending now.
every_sinteger requiredSeconds between samples while connected (60).
samplesarray of EquitySample requiredOldest first. About one a minute while the account is connected, the first right after it connects; none while it is not (see gaps).
EquitySample fields
atinteger requiredUnix milliseconds (UTC).
balancenumber requiredBalance.
equitynumber requiredEquity, with live profit.
marginnumber requiredMargin in use.
profitnumber requiredFloating profit of open positions.
gapsarray of EquityGap requiredOldest first: the periods inside the window when the account was not connected, read from its connection events. Draw a break there instead of a line across the outage.
EquityGap fields
frominteger requiredWhen the account stopped being connected (a lost or stopped event, the window's start if it was already down, or for a run that ended without a stop the last sample before the restart), unix milliseconds (UTC).
tointeger or null requiredWhen it connected again, unix milliseconds (UTC). null while it still is not.
Errors
- 400
bad_requestA field is missing or not valid, or the query string has a parameter the route does not take (the message names the ones it takes;key=is accepted anywhere). - 401
unauthorizedNo valid API key or session. - 403
forbiddenThe key lacks the scope, or may not use this account, or a cookie request came from another site. - 404
not_foundNo such account, symbol, ticket, key or route. - 429
too_many_requestsThis IP is locked out for 15 minutes (5 wrong passwords or setup tokens lock it out of sign-in, 30 unknown API keys in 15 minutes lock it out of key auth), or a stream cap was hit (1,024 open streams per server, 256 per key or dashboard session), or a password check could not start (one at a time per IP, two at a time per server). Retry-After has the seconds to wait.
curl -s "$TERMLESS_URL/api/v1/accounts/pepperstone-12345678/equity?hours=24" \
-H "Authorization: Bearer $TERMLESS_KEY"import os
import requests
base = os.environ["TERMLESS_URL"] + "/api/v1"
auth = {"Authorization": "Bearer " + os.environ["TERMLESS_KEY"]}
r = requests.get(f"{base}/accounts/pepperstone-12345678/equity", headers=auth, params={"hours": 24})
r.raise_for_status()
print(r.json())import json
import os
import urllib.error
import urllib.request
base = os.environ["TERMLESS_URL"] + "/api/v1"
headers = {"Authorization": "Bearer " + os.environ["TERMLESS_KEY"]}
req = urllib.request.Request(f"{base}/accounts/pepperstone-12345678/equity?hours=24", data=None, headers=headers, method="GET")
with urllib.request.urlopen(req, timeout=35) as r:
print(json.load(r))const base = `${process.env.TERMLESS_URL}/api/v1`;
const res = await fetch(`${base}/accounts/pepperstone-12345678/equity?hours=24`, {
headers: { Authorization: `Bearer ${process.env.TERMLESS_KEY}` }
});
if (!res.ok) throw new Error((await res.json()).error.message);
console.log(await res.json());{
"account": "pepperstone-12345678",
"hours": 24,
"every_s": 60,
"samples": [
{
"at": 1790977560000,
"balance": 10412.58,
"equity": 10641.2,
"margin": 878.93,
"profit": 228.62
},
{
"at": 1790977620000,
"balance": 10412.58,
"equity": 10650.69,
"margin": 878.93,
"profit": 238.11
}
],
"gaps": [
{
"from": 1790968296572,
"to": 1790968298412
}
]
}See a key's traffic
/api/v1/keys/{id}/trafficOne key's last requests, newest first (a ring of the last 500, in memory since the server started), each with its route template, path and query (key= removed), status, time, bytes and address, and its open streams with what they have sent.
Path parameters
idstring requiredKey id.
Query parameters
limitinteger default100min 1, max 500Most requests to return, at most 500.
Headers
X-Request-IdstringYour own id for the request, kept and echoed in the response header of the same name (and written on every log line and audit row of the request). Anything else is replaced by one the server makes.
Response 200 The key's traffic.
A KeyTrafficLog object.
key_idstring requiredKey id.
namestring requiredKey name.
time_msinteger requiredNow, unix milliseconds (UTC).
since_msinteger requiredWhen the server started.
requestsarray of TrafficRequest requiredIts last requests, newest first (up to 500 are kept).
TrafficRequest fields
atinteger requiredWhen it was answered, unix milliseconds (UTC).
methodstring requiredHTTP method.
routestring requiredMethod and the route template it matched, for example GET /api/v1/accounts/{id}/quotes; (no route) when none matched.
pathstring requiredThe path asked for, with its query (key= removed, cut to 300 characters).
statusinteger requiredHTTP status answered.
latency_msnumber requiredTime to the response's headers, milliseconds.
bytesinteger requiredResponse body bytes (0 for a stream; see its own counters).
ipstring requiredThe client's address.
accountstring or null requiredThe account in the path, if any.
streamsarray of StreamConnection requiredIts open streams.
StreamConnection fields
idinteger requiredA number for the stream, unique until the server restarts.
kindstring requiredsse for /stream, ws for /ws.
ssewswhoobject requiredFields
kindstring requiredkey, or dashboard for the dashboard's own streams.
keydashboardkey_idstringThe key's id (absent for the dashboard).
namestring requiredThe key's name, or dashboard.
ipstring requiredThe client's address (behind --trust-proxy, the proxy header's).
user_agentstring requiredThe client's User-Agent (cut to 200 characters).
accountstring requiredThe account streamed.
symbolsarray of string requiredThe symbols it receives ticks for (they change with WebSocket subscribe and unsubscribe).
eventsarray of string requiredWhat it asked for with events=.
ticksbarstradesaccountpositionsordersbatch_msinteger requiredSSE batch window asked for; 0 writes every frame at once.
opened_atinteger requiredWhen it opened, unix milliseconds (UTC).
sentobject requiredFields
messagesinteger requiredEverything delivered except heartbeats: ticks, events and the rest (status, subscribed, command answers).
bytesinteger requiredBytes written, heartbeats included.
ticksinteger requiredTick messages.
eventsinteger requiredtrade, account, positions and orders messages.
last_sent_atinteger or null requiredWhen the last message went out, unix milliseconds (UTC), to about 0.1 s. null before the first.
rate_per_snumber requiredMessages a second over the last 10 s (or over the stream's life when it is younger).
coalescedinteger requiredTicks this stream never saw because it fell behind (the newest per symbol was kept).
Errors
- 400
bad_requestA field is missing or not valid, or the query string has a parameter the route does not take (the message names the ones it takes;key=is accepted anywhere). - 401
unauthorizedNo valid API key or session. - 403
forbiddenThe key lacks the scope, or may not use this account, or a cookie request came from another site. - 404
not_foundNo such account, symbol, ticket, key or route. - 429
too_many_requestsThis IP is locked out for 15 minutes (5 wrong passwords or setup tokens lock it out of sign-in, 30 unknown API keys in 15 minutes lock it out of key auth), or a stream cap was hit (1,024 open streams per server, 256 per key or dashboard session), or a password check could not start (one at a time per IP, two at a time per server). Retry-After has the seconds to wait.
curl -s "$TERMLESS_URL/api/v1/keys/key_3f9a1c07/traffic?limit=100" \
-H "Authorization: Bearer $TERMLESS_KEY"import os
import requests
base = os.environ["TERMLESS_URL"] + "/api/v1"
auth = {"Authorization": "Bearer " + os.environ["TERMLESS_KEY"]}
r = requests.get(f"{base}/keys/key_3f9a1c07/traffic", headers=auth, params={"limit": 100})
r.raise_for_status()
print(r.json())import json
import os
import urllib.error
import urllib.request
base = os.environ["TERMLESS_URL"] + "/api/v1"
headers = {"Authorization": "Bearer " + os.environ["TERMLESS_KEY"]}
req = urllib.request.Request(f"{base}/keys/key_3f9a1c07/traffic?limit=100", data=None, headers=headers, method="GET")
with urllib.request.urlopen(req, timeout=35) as r:
print(json.load(r))const base = `${process.env.TERMLESS_URL}/api/v1`;
const res = await fetch(`${base}/keys/key_3f9a1c07/traffic?limit=100`, {
headers: { Authorization: `Bearer ${process.env.TERMLESS_KEY}` }
});
if (!res.ok) throw new Error((await res.json()).error.message);
console.log(await res.json());{
"key_id": "key_3f9a1c07",
"name": "EA bridge (gold)",
"time_ms": 1790981179473,
"since_ms": 1790968290000,
"requests": [
{
"at": 1790981175002,
"method": "GET",
"route": "GET /api/v1/accounts/{id}/positions",
"path": "/api/v1/accounts/pepperstone-12345678/positions?symbol=XAUUSD",
"status": 200,
"latency_ms": 0.21,
"bytes": 812,
"ip": "203.0.113.7",
"account": "pepperstone-12345678"
}
],
"streams": [
{
"id": 12,
"kind": "sse",
"who": {
"kind": "key",
"key_id": "key_3f9a1c07",
"name": "EA bridge (gold)"
},
"ip": "203.0.113.7",
"user_agent": "python-requests/2.32",
"account": "pepperstone-12345678",
"symbols": [
"XAUUSD",
"EURUSD"
],
"events": [
"ticks",
"trades",
"account"
],
"batch_ms": 0,
"opened_at": 1790977520000,
"sent": {
"messages": 52811,
"bytes": 6203417,
"ticks": 52102,
"events": 708
},
"last_sent_at": 1790981179401,
"rate_per_s": 14.6,
"coalesced": 0
}
]
}See who is connected
/api/v1/connectionsWhat leaves the server and to whom, live: every open stream (who opened it, from where, for which account, symbols and events, and what it has sent, with its rate over the last 10 s), every key's requests (1 h and 24 h counts, errors, bytes, busiest routes, last request; zeros when unused) and the dashboard's, counted apart. In memory since the server started (since_ms); nothing is persisted and key secrets never appear.
Headers
X-Request-IdstringYour own id for the request, kept and echoed in the response header of the same name (and written on every log line and audit row of the request). Anything else is replaced by one the server makes.
Response 200 Connections.
A Connections object.
time_msinteger requiredNow, unix milliseconds (UTC).
since_msinteger requiredWhen the server started: every counter here begins then; nothing is kept across a restart.
streamsarray of StreamConnection requiredOpen streams, newest first.
StreamConnection fields
idinteger requiredA number for the stream, unique until the server restarts.
kindstring requiredsse for /stream, ws for /ws.
ssewswhoobject requiredFields
kindstring requiredkey, or dashboard for the dashboard's own streams.
keydashboardkey_idstringThe key's id (absent for the dashboard).
namestring requiredThe key's name, or dashboard.
ipstring requiredThe client's address (behind --trust-proxy, the proxy header's).
user_agentstring requiredThe client's User-Agent (cut to 200 characters).
accountstring requiredThe account streamed.
symbolsarray of string requiredThe symbols it receives ticks for (they change with WebSocket subscribe and unsubscribe).
eventsarray of string requiredWhat it asked for with events=.
ticksbarstradesaccountpositionsordersbatch_msinteger requiredSSE batch window asked for; 0 writes every frame at once.
opened_atinteger requiredWhen it opened, unix milliseconds (UTC).
sentobject requiredFields
messagesinteger requiredEverything delivered except heartbeats: ticks, events and the rest (status, subscribed, command answers).
bytesinteger requiredBytes written, heartbeats included.
ticksinteger requiredTick messages.
eventsinteger requiredtrade, account, positions and orders messages.
last_sent_atinteger or null requiredWhen the last message went out, unix milliseconds (UTC), to about 0.1 s. null before the first.
rate_per_snumber requiredMessages a second over the last 10 s (or over the stream's life when it is younger).
coalescedinteger requiredTicks this stream never saw because it fell behind (the newest per symbol was kept).
keysarray of KeyTraffic requiredEvery key in the keys table.
KeyTraffic fields
key_idstring requiredKey id.
namestring requiredKey name.
scopestring requiredread, trade or admin.
readtradeadminaccountsarray or null requiredAccounts it is limited to; null = every account.
streams_openinteger requiredStreams it has open now.
stream_bytesinteger requiredBytes its open streams have sent.
requests_1hinteger requiredRequests in the last hour.
requests_24hinteger requiredRequests in the last 24 hours (since the start, if that is later).
errors_1hinteger requiredRequests in the last hour answered 400 or above.
bytes_out_1hinteger requiredResponse body bytes in the last hour (streams not included).
last_request_atinteger or null requiredIts last request, unix milliseconds (UTC). null if none since the start.
last_ipstring or null requiredThe address of its last request.
top_routes_1harray of object requiredIts busiest routes in the last hour, at most 5.
Fields
routestring requiredMethod and route template.
countinteger requiredRequests in the last hour.
dashboardobject requiredFields
sessions_activeinteger requiredDashboard sessions signed in.
streams_openinteger requiredStreams the dashboard has open.
stream_bytesinteger requiredBytes those streams have sent.
requests_1hinteger requiredDashboard requests in the last hour.
requests_24hinteger requiredDashboard requests in the last 24 hours.
errors_1hinteger requiredOf them, answered 400 or above.
bytes_out_1hinteger requiredResponse body bytes in the last hour.
last_request_atinteger or null requiredThe dashboard's last request, unix milliseconds (UTC).
Errors
- 400
bad_requestA field is missing or not valid, or the query string has a parameter the route does not take (the message names the ones it takes;key=is accepted anywhere). - 401
unauthorizedNo valid API key or session. - 403
forbiddenThe key lacks the scope, or may not use this account, or a cookie request came from another site. - 429
too_many_requestsThis IP is locked out for 15 minutes (5 wrong passwords or setup tokens lock it out of sign-in, 30 unknown API keys in 15 minutes lock it out of key auth), or a stream cap was hit (1,024 open streams per server, 256 per key or dashboard session), or a password check could not start (one at a time per IP, two at a time per server). Retry-After has the seconds to wait.
curl -s "$TERMLESS_URL/api/v1/connections" \
-H "Authorization: Bearer $TERMLESS_KEY"import os
import requests
base = os.environ["TERMLESS_URL"] + "/api/v1"
auth = {"Authorization": "Bearer " + os.environ["TERMLESS_KEY"]}
r = requests.get(f"{base}/connections", headers=auth)
r.raise_for_status()
print(r.json())import json
import os
import urllib.error
import urllib.request
base = os.environ["TERMLESS_URL"] + "/api/v1"
headers = {"Authorization": "Bearer " + os.environ["TERMLESS_KEY"]}
req = urllib.request.Request(f"{base}/connections", data=None, headers=headers, method="GET")
with urllib.request.urlopen(req, timeout=35) as r:
print(json.load(r))const base = `${process.env.TERMLESS_URL}/api/v1`;
const res = await fetch(`${base}/connections`, {
headers: { Authorization: `Bearer ${process.env.TERMLESS_KEY}` }
});
if (!res.ok) throw new Error((await res.json()).error.message);
console.log(await res.json());{
"time_ms": 1790981179473,
"since_ms": 1790968290000,
"streams": [
{
"id": 12,
"kind": "sse",
"who": {
"kind": "key",
"key_id": "key_3f9a1c07",
"name": "EA bridge (gold)"
},
"ip": "203.0.113.7",
"user_agent": "python-requests/2.32",
"account": "pepperstone-12345678",
"symbols": [
"XAUUSD",
"EURUSD"
],
"events": [
"ticks",
"trades",
"account"
],
"batch_ms": 0,
"opened_at": 1790977520000,
"sent": {
"messages": 52811,
"bytes": 6203417,
"ticks": 52102,
"events": 708
},
"last_sent_at": 1790981179401,
"rate_per_s": 14.6,
"coalesced": 0
}
],
"keys": [
{
"key_id": "key_3f9a1c07",
"name": "EA bridge (gold)",
"scope": "trade",
"accounts": [
"pepperstone-12345678"
],
"streams_open": 1,
"stream_bytes": 6203417,
"requests_1h": 120,
"requests_24h": 2211,
"errors_1h": 0,
"bytes_out_1h": 48210,
"last_request_at": 1790981175002,
"last_ip": "203.0.113.7",
"top_routes_1h": [
{
"route": "GET /api/v1/accounts/{id}/positions",
"count": 60
},
{
"route": "GET /api/v1/accounts/{id}/deals",
"count": 60
}
]
}
],
"dashboard": {
"sessions_active": 1,
"streams_open": 0,
"stream_bytes": 0,
"requests_1h": 340,
"requests_24h": 1902,
"errors_1h": 0,
"bytes_out_1h": 912044,
"last_request_at": 1790981179470
}
}