List your sessions, by user, label or status
/sessions- Base URL
https://api.chartnaut.com/partner/v1- Auth
- Bearer key
- Operation ID
listSessions
Newest first (by when you created them). Only sessions you created, for users who are still
linked and grant sessions:read. With user, needs that user's sessions:read. Labels
filter with label.<key>=<value> (several are ANDed), e.g.
?label.event=nov-open&label.round=2.
List items are summaries (SessionSummary): account has only currency, balance and
realized_pnl (no equity or open P&L), and stats counts trades only. There are no
open_positions, working_orders, rules or breaches. Read GET /sessions/{session}
for those.
Query parameters#
userstringusr_<id> or ext:<external_user_ref>.
labelmap of stringDeep objectWritten label.<key>=<value> (not label[key]), e.g. ?label.event=nov-open. Several are
ANDed; values match exactly. A key given twice, or one that breaks the label key rules, is
400 invalid_request.
statusstring · SubjectStatusactive; locked (by you or Chartnaut; a demo account also locks when its user unlinks);
and the final ones: ended (you, the user, Chartnaut or a session's time cap ended it;
status_reason says who), breached (a close_and_end rule fired),
completed_to_target (the profit target was reached; everything was closed). A
block_order breach refuses new orders but leaves the status active.
cursorstringOpaque cursor from a previous page's next_cursor on the same list. Anything else is 400 invalid_request.
limitintegerItems a page. Above your page_size limit (200) it is cut to it; zero, negative or not a number means the default.
Responses#
200OKapplication/json
A page of sessions.
Includes Page
next_cursorstringRequiredNullableShow item fields
Includes SessionCommon
idstringRequireduserstringRequiredexternal_user_refstringYour ref for the user; left out when the user is no longer linked.
external_refstringRequiredNullableA session's labels: up to 20; keys 1–64 letters, digits or _ . : -; string values up to 200 characters. Never interpreted; filter on them with label.<key>=<value>.
namestringRequiredactive; locked (by you or Chartnaut; a demo account also locks when its user unlinks);
and the final ones: ended (you, the user, Chartnaut or a session's time cap ended it;
status_reason says who), breached (a close_and_end rule fired),
completed_to_target (the profit target was reached; everything was closed). A
block_order breach refuses new orders but leaves the status active.
status_reasonstringRequiredWho set the status (e.g. partner, admin, rule, time_cap); empty when nobody has.
created_atstring (date-time)Requiredlocked_atstring (date-time)Left out when not locked.
ended_atstring (date-time)Left out until it ends.
replay_timestring (date-time)RequiredNullableThe replay clock as last saved.
locked_replay_timestring (date-time)Where a lock or end froze the replay. Left out otherwise.
startstring (date-time)Where the replay begins.
endstring (date-time)NullableWhere the replay stops; null when the session plays on to the latest data.
dayobjectRequiredDeprecatedThe same window as start and end, under its older name.
Show fields
startstring (date-time)Requiredendstring (date-time)RequiredNullableinstrumentsarray of stringRequiredA decimal amount in the account currency (USD), at most two decimal places.
currencystringRequiredleveragenumberRequiredcommissionobject · CommissionCharged per side on every market: fixed per unit (lot, contract, share; 0–1,000), or percentage of the side's notional (0–100).
Show fields
typestringRequiredvaluenumberRequiredtime_cap_minutesintegerLeft out when there is no cap.
opened_atstring (date-time)When a page first opened it (the time cap runs from here). Left out until then.
time_cap_ends_atstring (date-time)Left out without a cap or before the first open.
blindbooleanRequiredallow_skipbooleanRequiredWhat the developer's page may drive in this session through the terminal SDK: none (the default), replay (play, pause, step, speed, jump, hold) or replay_and_orders (also place orders).
accountobjectRequiredClosed trades only.
Show fields
tradesintegerRequiredwinsintegerRequiredlossesintegerRequiredwin_ratenumberRequiredgross_profitnumberRequiredgross_lossnumberRequirednet_pnlnumberRequiredprofit_factornumberRequiredNullableaverage_winnumberRequiredaverage_lossnumberRequiredlargest_winnumberRequiredlargest_lossnumberRequiredmax_drawdownnumberRequiredmax_drawdown_pctnumberRequiredErrorAny other statusapplication/json
Error. Every response to a request whose key checked out, errors included, carries
RateLimit-Limit (requests a minute), RateLimit-Remaining and RateLimit-Reset (seconds
until the minute resets). A 401, the 403 switched_off when the whole API is off for
you, and the 429 for too many bad keys from one IP come before that check and carry
none. A 429 also carries Retry-After (seconds).
Headers
RateLimit-LimitintegerRateLimit-RemainingintegerRateLimit-ResetintegerRetry-AfterintegerBody
Show fields
codestringRequiredStable. Branch on this, never on message.
| Code | Status | Meaning |
|---|---|---|
unauthorized |
401 | missing, unknown or revoked key (no RateLimit headers) |
scope_not_granted |
403 | the user didn't grant details.scope |
forbidden |
403 | your partner account isn't allowed this (details.reason, e.g. no_access for frame:live when live mode isn't enabled for you; details.scope) |
permission_denied |
403 | this key lacks the key permission the call needs (details.permission, e.g. users:export; details.reason: "key_permission"): use a key that has it, or add it in the partner portal |
not_managed |
409 | the call is for managed users only, and this user is linked (their own Chartnaut account and plan apply; details.reason: "not_managed") |
switched_off |
403 | this part of the API is paused for you (everything, writes, frames, links, demo account creation, bulk actions); contact [email protected] |
not_linked |
404 | the user isn't linked to you (details.user when the user was named in the request) |
not_found |
404 | no such object for you; an id of the wrong type or shape is this too |
conflict |
409 | external_ref already used (sessions: details.existing_id; accounts: details.field); the same Idempotency-Key still running; lock or unlock on an ended session |
expected_count_mismatch |
409 | a bulk action matched a different number (details.expected, details.actual) |
invalid_request |
400 | malformed body or unknown field (named in message, no details), a bad field (details.field where the endpoint names it), bad id, missing Idempotency-Key, invalid rules. Also 413 for a body over 2 MiB |
idempotency_key_reused |
422 | the Idempotency-Key was used with a different path or body |
plan_limit |
422 / 403 | the user's Chartnaut plan doesn't allow it (details.reason), or your developer plan's cap (details.owner: "developer", details.limit: apps (an app past your plan's count after a downgrade takes no new users), free_linked, managed_users, data; with used, cap). No auto top-up: upgrade on the Developers page |
seat_limit |
403 | your Business seats are full this month (details.limit seats or pro_seats, used, cap): a new managed user can't start until you add seats; users active this month carry on |
partner_limit |
422 | one of your partner limits (details.limit, and for demo accounts details.max) |
rate_limited |
429 | your rate limit: details.limit is rate_minute or rate_burst. Also, with no details and Retry-After: 60, any call from an IP that sent 30 bad keys this minute, good keys included. See Retry-After |
internal |
500 | retry; if it persists contact [email protected] |
messagestringRequireddetailsobject