View as Markdown

API reference / Native /v1

Accounts

Native /v1. 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 /v1/accounts

List accounts Auth: X-API-Key

List the trading accounts this key can see. A key limited to some accounts sees only those.

Responses

  • 200 The accounts this key can see. · LinkedAccount[]
  • 401 No credential was sent, or it is not valid or has expired. · ErrorEnvelope
  • 403 The 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. · ErrorEnvelope
  • 429 Too many requests. Wait the Retry-After seconds, then try again. · ErrorEnvelope

Errors (common for this kind of call; every error uses one envelope)

curl

curl -sS -X GET 'https://api.tickwire.io/v1/accounts' \
  -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/accounts",
    )
    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/accounts");
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 /v1/accounts

Link an account Idempotency-Key Auth: X-API-Key

Link an MT4 or MT5 account by login, password and server. The account starts as connecting. The password is never returned. Send Idempotency-Key to make a retry safe: a replay answers the first result. trade_ea_symbol is one word of at most 32 printable characters (400 invalid_chart_symbol otherwise, before anything is linked).

Parameters of POST /v1/accounts
ParameterInTypeDescription
Idempotency-Keyheaderstring | null

Request body CreateAccount required

Request body fields of POST /v1/accounts
FieldTypeDescription
platform"mt4" | "mt5"
server requiredstring
login requiredinteger
password requiredstring
nicknamestring
trade_ea_symbolstring
proxy_addressstring
proxy_typestring
proxy_authstring
proxy_local_portinteger

Responses

  • 201 The new account. · LinkedAccount
  • 400 Bad request: a header or the body is not valid. · ErrorEnvelope
  • 401 No credential was sent, or it is not valid or has expired. · ErrorEnvelope
  • 403 The 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. · ErrorEnvelope
  • 409 Conflict: 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. · ErrorEnvelope
  • 422 A path, query or body parameter is not valid. details lists each one. · ErrorEnvelope
  • 429 Too many requests. Wait the Retry-After seconds, then try again. · ErrorEnvelope

Errors (common for this kind of call; every error uses one envelope)

curl

curl -sS -X POST 'https://api.tickwire.io/v1/accounts' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Idempotency-Key: my-request-1' \
  -H 'Content-Type: application/json' \
  -d '{"platform":"mt5","server":"Tickwire-Sandbox","login":1,"password":"YOUR_PASSWORD","nickname":"","trade_ea_symbol":"","proxy_address":"","proxy_type":"","proxy_auth":"","proxy_local_port":0}'

Python

from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "POST",
        "/v1/accounts",
        json={
            "platform": "mt5",
            "server": "Tickwire-Sandbox",
            "login": 1,
            "password": "YOUR_PASSWORD",
            "nickname": "",
            "trade_ea_symbol": "",
            "proxy_address": "",
            "proxy_type": "",
            "proxy_auth": "",
            "proxy_local_port": 0,
        },
        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", "/v1/accounts", {
  body: {
    "platform": "mt5",
    "server": "Tickwire-Sandbox",
    "login": 1,
    "password": "YOUR_PASSWORD",
    "nickname": "",
    "trade_ea_symbol": "",
    "proxy_address": "",
    "proxy_type": "",
    "proxy_auth": "",
    "proxy_local_port": 0
  },
  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/accounts/{account_id}

Get an account Auth: X-API-Key

Get one linked account and its current status.

Parameters of GET /v1/accounts/{account_id}
ParameterInTypeDescription
account_id requiredpathstring

Responses

  • 200 The account. · LinkedAccount
  • 401 No credential was sent, or it is not valid or has expired. · ErrorEnvelope
  • 403 The 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. · ErrorEnvelope
  • 404 The account or resource in the path does not exist, or this credential cannot see it. · ErrorEnvelope
  • 429 Too many requests. Wait the Retry-After seconds, then try again. · ErrorEnvelope

Errors (common for this kind of call; every error uses one envelope)

curl

curl -sS -X GET 'https://api.tickwire.io/v1/accounts/YOUR_ACCOUNT_ID' \
  -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/accounts/YOUR_ACCOUNT_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", "/v1/accounts/YOUR_ACCOUNT_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 /v1/accounts/{account_id}

Update an account Auth: X-API-Key

Change the account's trade_ea_symbol, the symbol its terminal opens. Nothing else can be changed here. The symbol follows the same rule as POST /accounts (400 invalid_chart_symbol, nothing saved).

Parameters of PATCH /v1/accounts/{account_id}
ParameterInTypeDescription
account_id requiredpathstring

Request body PatchAccount required

Request body fields of PATCH /v1/accounts/{account_id}
FieldTypeDescription
trade_ea_symbolstring | null

Responses

  • 200 The updated account. · LinkedAccount
  • 400 Bad request: a header or the body is not valid. · ErrorEnvelope
  • 401 No credential was sent, or it is not valid or has expired. · ErrorEnvelope
  • 403 The 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. · ErrorEnvelope
  • 404 The account or resource in the path does not exist, or this credential cannot see it. · ErrorEnvelope
  • 409 Conflict: 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. · ErrorEnvelope
  • 422 A path, query or body parameter is not valid. details lists each one. · ErrorEnvelope
  • 429 Too many requests. Wait the Retry-After seconds, then try again. · ErrorEnvelope

Errors (common for this kind of call; every error uses one envelope)

curl

curl -sS -X PATCH 'https://api.tickwire.io/v1/accounts/YOUR_ACCOUNT_ID' \
  -H 'X-API-Key: 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",
        "/v1/accounts/YOUR_ACCOUNT_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", "/v1/accounts/YOUR_ACCOUNT_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 /v1/accounts/{account_id}

Unlink an account Auth: X-API-Key

Unlink the account and stop its terminal.

Parameters of DELETE /v1/accounts/{account_id}
ParameterInTypeDescription
account_id requiredpathstring

Responses

  • 204 The account was unlinked.
  • 401 No credential was sent, or it is not valid or has expired. · ErrorEnvelope
  • 403 The 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. · ErrorEnvelope
  • 404 The account or resource in the path does not exist, or this credential cannot see it. · ErrorEnvelope
  • 409 Conflict: 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. · ErrorEnvelope
  • 429 Too many requests. Wait the Retry-After seconds, then try again. · ErrorEnvelope

Errors (common for this kind of call; every error uses one envelope)

curl

curl -sS -X DELETE 'https://api.tickwire.io/v1/accounts/YOUR_ACCOUNT_ID' \
  -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(
        "DELETE",
        "/v1/accounts/YOUR_ACCOUNT_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", "/v1/accounts/YOUR_ACCOUNT_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.