Tài liệu API

Sử dụng API Key được tạo từ tài khoản quản lý thiết bị của bạn. Nếu đã có thiết bị, bạn có thể tạo API Key tại trang quản lý.

Tạo API Key tại trang quản lý

Xác thực

Thêm API Key của bạn vào header với key là x-api-key.

URL Endpoint

https://tsproxy.com/api/public

Headers

x-api-key: <API_KEY>
Content-Type: application/json

Thông tin API Key

Lấy thông tin API Key: tên, danh sách thiết bị và thời hạn.

GEThttps://tsproxy.com/api/public/key-detail
Response
{
  "statusCode": 200,
  "message": "OK",
  "data": {
    "name": "My API Key",
    "devices": [
      { "id": "665f1a2b3c4d5e6f7a8b9c0d", "domain": "abc.tsproxy.xyz" }
    ],
    "expiresAt": "2026-12-31T23:59:59.000Z"
  }
}

Danh sách Proxy

Lấy danh sách Proxy của một thiết bị.

GEThttps://tsproxy.com/api/public/proxy-list/{deviceId}
Quyền yêu cầu: GET_PROXY_LIST

Danh sách tham số

deviceIdstringrequired(path)

ID của thiết bị

Response
{
  "statusCode": 200,
  "message": "OK",
  "data": [
    {
      "id": "1",
      "httpLocal": "abc.tsproxy.xyz:10001",
      "sockLocal": "abc.tsproxy.xyz:10002",
      "httpRemote": "abc.tsproxy.xyz:20001",
      "sockRemote": "abc.tsproxy.xyz:20002",
      "auth": "user123:pass456",
      "ipPublic": "116.98.159.196",
      "status": "running",
      "ethPort": "ether2",
      "mtu": "1480",
      "lastLinkUpTime": "2026-07-29 08:30:12",
      "totalRx": "125.4",
      "totalTx": "88.2",
      "note": ""
    }
  ]
}

Cập nhật xác thực Proxy

Cập nhật user/pass của Proxy. Dùng giá trị "random" để hệ thống tự sinh.

POSThttps://tsproxy.com/api/public/proxy-auth
Quyền yêu cầu: SET_PROXY_AUTH

Danh sách tham số

deviceIdstringrequired(body)

ID của thiết bị

proxyIdstringrequired(body)

ID của Proxy

usernamestringrequired(body)

Tên đăng nhập mới (chữ và số, tối đa 100). Dùng "random" để hệ thống tự sinh.

passwordstringrequired(body)

Mật khẩu mới (chữ và số, tối đa 100). Dùng "random" để hệ thống tự sinh.

Request
{
  "deviceId": "665f1a2b3c4d5e6f7a8b9c0d",
  "proxyId": "1",
  "username": "random",
  "password": "random"
}
Response
{
  "statusCode": 200,
  "message": "PROXY_AUTH_UPDATED",
  "data": null
}

Xoay IP Proxy

Xoay (đổi) IP của một Proxy.

GETPOSThttps://tsproxy.com/api/public/rotate-proxy/{deviceId}/{proxyId}
Quyền yêu cầu: ROTATE_PROXY_IP

Danh sách tham số

deviceIdstringrequired(path)

ID của thiết bị

proxyIdstringrequired(path)

ID của Proxy

Response
{
  "statusCode": 200,
  "message": "PROXY_ROTATED",
  "data": null
}

Tạm dừng Proxy

Tạm dừng một Proxy.

GETPOSThttps://tsproxy.com/api/public/stop-proxy/{deviceId}/{proxyId}
Quyền yêu cầu: ROTATE_PROXY_IP

Danh sách tham số

deviceIdstringrequired(path)

ID của thiết bị

proxyIdstringrequired(path)

ID của Proxy

Response
{
  "statusCode": 200,
  "message": "PROXY_STOPPED",
  "data": null
}

Mã lỗi chung

200OK

Request được xử lý thành công

400Bad Request

Dữ liệu request không hợp lệ

401Unauthorized

Xác thực thất bại (thiếu hoặc sai API Key)

403Forbidden

API Key không có quyền thực hiện thao tác này

422Unprocessable Entity

Dữ liệu hợp lệ nhưng không xử lý được (lỗi validate)

429Too Many Requests

Vượt quá giới hạn số lần gọi (rate limit)

500Internal Server Error

Lỗi máy chủ

503Service Unavailable

Không kết nối được tới thiết bị