API reference / Account REST API (/users/current)
Tokens and discovery
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.
POST /users/current/narrow-down-auth-token
Narrow down an auth token Idempotency-Key Auth: auth-token
Mint a shorter-lived token with fewer applications, roles or accounts than the
calling credential (default validity 24 hours). A replay with the same Idempotency-
Key mints nothing and returns token: null.
| Parameter | In | Type | Description |
|---|---|---|---|
validity-in-hours | query | number | |
Idempotency-Key | header | string | null | Optional; replays the first answer |
X-Actor | header | string | null | Who is acting (audit log) |
X-Reason | header | string | null | Why (audit log; percent-encode non-ASCII) |
Responses
200Successful Response400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope409Conflict: the Idempotency-Key was used with another body, a request with the same key is still running, or the resource is in a state that does not allow this. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error409idempotency_conflict
curl
curl -sS -X POST 'https://api.tickwire.io/users/current/narrow-down-auth-token' \
-H 'auth-token: YOUR_API_KEY' \
-H 'Idempotency-Key: my-request-1' \
-H 'X-Actor: my-app' \
-H 'X-Reason: why you are doing this' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"POST",
"/users/current/narrow-down-auth-token",
idempotency_key="my-request-1",
actor="my-app",
reason="why you are doing this",
)
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("POST", "/users/current/narrow-down-auth-token", {
idempotencyKey: "my-request-1",
actor: "my-app",
reason: "why you are doing this",
});
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/regions
List regions Auth: auth-token
The region ids accounts can be deployed in, for example ["frankfurt", "london"].
The region ids accounts can be deployed in, for example ["frankfurt", "london"].
Responses
200Successful Response ·string[]400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/regions' \
-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/regions",
)
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/regions");
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/servers/mt-client-api
Get the client API domain Auth: auth-token
{hostname, domain}: SDKs build trading URLs as
https://{hostname}.{region}.{domain}.
Responses
200Successful Response ·object400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/servers/mt-client-api' \
-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/servers/mt-client-api",
)
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/servers/mt-client-api");
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/tokens
List tokens Auth: auth-token
The tokens this credential may manage: scope, expiry, last use and revocation. Token values are never returned.
Responses
200Successful Response400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope409Conflict: the Idempotency-Key was used with another body, a request with the same key is still running, or the resource is in a state that does not allow this. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/tokens' \
-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/tokens",
)
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/tokens");
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.
POST /users/current/tokens
Create a token Idempotency-Key Auth: auth-token
Mint a token narrowed from the calling credential; 201 with the token value, which is
shown only in this answer. A replay with the same Idempotency-Key mints nothing and
returns token: null.
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | null |
Request body NewToken required
| Field | Type | Description |
|---|---|---|
name | string | |
kind | "api" | "account" | |
applications | string[] | null | |
roles | string[] | null | |
accountIds | string[] | null | |
readOnly | boolean | |
ttlInHours | number | null | |
ipAllowlist | string[] | null |
Responses
201Successful Response400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope409Conflict: the Idempotency-Key was used with another body, a request with the same key is still running, or the resource is in a state that does not allow this. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error409idempotency_conflict
curl
curl -sS -X POST 'https://api.tickwire.io/users/current/tokens' \
-H 'auth-token: YOUR_API_KEY' \
-H 'Idempotency-Key: my-request-1' \
-H 'Content-Type: application/json' \
-d '{"name":"","kind":"api","readOnly":false}' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"POST",
"/users/current/tokens",
json={"name": "", "kind": "api", "readOnly": False},
idempotency_key="my-request-1",
reason="why you are doing this",
)
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("POST", "/users/current/tokens", {
body: {"name":"","kind":"api","readOnly":false},
idempotencyKey: "my-request-1",
reason: "why you are doing this",
});
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/tokens/{token_id}
Get a token Auth: auth-token
One token's metadata: scope, expiry, last use and revocation. The token value is never returned.
| Parameter | In | Type | Description |
|---|---|---|---|
token_id required | path | string |
Responses
200Successful Response400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope409Conflict: the Idempotency-Key was used with another body, a request with the same key is still running, or the resource is in a state that does not allow this. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error
curl
curl -sS -X GET 'https://api.tickwire.io/users/current/tokens/TOKEN_ID' \
-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/tokens/TOKEN_ID",
)
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/tokens/TOKEN_ID");
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.
PATCH /users/current/tokens/{token_id}
Update a token Auth: auth-token
Rename a token or narrow its IP allowlist. The allowlist can only be narrowed within the caller's own.
| Parameter | In | Type | Description |
|---|---|---|---|
token_id required | path | string |
Request body PatchToken required
| Field | Type | Description |
|---|---|---|
name | string | null | |
ipAllowlist | string[] | null |
Responses
200Successful Response400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope409Conflict: the Idempotency-Key was used with another body, a request with the same key is still running, or the resource is in a state that does not allow this. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error
curl
curl -sS -X PATCH 'https://api.tickwire.io/users/current/tokens/TOKEN_ID' \
-H 'auth-token: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{}' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"PATCH",
"/users/current/tokens/TOKEN_ID",
json={},
idempotency_key="my-request-1",
reason="why you are doing this",
)
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("PATCH", "/users/current/tokens/TOKEN_ID", {
body: {},
idempotencyKey: "my-request-1",
reason: "why you are doing this",
});
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.
DELETE /users/current/tokens/{token_id}
Revoke a token Auth: auth-token
Revoke a token (204). Every token narrowed from it is revoked too.
| Parameter | In | Type | Description |
|---|---|---|---|
token_id required | path | string |
Responses
204Successful Response400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope409Conflict: the Idempotency-Key was used with another body, a request with the same key is still running, or the resource is in a state that does not allow this. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error
curl
curl -sS -X DELETE 'https://api.tickwire.io/users/current/tokens/TOKEN_ID' \
-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(
"DELETE",
"/users/current/tokens/TOKEN_ID",
idempotency_key="my-request-1",
reason="why you are doing this",
)
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("DELETE", "/users/current/tokens/TOKEN_ID", {
idempotencyKey: "my-request-1",
reason: "why you are doing this",
});
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 /v1/access-rule-manifest
Get the access rule manifest Auth: X-API-Key
The applications, roles and method groups this deployment serves, for building narrowed tokens.
Responses
200Successful Response400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope409Conflict: the Idempotency-Key was used with another body, a request with the same key is still running, or the resource is in a state that does not allow this. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error
curl
curl -sS -X GET 'https://api.tickwire.io/v1/access-rule-manifest' \
-H 'X-API-Key: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/v1/access-rule-manifest",
)
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", "/v1/access-rule-manifest");
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 /v1/known-mt-servers/{version}/search
Search known MT servers Auth: X-API-Key
Broker server names matching query, grouped by broker: {"<broker>": ["Server-
Demo", ...]}. version is 4 or 5.
| Parameter | In | Type | Description |
|---|---|---|---|
version required | path | integer | |
query | query | string |
Responses
200Successful Response ·object400Bad request. On the account API paths a body or query validation failure is a 400ValidationErrorwithdetails: [{parameter, message}]. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error
curl
curl -sS -X GET 'https://api.tickwire.io/v1/known-mt-servers/5/search' \
-H 'X-API-Key: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/v1/known-mt-servers/5/search",
)
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", "/v1/known-mt-servers/5/search");
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.