API reference / Account REST API (/users/current)
Health, snapshot and audit trail
Account REST API (/users/current). Generated from the OpenAPI document the services export (/openapi.json).
Samples use the placeholders YOUR_API_KEY and YOUR_ACCOUNT_ID.
Paste a sandbox key (twsk_…) to fill them in and to use Try it.
It stays in this browser tab and is only sent to the sandbox, never to the live API.
Try it is off in this build: No sandbox URL is configured for this build of the docs.
GET /users/current/accounts/{account_id}/audit
Account Audit Auth: auth-token
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
limit | query | integer |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error404account_not_found503not_connected
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/audit' \
-H 'auth-token: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/users/current/accounts/YOUR_ACCOUNT_ID/audit",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/audit");
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
GET /users/current/accounts/{account_id}/health
Account Health Auth: auth-token
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error404account_not_found503not_connected
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/health' \
-H 'auth-token: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/users/current/accounts/YOUR_ACCOUNT_ID/health",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/health");
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
GET /users/current/accounts/{account_id}/snapshot
Account Snapshot Auth: auth-token
Account information, positions, orders, health and server time in one
read (MT4 and MT5). Agents reach it as GET /v1/agent/accounts/{id}/snapshot.
Body: {account_id, platform, as_of, complete, terminal_connected,
account_information, positions, orders, health, server_time}. as_of is
when the snapshot was complete (UTC); complete is true when every section
is ok; terminal_connected is null when it is not known.
Each section is {status, read_at, age_ms, data, error?}. status is
ok (read from a terminal connected to its broker), stale (read, but
the terminal was not connected, so values may be out of date) or
unavailable (data is null and error is {error, message});
health and server_time are ok whenever they could be read.
Sections are read one after another: compare read_at when that matters.
data has the same shape as the individual routes; server_time gives
brokerUtcOffsetMinutes (null until known, never assumed to be 0).
Always 200 (an unreadable section says so); 503 only if nothing could be read.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Successful Response422Validation Error ·HTTPValidationError
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error404account_not_found503not_connected
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/accounts/YOUR_ACCOUNT_ID/snapshot' \
-H 'auth-token: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/users/current/accounts/YOUR_ACCOUNT_ID/snapshot",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/users/current/accounts/YOUR_ACCOUNT_ID/snapshot");
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.