View as Markdown

API reference / Native /v1

Private servers

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/private-servers

List private servers Auth: X-API-Key

List your private servers and the accounts on each one.

Responses

  • 200 Your private servers. · PrivateServer[]
  • 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/private-servers' \
  -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/private-servers",
    )
    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/private-servers");
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/private-servers

Buy a private server Idempotency-Key Auth: X-API-Key

Buy a private server with a dedicated address, paid from the wallet. The price depends on the number of slots. See the regions route for prices. A balance that is too low answers 402 insufficient_balance and charges nothing. Send Idempotency-Key to make a retry safe: a replay never charges twice.

Parameters of POST /v1/private-servers
ParameterInTypeDescription
Idempotency-Keyheaderstring | null

Request body CreatePrivateServer required

Request body fields of POST /v1/private-servers
FieldTypeDescription
slots requiredinteger
region requiredstring
name requiredstring

Responses

  • 201 The new private server. · PrivateServer
  • 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
  • 402 The wallet balance is too low (insufficient_balance). shortfall_eur_cents says how much is missing. Nothing was charged. · 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/private-servers' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Idempotency-Key: my-request-1' \
  -H 'Content-Type: application/json' \
  -d '{"slots":1,"region":"eu","name":"example"}'

Python

from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "POST",
        "/v1/private-servers",
        json={"slots": 1, "region": "eu", "name": "example"},
        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/private-servers", {
  body: {"slots":1,"region":"eu","name":"example"},
  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/private-servers/regions

List private server regions Auth: X-API-Key

List the regions where a private server can run. Also gives the slot limits and the price of the first and each extra slot, in euro cents.

Responses

  • 200 Regions, limits and prices. · Regions
  • 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/private-servers/regions' \
  -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/private-servers/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", "/v1/private-servers/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 /v1/private-servers/{server_id}

Get a private server Auth: X-API-Key

Get one private server, its address and its accounts.

Parameters of GET /v1/private-servers/{server_id}
ParameterInTypeDescription
server_id requiredpathstring

Responses

  • 200 The private server. · PrivateServer
  • 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/private-servers/SERVER_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/private-servers/SERVER_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/private-servers/SERVER_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/private-servers/{server_id}

Resize a private server Auth: X-API-Key

Change the number of slots on a private server. Extra slots are paid from the wallet. You cannot go below the slots in use.

Parameters of PATCH /v1/private-servers/{server_id}
ParameterInTypeDescription
server_id requiredpathstring

Request body PatchPrivateServer required

Request body fields of PATCH /v1/private-servers/{server_id}
FieldTypeDescription
slots requiredinteger

Responses

  • 200 The resized private server. · PrivateServer
  • 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
  • 402 The wallet balance is too low (insufficient_balance). shortfall_eur_cents says how much is missing. Nothing was charged. · 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/private-servers/SERVER_ID' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"slots":1}'

Python

from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "PATCH",
        "/v1/private-servers/SERVER_ID",
        json={"slots": 1},
        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/private-servers/SERVER_ID", {
  body: {"slots":1},
  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/private-servers/{server_id}

Cancel a private server Auth: X-API-Key

Cancel a private server. Its accounts are disconnected first. The dedicated address is released and never given to anyone else.

Parameters of DELETE /v1/private-servers/{server_id}
ParameterInTypeDescription
server_id requiredpathstring

Responses

  • 204 The private server was cancelled.
  • 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/private-servers/SERVER_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/private-servers/SERVER_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/private-servers/SERVER_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.

POST /v1/private-servers/{server_id}/accounts

Add an account to a private server Idempotency-Key Auth: X-API-Key

Link a new account on this private server. It uses one slot. The account gets the server's dedicated address (ip_mode: dedicated). Send Idempotency-Key to make a retry safe. trade_ea_symbol follows the same rule as POST /accounts.

Parameters of POST /v1/private-servers/{server_id}/accounts
ParameterInTypeDescription
server_id requiredpathstring
Idempotency-Keyheaderstring | null

Request body PrivateServerAddAccount required

Request body fields of POST /v1/private-servers/{server_id}/accounts
FieldTypeDescription
platform"mt4" | "mt5"
server requiredstring
login requiredinteger
password requiredstring
nicknamestring
trade_ea_symbolstring

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
  • 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 POST 'https://api.tickwire.io/v1/private-servers/SERVER_ID/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":""}'

Python

from tickwire import Tickwire

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

Remove an account from a private server Auth: X-API-Key

Remove an account from a private server and free its slot.

Parameters of DELETE /v1/private-servers/{server_id}/accounts/{account_id}
ParameterInTypeDescription
server_id requiredpathstring
account_id requiredpathstring

Responses

  • 204 The account was removed.
  • 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/private-servers/SERVER_ID/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/private-servers/SERVER_ID/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/private-servers/SERVER_ID/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.