Trading Terminals
These endpoints allow you to manage your trading terminals, including creating, listing, and removing terminals.
The Terminal object
The terminal object contains all information about a MetaTrader terminal instance, including its configuration and current status.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the terminal
- Name
server_id
- Type
- string
- Description
The VPS server ID where terminal is deployed
- Name
user_id
- Type
- string
- Description
Owner user identifier
- Name
project_id
- Type
- string
- Description
Associated project identifier
- Name
name
- Type
- string
- Description
Custom name for the terminal (defaults to login)
- Name
path
- Type
- string
- Description
Terminal installation path on the server
- Name
server_name
- Type
- string
- Description
Trading server name (e.g., "ICMarketsSC-Demo")
- Name
login
- Type
- string
- Description
Trading account login ID
- Name
synced_at
- Type
- timestamp
- Description
Last synchronization timestamp
- Name
status
- Type
- integer
- Description
Current terminal status
- Name
created_at
- Type
- timestamp
- Description
Terminal creation timestamp
- Name
updated_at
- Type
- timestamp
- Description
Last update timestamp
- Name
deleted_at
- Type
- timestamp
- Description
Deletion timestamp (if terminal is deleted)
The Task object
The task object represents an operation performed on a terminal, such as installation, configuration, or management actions.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the task
- Name
user_id
- Type
- string
- Description
User who created the task
- Name
host_id
- Type
- string
- Description
VPS host identifier
- Name
terminal_id
- Type
- string
- Description
Associated terminal identifier
- Name
chart_id
- Type
- string
- Description
Chart identifier (for chart-specific tasks)
- Name
type
- Type
- integer
- Description
Task type identifier (see Task Types)
- Name
payload
- Type
- object
- Description
Task-specific parameters
- Name
result
- Type
- object
- Description
Task execution results
- Name
status
- Type
- integer
- Description
Current task status (see Task Status)
- Name
attempts
- Type
- integer
- Description
Number of execution attempts
- Name
planned_at
- Type
- timestamp
- Description
Scheduled execution time
- Name
delivered_at
- Type
- timestamp
- Description
Task delivery timestamp
- Name
started_at
- Type
- timestamp
- Description
Execution start timestamp
- Name
finished_at
- Type
- timestamp
- Description
Execution completion timestamp
- Name
created_at
- Type
- timestamp
- Description
Task creation timestamp
- Name
updated_at
- Type
- timestamp
- Description
Last update timestamp
- Name
deleted_at
- Type
- timestamp
- Description
Deletion timestamp (if task is deleted)
Task Types
The type
field indicates the type of task being performed. Here are the possible values:
- Name
TERMINAL_INSTALL (0)
- Type
- info
- Description
Install a new MetaTrader terminal
- Name
TERMINAL_DESTROY (1)
- Type
- info
- Description
Remove an existing MetaTrader terminal
- Name
EA_INSTALL (2)
- Type
- warning
- Description
Install an Expert Advisor
- Name
EA_REMOVE (3)
- Type
- warning
- Description
Remove an Expert Advisor
- Name
EA_UPDATE (4)
- Type
- warning
- Description
Update an existing Expert Advisor
- Name
EA_LOGS (5)
- Type
- warning
- Description
View logs generated by Expert Advisors
- Name
SCREENSHOT (6)
- Type
- info
- Description
Capture a screenshot
- Name
SCREENSHOT_LATENCY (7)
- Type
- info
- Description
Capture latency data in a screenshot
- Name
ACCOUNT_SERVER (8)
- Type
- success
- Description
Configure terminal servers list
- Name
ACCOUNT_LOGIN (9)
- Type
- success
- Description
Log in to an account
- Name
ACCOUNT_LOGOUT (10)
- Type
- success
- Description
Log out from the account
- Name
ACCOUNT_OPEN_DEMO (11)
- Type
- success
- Description
Create a new demo account
- Name
OPTIONS_AUTO_TRADE (12)
- Type
- info
- Description
On/Off Auto Trading (Algo Trading)
- Name
OPTIONS_WEB_REQUEST (13)
- Type
- info
- Description
Add URL to MetaTrader whitelist
- Name
MARKET_WATCH_SHOW_ALL (14)
- Type
- info
- Description
Show all symbols on MarketWatch
Task Status
The status
field indicates the current state of a task. Here are the possible values:
- Name
PENDING (0)
- Type
- info
- Description
Task is waiting to be processed
- Name
QUEUED (1)
- Type
- info
- Description
Task has been queued for execution
- Name
DELIVERED (2)
- Type
- warning
- Description
Task has been delivered to the agent
- Name
RUNNING (3)
- Type
- warning
- Description
Task is currently being executed
- Name
COMPLETED (4)
- Type
- success
- Description
Task has completed successfully
- Name
FAILED (5)
- Type
- danger
- Description
Task execution has failed
- Name
CANCELED (6)
- Type
- danger
- Description
Task has been canceled
- Name
TERMINATED (7)
- Type
- danger
- Description
Task was terminated by the system
List Trading Terminals
Retrieve a paginated list of all your trading terminals.
Optional Query Parameters
- Name
date_from
- Type
- string
- Description
Start date for filtering (format: YYYY-MM-DD).
- Name
date_to
- Type
- string
- Description
End date for filtering (format: YYYY-MM-DD).
- Name
per_page
- Type
- integer
- Description
Number of items per page (1-100). Defaults to 10.
- Name
page
- Type
- integer
- Description
Page number to retrieve (min: 1).
- Name
search
- Type
- string
- Description
Search term to filter terminals (max: 255 characters).
- Name
sort_by
- Type
- string
- Description
Field to sort by. Options:
created_at
,name
,server_name
,login
,status
. Defaults tocreated_at
.
- Name
sort_direction
- Type
- string
- Description
Sort direction. Options:
asc
,desc
. Defaults todesc
.
- Name
status
- Type
- string
- Description
Filter by terminal status. Multiple values supported as comma-separated (e.g., "1,5,11").
- Name
project_id
- Type
- string
- Description
Filter by project ID.
- Name
region
- Type
- integer
- Description
Filter by region ID (see List Available Regions).
Request
curl -X GET "https://api.tradevps.net/v1/my/trading/terminals?date_from=2024-01-01&date_to=2024-01-31&search=test&sort_by=created_at&sort_direction=desc&status=11,5&project_id=123®ion=2&per_page=20&page=1" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
Response 200
{
"data": [
{
"id": "9dd1be11-8f0c-41a0-94e3-50ca7330b484",
"project_id": "9dd18edc-3068-4f02-b2b7-e820b451e0c6",
"name": "Test Config Agent",
"region": 2,
"server_name": "ICMarketsSC-Demo",
"login": "52151819",
"status": 1,
"created_at": "2024-01-15T19:33:45.000000Z",
"updated_at": "2024-01-15T19:33:45.000000Z"
}
],
"pagination": {
"current_page": 1,
"last_page": 1,
"per_page": 20,
"total": 1,
"first_page_url": "https://api.tradevps.net/v1/my/trading/terminals?page=1",
"last_page_url": "https://api.tradevps.net/v1/my/trading/terminals?page=1",
"next_page_url": null,
"prev_page_url": null,
"from": 1,
"to": 1
}
}
Create Trading Terminal
Create a new trading terminal.
Required Parameters
- Name
server_name
- Type
- string
- Description
The trading server name (e.g., "ICMarketsSC-Demo")
- Name
login
- Type
- string
- Description
Trading account login ID
- Name
password
- Type
- string
- Description
Trading account password
Optional Parameters
- Name
name
- Type
- string
- Description
Custom name for the terminal
- Name
region
- Type
- integer
- Description
Region identifier for terminal deployment
Request
curl -X POST https://api.tradevps.net/v1/my/trading/terminals \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{
"name": "Test Config Agent",
"server_name": "ICMarketsSC-Demo",
"login": "52151819",
"password": "YourPassword",
"region": 2
}'
Response 200
{
"ok": true,
"msg": "Terminal deploying...",
"data": {
"id": "9dd1be11-8f0c-41a0-94e3-50ca7330b484",
"project_id": "9dd18edc-3068-4f02-b2b7-e820b451e0c6",
"name": "Test Config Agent",
"region": 2,
"server_name": "ICMarketsSC-Demo",
"login": "52151819",
"status": 0,
"created_at": "2024-12-26T19:33:45.000000Z",
"updated_at": "2024-12-26T19:33:45.000000Z"
}
}
Response 422
{
"message": "The server name field is required. (and 2 more errors)",
"errors": {
"server_name": ["The server name field is required."],
"login": ["The login field is required."],
"password": ["The password field is required."]
}
}
Get Terminal Details
Retrieve details for a specific trading terminal.
URL Parameters
- Name
terminal_id
- Type
- string
- Description
The unique identifier of the terminal
Request
curl -X GET https://api.tradevps.net/v1/my/trading/terminals/{terminal_id} \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
Delete Terminal
Delete a specific trading terminal.
URL Parameters
- Name
terminal_id
- Type
- string
- Description
The unique identifier of the terminal to delete
Request
curl -X DELETE https://api.tradevps.net/v1/my/trading/terminals/{terminal_id} \
-H "Authorization: Bearer {token}"
Response 200
{
"ok": true,
"msg": "Terminal Destroying...",
"data": "9dd1be11-8f0c-41a0-94e3-50ca7330b484"
}
Response 404
{
"ok": false,
"msg": "Oops, Terminal has been lost?!",
"data": null
}
List Available Regions
Retrieve a list of available regions for terminal deployment.
Response
Returns an array of available regions with their identifiers, labels, and flag icons.
Request
curl -X GET https://api.tradevps.net/v1/my/trading/terminals/regions \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
Response 200
{
"ok": true,
"msg": "Available regions fetched.",
"data": [
{
"id": 0,
"label": "New York",
"icon": "https://api.tradevps.net/assets/media/flags/united-states.svg"
},
{
"id": 1,
"label": "Amsterdam",
"icon": "https://api.tradevps.net/assets/media/flags/netherlands.svg"
},
{
"id": 2,
"label": "Frankfurt",
"icon": "https://api.tradevps.net/assets/media/flags/germany.svg"
},
{
"id": 3,
"label": "London",
"icon": "https://api.tradevps.net/assets/media/flags/united-kingdom.svg"
}
]
}
List Terminal Tasks
Retrieve a list of tasks for a specific terminal.
URL Parameters
- Name
terminal_id
- Type
- string
- Description
The unique identifier of the terminal
Response
Returns an array of terminal tasks with their status and type. The response includes:
type
: Task type identifier (see Task Types)status
: Current task status (see Task Status)- Task execution details including timestamps and results
Request
curl -X GET https://api.tradevps.net/v1/my/trading/terminals/{terminal_id}/tasks \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
Response 200
{
"ok": true,
"msg": "Terminal Tasks fetched",
"data": [
{
"id": "9e8452ed-a60a-4883-b25c-e1567c7c080e",
"user_id": "9dcd6a1d-ba93-4e89-9c6e-046190b8478d",
"host_id": "9e397a74-a3e6-4536-b001-fb7c60f37a74",
"terminal_id": "9e6dc32f-792f-4fbe-9f21-b9e465025a8f",
"chart_id": null,
"type": 6,
"payload": {
"allow_algo_trading": 1
},
"result": {
"runner_result": [],
"status": 5
},
"status": 5,
"attempts": 0,
"planned_at": null,
"delivered_at": 1742911646,
"started_at": 1742911646,
"finished_at": 1742911647,
"created_at": "2025-03-25T14:07:21.000000Z",
"updated_at": "2025-03-25T14:07:27.000000Z",
"deleted_at": null
}
]
}
Create Terminal Task
Create a new task for a specific terminal.
URL Parameters
- Name
terminal_id
- Type
- string
- Description
The unique identifier of the terminal
Required Parameters
- Name
type
- Type
- integer
- Description
Task type identifier (see Task Types)
Optional Parameters
- Name
payload
- Type
- object
- Description
Task-specific parameters
Request
curl -X POST https://api.tradevps.net/v1/my/trading/terminals/{terminal_id}/tasks \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"type": 12,
"payload": {
"allow_algo_trading": 1
}
}'
Response 200 (Success)
{
"ok": true,
"msg": "Task deploying...",
"data": {
"id": "9e8452ed-a60a-4883-b25c-e1567c7c080e",
"type": 12,
"status": 0,
"created_at": "2025-03-25T14:07:21.000000Z"
}
}
Response 200 (Error)
{
"ok": false,
"msg": "An error occurred"
}
Response 422
{
"message": "The type field is required.",
"errors": {
"type": [
"The type field is required."
]
}
}
Get Task Details
Retrieve details for a specific task.
URL Parameters
- Name
terminal_id
- Type
- string
- Description
The unique identifier of the terminal
- Name
task_id
- Type
- string
- Description
The unique identifier of the task
Response
Returns detailed information about the specified task, including its type, status, and execution results. See Task Types and Task Status for possible values.
Request
curl -X GET https://api.tradevps.net/v1/my/trading/terminals/{terminal_id}/tasks/{task_id} \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"
Response 200
{
"ok": true,
"msg": "Task Fetched.",
"data": {
"ok": true,
"task": {
"id": "9e8452ed-a60a-4883-b25c-e1567c7c080e",
"user_id": "9dcd6a1d-ba93-4e89-9c6e-046190b8478d",
"host_id": "9e397a74-a3e6-4536-b001-fb7c60f37a74",
"terminal_id": "9e6dc32f-792f-4fbe-9f21-b9e465025a8f",
"chart_id": null,
"type": 6,
"payload": {
"allow_algo_trading": 1
},
"result": {
"runner_result": [],
"status": 5
},
"status": 5,
"attempts": 0,
"planned_at": null,
"delivered_at": 1742911646,
"started_at": 1742911646,
"finished_at": 1742911647,
"created_at": "2025-03-25T14:07:21.000000Z",
"updated_at": "2025-03-25T14:07:27.000000Z",
"deleted_at": null
}
}
}