API reference / AI agents
Agent API
AI agents. 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/agent/accounts
Agent Accounts Auth: X-Tickwire-Agent-Key
Accounts this key may use, by account id. Cursor-paginated:
{accounts, has_more, next_cursor}.
| Parameter | In | Type | Description |
|---|---|---|---|
limit | query | integer | Page size, 1..500 (default 100). |
cursor | query | string | null | The next_cursor of the previous page, unchanged. |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/account-information
Agent Account Info Auth: X-Tickwire-Agent-Key
Balance, equity, margin… as reported by the broker (same shape as /users/current/…).
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/account-information' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/account-information",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/account-information");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/health
Agent Health Auth: X-Tickwire-Agent-Key
Truthful health with evidence (connected / disconnected / unknown).
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/health' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/health",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/health");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/history-deals
List history deals Auth: X-Tickwire-Agent-Key
Deals in a bounded window (default last 24 h, max 31 days).
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
start_time | query | string | null | |
end_time | query | string | null | |
limit | query | integer |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/history-deals' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/history-deals",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/history-deals");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/orders
Agent Orders Auth: X-Tickwire-Agent-Key
Pending orders (same shape as /users/current/accounts/{id}/orders).
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/orders' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/orders",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/orders");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/positions
Agent Positions Auth: X-Tickwire-Agent-Key
Open positions (same shape as /users/current/accounts/{id}/positions).
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/positions' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/positions",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/positions");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/snapshot
Agent Snapshot Auth: X-Tickwire-Agent-Key
Account information, positions, orders, health and server time in one
read, with as_of and per-section freshness.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/snapshot' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/snapshot",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/snapshot");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/symbols
List symbols Auth: X-Tickwire-Agent-Key
All symbols the broker makes available on this account.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/symbols/{symbol}/candles
Agent Candles Auth: X-Tickwire-Agent-Key
Historical candles for technical analysis and indicator calculations (e.g. SMA, EMA).
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string | |
timeframe | query | string | |
limit | query | integer | |
start_time | query | string | null |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/candles' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/candles",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/candles");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/symbols/{symbol}/current-candles/{timeframe}
Agent Current Candle Auth: X-Tickwire-Agent-Key
Current open/forming candle for a timeframe (e.g. 1m, 5m, 15m, 1h, 4h, 1d).
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string | |
timeframe required | path | string |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-candles/1h' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-candles/1h",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-candles/1h");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/symbols/{symbol}/current-price
Get the current price Auth: X-Tickwire-Agent-Key
Current bid/ask with broker time.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-price' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-price",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/current-price");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/accounts/{account_id}/symbols/{symbol}/specification
Get a symbol specification Auth: X-Tickwire-Agent-Key
Symbol specification: volume limits and step, digits, contract size…
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
symbol required | path | string |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/specification' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/specification",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/accounts/YOUR_ACCOUNT_ID/symbols/EURUSD/specification");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
POST /v1/agent/accounts/{account_id}/trade
Agent Trade Idempotency-Key Auth: X-Tickwire-Agent-Key
Place, modify, close or cancel a trade. Each trade is checked against the key's limits, the pre-trade hooks and the kill switches before it is sent, and is recorded in the audit trail.
| Parameter | In | Type | Description |
|---|---|---|---|
account_id required | path | string | |
Idempotency-Key | header | string | null | |
X-Reason | header | string | null |
Request body any
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error404account_not_found409idempotency_conflict500, 502backend_error403kill_switch_engaged
curl
curl -sS -X POST 'https://api.tickwire.io/v1/agent/accounts/YOUR_ACCOUNT_ID/trade' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' \
-H 'Idempotency-Key: my-request-1' \
-H 'X-Reason: why you are doing this' \
-H 'Content-Type: application/json' \
-d '{"actionType":"ORDER_TYPE_BUY","symbol":"EURUSD","volume":0.01}' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"POST",
"/v1/agent/accounts/YOUR_ACCOUNT_ID/trade",
json={"actionType": "ORDER_TYPE_BUY", "symbol": "EURUSD", "volume": 0.01},
idempotency_key="my-request-1",
reason="why you are doing this",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("POST", "/v1/agent/accounts/YOUR_ACCOUNT_ID/trade", {
body: {"actionType":"ORDER_TYPE_BUY","symbol":"EURUSD","volume":0.01},
idempotencyKey: "my-request-1",
reason: "why you are doing this",
});
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/audit
Agent Own Audit Auth: X-Tickwire-Agent-Key
This key's own audit entries, newest first. Cursor-paginated:
{entries, has_more, next_cursor}.
| Parameter | In | Type | Description |
|---|---|---|---|
limit | query | integer | Page size, 1..500 (default 50). |
before | query | integer | null | |
cursor | query | string | null | The next_cursor of the previous page, unchanged. |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/audit' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/audit",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/audit");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/key-check
Agent Key Check Auth: X-Tickwire-Agent-Key
Whether this agent key is live, and whether it is read-only.
Responses
200Successful Response401No 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. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/key-check' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/key-check",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/key-check");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/me
Get this agent key Auth: X-Tickwire-Agent-Key
This key's permissions, kill switches and applicable hooks.
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/me' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/me",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/me");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.
GET /v1/agent/requests/{idempotency_key}
Agent Request Status Auth: X-Tickwire-Agent-Key
What happened to the trade sent with this idempotency key.
| Parameter | In | Type | Description |
|---|---|---|---|
idempotency_key required | path | string |
Responses
200Successful Response401No 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. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized401invalid_agent_key429rate_limited400, 422validation_error403kill_switch_engaged
curl
curl -sS -X GET 'https://api.tickwire.io/v1/agent/requests/IDEMPOTENCY_KEY' \
-H 'X-Tickwire-Agent-Key: YOUR_AGENT_KEY' Python
from tickwire import AgentClient
with AgentClient("https://api.tickwire.io", "YOUR_AGENT_KEY") as agent:
result = agent.request(
"GET",
"/v1/agent/requests/IDEMPOTENCY_KEY",
)
print(result) TypeScript
import { AgentClient } from "@tickwire/sdk";
const agent = new AgentClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_AGENT_KEY" });
const result = await agent.request("GET", "/v1/agent/requests/IDEMPOTENCY_KEY");
console.log(result);
agent.close(); Try it in the sandbox
This call needs an agent key (twag_…), so it isn't available here. Use the agent SDK sample above with your sandbox agent key.