Bỏ qua để đến nội dung
Tài liệu này mô tả bản Veilus sau v0.2.1, sắp phát hành. Nếu bạn đang dùng v0.2.1, một số màn hình và tính năng (Bộ dữ liệu, Thùng rác, panel hồ sơ mới, nhiều tool MCP) chưa có trong bản của bạn.

MCP Server

MCP (Model Context Protocol) là cách chuẩn để các công cụ LLM như Claude Code, Cursor, Claude Desktop kết nối tới công cụ bên ngoài — Veilus nói giao thức này qua stdio, nên một LLM có thể thay bạn nhập proxy, tạo và mở profile, điều khiển trang của profile đang chạy, viết và chạy script Veilus Flow, và đặt lịch cho chúng.

Giống REST API, tính năng này cần bật API cục bộ trước, từ trang API & MCP trong sidebar của app — trang đó cũng đúc token bạn cần dưới đây.

Binary Veilus có lệnh con mcp nói MCP qua stdio. Client cần đường dẫn tới binary đó và token của bạn, truyền qua biến môi trường VEILUS_API_TOKEN.

Terminal window
claude mcp add --scope user veilus -e VEILUS_API_TOKEN=<token> -- "<path to Veilus>" mcp

--scope user cho Claude Code thấy Veilus ở mọi thư mục; không có nó thì chỉ thấy ở đúng thư mục bạn đứng lúc chạy lệnh.

Thêm đoạn này vào cấu hình MCP server của client:

{
"mcpServers": {
"veilus": {
"command": "<path to Veilus>",
"args": ["mcp"],
"env": {
"VEILUS_API_TOKEN": "<token>"
}
}
}
}

Trang API & MCP tự điền đường dẫn binary thật và token cho bạn ngay khi bạn đúc token — copy đoạn cấu hình từ đó thay vì tự gõ.

Mỗi tool gọi một route REST và trả về đúng các phản hồi của route đó. Các route ấy dưới dạng tài liệu OpenAPI 3.1: tải openapi.json.

Profile

list_profiles

GET /v1/profiles đọc

List Veilus browser profiles, with their running state. A running profile also carries cdpUrl (see launch_profile), and headless: true when it runs without a window.

Gọi route REST GET /v1/profiles

Phản hồi

200 Every profile, with its live running state.

array<object>

  • cdpUrl string
  • contentDataset string
  • createdAt string bắt buộc
  • folder string | null bắt buộc
  • groups array<string> bắt buộc
  • headless true
  • id string bắt buộc
  • identityDataset string
  • lastUsed string | null bắt buộc
  • name string bắt buộc
  • os string bắt buộc
  • proxy object bắt buộc
    • enabled boolean bắt buộc
    • host string bắt buộc
    • port integer bắt buộc
    • proxyType "http" | "socks5" | "residential" bắt buộc
    • requiresAuth boolean bắt buộc
  • proxyPoolId string
  • slug string bắt buộc
  • status "stopped" | "starting" | "running" | "crashed" bắt buộc
  • tags array<string> bắt buộc
  • variableNames array<string> bắt buộc

Ví dụ

[
  {
    "cdpUrl": "http://127.0.0.1:9333",
    "createdAt": "2026-10-01T10:00:00Z",
    "folder": null,
    "groups": [],
    "headless": true,
    "id": "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70",
    "lastUsed": "2026-10-16T08:59:00Z",
    "name": "Shop 1",
    "os": "windows",
    "proxy": {
      "enabled": true,
      "host": "203.0.113.7",
      "port": 8080,
      "proxyType": "http",
      "requiresAuth": true
    },
    "slug": "shop-1",
    "status": "running",
    "tags": [
      "shop"
    ],
    "variableNames": [
      "EMAIL",
      "PASSWORD"
    ]
  }
]
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "list_profiles",
"arguments": {}
}

launch_profile

POST /v1/profiles/:id/launch ghi

Launch a profile: waits for its browser to finish starting, then returns {pid, cdpUrl}. cdpUrl (http://127.0.0.1:<port>) is the profile's own Chromium DevTools endpoint: any CDP client — Playwright connectOverCDP, Puppeteer connect, browser-use, playwright-mcp — can drive the profile through it with its fingerprint and proxy. It has no authentication: any local process can use it while the profile runs. If the profile pool is already full this fails immediately with a 409 (REST returned 409 ...) rather than queuing. With diagnostic: true it opens the profile without its fingerprint, to tell whether a site blocks the fingerprint or the proxy. With headless: true it runs without a window. The browser stops by itself after 30 minutes with no call naming the profile; set idle_timeout_secs (0 = never) when driving it over cdpUrl.

Gọi route REST POST /v1/profiles/:id/launch

Tham số

  • diagnostic boolean

    Diagnostic launch: the profile's proxy, but none of its fingerprint, in a fresh temporary browser directory deleted on stop — no cookies or logins, and nothing is written to the profile. The page sees THIS machine's real values (platform, CPU cores, GPU, screen, timezone, languages): use it to tell whether a site blocks the fingerprint or the IP/proxy, never on an account you care about. The engine's CDP hiding still applies; WebRTC is restricted to the proxy. Default false.

  • headless boolean

    Headless launch: the browser runs without a window (--headless=new). The profile's fingerprint is unchanged, including its screen size, and the engine's CDP hiding still applies. Measured on the macOS engine 154: detector sites score a headless launch like a windowed one — it is NOT a stealth feature and NOT more detectable. A profile that is already running is not relaunched (409): reuse it through the profile list, which reports its cdpUrl and whether it runs headless. Default false.

  • idle_timeout_secs integer

    Stop this browser after this many seconds with no Veilus API/MCP call naming the profile (navigate, click, snapshot, ...). Traffic sent straight to cdpUrl by another client does NOT count: a framework driving the profile over CDP should pass 0, which never stops it. Default: the app setting, 30 minutes unless changed. Profiles opened from the Veilus window are never stopped this way.

  • profile_id string bắt buộc

    Profile UUID

Phản hồi

200 The browser started. diagnostic and headless appear only when true.

object

  • cdpUrl string bắt buộc
  • diagnostic true
  • headless true
  • pid integer bắt buộc

Ví dụ

{
  "cdpUrl": "http://127.0.0.1:9333",
  "pid": 48213
}
400 The id is not a uuid, or the body has an unknown key or a value of the wrong type.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: launch body {diagnostic?: bool, headless?: bool, idle_timeout_secs?: integer}: unknown field `headles`"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
409 Not launched: the pool is full, the profile is already running or does not exist, or the engine failed to start. Retrying the same call does not help until that changes.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: Too many browsers are already open (4 of 4). Close one and try again."
}
429 Too many expensive calls from this token: launch, script run, batch, run schedule now, create profiles and import proxies count together, 30 per rolling 60 s. The Retry-After header gives the seconds to wait.

object

  • error string bắt buộc

Ví dụ

{
  "error": "rate limited: too many expensive calls in the last minute; retry after 42s"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "launch_profile",
"arguments": {
"profile_id": ""
}
}

create_profiles

POST /v1/profiles ghi

Create 1 to 50 new browser profiles in one call. With proxy_pool_id (a static pool, e.g. from import_proxies), each new profile gets the pool's least-loaded slot (free slots first, lowest index on ties) and its timezone and language are generated to match that slot's exit-IP geo; a profile whose slot has no known geo is listed in failed and NOT created. Without proxy_pool_id the fingerprint is random. The whole call is rejected, creating nothing, if it would exceed the plan's profile limit. name_template replaces {n} with 1, 2, ...; tags are tag names. failed[].index is that same n. With identity_dataset_id (a fixed dataset) each new profile takes one unassigned row, and the call is refused if count exceeds the unassigned rows; content_dataset_id (a consume dataset) goes to every new profile's Content slot.

Gọi route REST POST /v1/profiles

Tham số

  • content_dataset_id string

    UUID of a consume dataset

  • count integer bắt buộc
  • identity_dataset_id string

    UUID of a fixed dataset (create_dataset)

  • name_template string

    Profile name; {n} becomes 1, 2, ...

  • os "windows" | "macos" | "linux"
  • proxy_pool_id string

    UUID of a static proxy pool

  • tags array<string>

    Tag names

Phản hồi

200 The profiles created and, by index, the ones that could not be.

object

  • created array<object> bắt buộc
    • name string bắt buộc
    • profile_id string bắt buộc
    • proxy_slot integer
    • timezone string bắt buộc
  • failed array<object> bắt buộc
    • error string bắt buộc
    • index integer bắt buộc
  • location_warning string
  • timezone_warning string

Ví dụ

{
  "created": [
    {
      "name": "Shop 1",
      "profile_id": "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70",
      "proxy_slot": 0,
      "timezone": "America/New_York"
    }
  ],
  "failed": []
}
400 The body is not valid: count outside 1-50, unknown os, empty tags, a dataset of the wrong mode or with too few rows, or a rotating pool.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: `count` must be between 1 and 50"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 The proxy pool or a dataset does not exist.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: proxy pool 7a1d9e42-0c3b-4d5e-8f6a-9b0c1d2e3f40"
}
409 No profile could be created, or a dataset cannot take these profiles.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: no profile was created: proxy 203.0.113.7:8080 did not answer"
}
429 Too many expensive calls from this token: launch, script run, batch, run schedule now, create profiles and import proxies count together, 30 per rolling 60 s. The Retry-After header gives the seconds to wait.

object

  • error string bắt buộc

Ví dụ

{
  "error": "rate limited: too many expensive calls in the last minute; retry after 42s"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "create_profiles",
"arguments": {
"count": 1
}
}

get_profile_proxy

GET /v1/profiles/:id/proxy đọc

Show which proxy a profile goes out through: its pool and slot, the slot's host:port, whether it needs auth, and the slot's detected country and timezone. Never returns the password.

Gọi route REST GET /v1/profiles/:id/proxy

Tham số

  • profile_id string bắt buộc

    Profile UUID

Phản hồi

200 Where the profile's traffic goes: its pool and slot, or its own proxy; null fields when there is none.

object

  • country string | null bắt buộc
  • pool_id string | null bắt buộc
  • profile_id string bắt buộc
  • proxy object | null bắt buộc
    • enabled boolean bắt buộc
    • host string bắt buộc
    • port integer bắt buộc
    • proxyType "http" | "socks5" | "residential" bắt buộc
    • requiresAuth boolean bắt buộc
  • slot integer | null bắt buộc
  • timezone string | null bắt buộc

Ví dụ

{
  "country": "US",
  "pool_id": "7a1d9e42-0c3b-4d5e-8f6a-9b0c1d2e3f40",
  "profile_id": "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70",
  "proxy": {
    "enabled": true,
    "host": "203.0.113.7",
    "port": 8080,
    "proxyType": "http",
    "requiresAuth": true
  },
  "slot": 0,
  "timezone": "America/New_York"
}
400 The id is not a uuid.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: not a uuid: 1234"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 No profile with this id.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: profile 0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "get_profile_proxy",
"arguments": {
"profile_id": ""
}
}

stop_profile

POST /v1/profiles/:id/stop ghi

Stop a profile's browser and release everything its launch held. Stopping a profile that is not running also succeeds. Returns an empty result.

Gọi route REST POST /v1/profiles/:id/stop

Tham số

  • profile_id string bắt buộc

    Profile UUID

Phản hồi

204 Stopped, or was not running. No body.

null

400 The id is not a uuid.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: not a uuid: 1234"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "stop_profile",
"arguments": {
"profile_id": ""
}
}

set_profile_variables

POST /v1/profiles/:id/variables ghi

Replace ALL stored variables of one profile with variables - not a merge: names you omit are deleted, {} clears them. Names are UPPER_SNAKE_CASE, at most 64 variables, values up to 32 KiB. They are delivered only to runs of APPROVED scripts (run_batch, schedules, and run_script once the user has approved the script) as process.env.VEILUS_VAR_<NAME>; a run_script trial of an unapproved script gets only the variables passed to that call. A variable passed to the run itself wins on the same name. Returns the stored names, never the values.

Gọi route REST POST /v1/profiles/:id/variables

Tham số

  • profile_id string bắt buộc

    Profile UUID

  • variables object bắt buộc

    The complete new set of variables

Phản hồi

200 The variable names now stored, sorted. Values are never returned.

object

  • profile_id string bắt buộc
  • variable_names array<string> bắt buộc

Ví dụ

{
  "profile_id": "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70",
  "variable_names": [
    "EMAIL",
    "PASSWORD"
  ]
}
400 The id is not a uuid, or a name is not UPPER_SNAKE_CASE, a value is over 32 KiB, or there are more than 64.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: variable name `email` must be UPPER_SNAKE_CASE, matching [A-Z_][A-Z0-9_]* and at most 64 chars"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 No profile with this id.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: profile 0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70; call list_profiles for valid ids"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "set_profile_variables",
"arguments": {
"profile_id": "",
"variables": {}
}
}

Script

run_script

POST /v1/scripts/run ghi

Run a script on the given profiles. Returns the run IMMEDIATELY, without waiting for it to finish; its id is the run_id for get_run_result.

Gọi route REST POST /v1/scripts/run

Tham số

  • headless boolean

    Launch the run's profiles headless, without a window — the same launch as launch_profile's headless (see there): the profile's fingerprint is unchanged. Default false.

  • profile_ids array<string> bắt buộc

    UUIDs of the profiles to run on

  • script_id string bắt buộc

    Script UUID

  • variables object

    Variables for the script, read in the script as process.env.VEILUS_VAR_<NAME>

Phản hồi

200 The run as recorded now, still running; poll GET /v1/runs/:id with its id.

object

  • completedAt string | null bắt buộc
  • error string | null bắt buộc
  • id string bắt buộc
  • profileIds array<string> bắt buộc
  • profilesDone integer bắt buộc
  • profilesFailed integer bắt buộc
  • profilesTotal integer bắt buộc
  • scheduleId string | null bắt buộc
  • scriptId string | null bắt buộc
  • source "schedule" | "app" | "agent" | null bắt buộc
  • startedAt string bắt buộc
  • status "running" | "completed" | "partial" | "failed" | "skipped" bắt buộc

Ví dụ

{
  "completedAt": null,
  "error": null,
  "id": "6f1c2b9e-3d4a-4e8b-9f0a-1b2c3d4e5f60",
  "profileIds": [
    "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70",
    "1c8f5b63-9d2e-4a4f-b7c0-3e6d9f2a5b81"
  ],
  "profilesDone": 0,
  "profilesFailed": 0,
  "profilesTotal": 2,
  "scheduleId": null,
  "scriptId": "2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92",
  "source": "agent",
  "startedAt": "2026-10-16T09:00:00Z",
  "status": "running"
}
400 script_id or profile_ids is missing, a variable is invalid, the plan lacks Veilus Flow, or an unapproved script targets more than 3 profiles.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: need at least one `profile_id`"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 No script with this id.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: script 2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92"
}
429 Too many expensive calls from this token: launch, script run, batch, run schedule now, create profiles and import proxies count together, 30 per rolling 60 s. The Retry-After header gives the seconds to wait.

object

  • error string bắt buộc

Ví dụ

{
  "error": "rate limited: too many expensive calls in the last minute; retry after 42s"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "run_script",
"arguments": {
"script_id": "",
"profile_ids": []
}
}

save_script

POST /v1/scripts ghi

Save a Playwright (TypeScript) script into Veilus Flow. Without script_id: create a new script; with script_id: replace its source. Contract - violations are rejected with line numbers: (1) connect with chromium.connectOverCDP(http://127.0.0.1:${process.env.VEILUS_DEBUG_PORT}); (2) no chromium.launch/launchPersistentContext; (3) use browser.contexts()[0], not newContext(); (4) no setUserAgent/setViewportSize - identity belongs to the profile; (5) errors must exit non-zero: main().catch((e) => { console.error(e); process.exit(1); }); (6) import only playwright and Node built-ins; (7) end main() with await browser.close() - it only disconnects from the profile's browser and lets the script exit; without it the run hangs. Read variables via process.env.VEILUS_VAR_<NAME> (names are UPPER_SNAKE_CASE); print what you need to see with console.log to stdout. A newly saved script is not approved: run_script can run it (on at most 3 profiles), schedules wait until the user approves it in the app. name is used only when creating; updating (with script_id) does not rename, and only scripts saved by an agent can be updated. Returns scriptId (this script's id — pass as script_id to get_script or to save_script again), version and approved.

Gọi route REST POST /v1/scripts

Tham số

  • description string
  • name string bắt buộc
  • script_id string

    UUID of the script whose source to replace; omit to create a new script

  • source string bắt buộc

    The full TypeScript source

Phản hồi

200 Saved. An agent-written script stays unapproved until the user approves it.

object

  • approved boolean bắt buộc
  • scriptId string bắt buộc
  • version string bắt buộc

Ví dụ

{
  "approved": false,
  "scriptId": "2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92",
  "version": "1.0.0"
}
400 Empty name, the plan lacks Veilus Flow, or the source breaks the Raw script contract (one line per violation).

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: line 3 [no-launch] call connectOverCDP, never launch a browser"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 script_id names no script.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: script 2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92"
}
409 script_id names a DSL script, or one the user wrote in the app; create a new script instead.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: script 2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92 was written in the app; create a new script instead"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "save_script",
"arguments": {
"name": "",
"source": ""
}
}

list_scripts

GET /v1/scripts đọc

List every script, newest first, without its source: scriptId, name, description, version, mode (raw or dsl), origin (mcp if an agent wrote it, app if the user did), approved and updatedAt. Check here before save_script so you update an existing script instead of saving a duplicate.

Gọi route REST GET /v1/scripts

Phản hồi

200 Every script, without its source.

array<object>

  • approved boolean bắt buộc
  • description string | null bắt buộc
  • mode "raw" | "dsl" bắt buộc
  • name string bắt buộc
  • origin string bắt buộc
  • scriptId string bắt buộc
  • updatedAt string bắt buộc
  • version string bắt buộc

Ví dụ

[
  {
    "approved": false,
    "description": null,
    "mode": "raw",
    "name": "Check inbox",
    "origin": "mcp",
    "scriptId": "2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92",
    "updatedAt": "2026-10-16T08:30:00Z",
    "version": "1.0.0"
  }
]
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "list_scripts",
"arguments": {}
}

get_script

GET /v1/scripts/:id đọc

Read the source and approval state of a Raw script, to fix it and save_script it again. Returns scriptId, name, description, version, source, approved and origin.

Gọi route REST GET /v1/scripts/:id

Tham số

  • script_id string bắt buộc

Phản hồi

200 The Raw script's source and approval state.

object

  • approved boolean bắt buộc
  • description string | null bắt buộc
  • name string bắt buộc
  • origin string bắt buộc
  • scriptId string bắt buộc
  • source string bắt buộc
  • version string bắt buộc

Ví dụ

{
  "approved": false,
  "description": null,
  "name": "Check inbox",
  "origin": "mcp",
  "scriptId": "2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92",
  "source": "import { chromium } from 'playwright';\n// ...",
  "version": "1.0.0"
}
400 The id is not a uuid.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: not a uuid: 1234"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 No script with this id.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: script 2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92"
}
409 The script is a DSL script; only Raw scripts can be read back.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: script 2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92 is a DSL script"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "get_script",
"arguments": {
"script_id": ""
}
}

compile_script

POST /v1/dsl/compile đọc

Compile a drag-and-drop DSL script into runnable code. Does not run it. Agents writing scripts should use save_script instead.

Gọi route REST POST /v1/dsl/compile

Tham số

  • dsl object bắt buộc

    DSL script body

  • target string

    Compile target

Phản hồi

200 The generated TypeScript, with compiler warnings.

object

  • code string bắt buộc
  • nodeCount integer bắt buộc
  • target string bắt buộc
  • warnings array<string> bắt buộc

Ví dụ

{
  "code": "import { chromium } from 'playwright';\n// ...",
  "nodeCount": 3,
  "target": "playwright",
  "warnings": []
}
400 dsl or target is missing, the DSL does not parse, or the target is not playwright or puppeteer.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: unknown target 'selenium', use 'playwright' or 'puppeteer'"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "compile_script",
"arguments": {
"dsl": {}
}
}

run_batch

POST /v1/scripts/batch ghi

Run an APPROVED script on many profiles for real. Returns the run IMMEDIATELY; its id is the run_id for get_run_result. Unlike run_script (a trial on at most 3 profiles, no approval needed), the script must have been approved by the user in Veilus → Flow, otherwise the call is refused. A profile id that does not exist is counted as a failed profile of the run, not rejected (unlike create_schedule, which refuses unknown ids with 404). concurrency (default 3, 1-16, capped by get_capacity's max) is how many profiles run at once; stagger_ms (default 1500, 0-600000 i.e. 10 minutes) is the pause between launches; use get_capacity to choose.

Gọi route REST POST /v1/scripts/batch

Tham số

  • concurrency integer
  • profile_ids array<string> bắt buộc
  • script_id string bắt buộc

    UUID of an approved script

  • stagger_ms integer
  • variables object

    Variables for this run, read as process.env.VEILUS_VAR_<NAME>

Phản hồi

200 The run as recorded now, still running; poll GET /v1/runs/:id with its id.

object

  • completedAt string | null bắt buộc
  • error string | null bắt buộc
  • id string bắt buộc
  • profileIds array<string> bắt buộc
  • profilesDone integer bắt buộc
  • profilesFailed integer bắt buộc
  • profilesTotal integer bắt buộc
  • scheduleId string | null bắt buộc
  • scriptId string | null bắt buộc
  • source "schedule" | "app" | "agent" | null bắt buộc
  • startedAt string bắt buộc
  • status "running" | "completed" | "partial" | "failed" | "skipped" bắt buộc

Ví dụ

{
  "completedAt": null,
  "error": null,
  "id": "6f1c2b9e-3d4a-4e8b-9f0a-1b2c3d4e5f60",
  "profileIds": [
    "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70",
    "1c8f5b63-9d2e-4a4f-b7c0-3e6d9f2a5b81"
  ],
  "profilesDone": 0,
  "profilesFailed": 0,
  "profilesTotal": 2,
  "scheduleId": null,
  "scriptId": "2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92",
  "source": "agent",
  "startedAt": "2026-10-16T09:00:00Z",
  "status": "running"
}
400 No profile ids, concurrency or stagger_ms out of range, or an invalid variable.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: `concurrency` must be between 1 and 4"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 No script with this id.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: script not found: 2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92; save_script returns valid ids"
}
409 The script is not approved; the user approves it in Veilus Flow.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: script `Check inbox` is not approved — ask the user to approve it in Veilus → Flow, then call this again"
}
429 Too many expensive calls from this token: launch, script run, batch, run schedule now, create profiles and import proxies count together, 30 per rolling 60 s. The Retry-After header gives the seconds to wait.

object

  • error string bắt buộc

Ví dụ

{
  "error": "rate limited: too many expensive calls in the last minute; retry after 42s"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "run_batch",
"arguments": {
"script_id": "",
"profile_ids": []
}
}

Lượt chạy

get_run_result

GET /v1/runs/:id đọc

Result of a run by run_id — use after calling run_script.

Gọi route REST GET /v1/runs/:id

Tham số

  • run_id string bắt buộc

    UUID returned by run_script

Phản hồi

200 The run and, once each profile finishes, its outcome with the tail of the script's output.

object

  • completedAt string | null bắt buộc
  • error string | null bắt buộc
  • id string bắt buộc
  • profileIds array<string> bắt buộc
  • profiles array<object> bắt buộc
    • elapsedMs integer bắt buộc
    • error string | null bắt buộc
    • exitCode integer | null bắt buộc
    • profileId string bắt buộc
    • status "completed" | "failed" bắt buộc
    • stderrTail string bắt buộc
    • stdoutTail string bắt buộc
  • profilesDone integer bắt buộc
  • profilesFailed integer bắt buộc
  • profilesTotal integer bắt buộc
  • scheduleId string | null bắt buộc
  • scriptId string | null bắt buộc
  • source "schedule" | "app" | "agent" | null bắt buộc
  • startedAt string bắt buộc
  • status "running" | "completed" | "partial" | "failed" | "skipped" bắt buộc

Ví dụ

{
  "completedAt": "2026-10-16T09:01:10Z",
  "error": null,
  "id": "6f1c2b9e-3d4a-4e8b-9f0a-1b2c3d4e5f60",
  "profileIds": [
    "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70",
    "1c8f5b63-9d2e-4a4f-b7c0-3e6d9f2a5b81"
  ],
  "profiles": [
    {
      "elapsedMs": 35120,
      "error": null,
      "exitCode": 0,
      "profileId": "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70",
      "status": "completed",
      "stderrTail": "",
      "stdoutTail": "done\n"
    }
  ],
  "profilesDone": 2,
  "profilesFailed": 0,
  "profilesTotal": 2,
  "scheduleId": null,
  "scriptId": "2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92",
  "source": "agent",
  "startedAt": "2026-10-16T09:00:00Z",
  "status": "completed"
}
400 The id is not a uuid.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: not a uuid: 1234"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 No run with this id.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: run 6f1c2b9e-3d4a-4e8b-9f0a-1b2c3d4e5f60"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "get_run_result",
"arguments": {
"run_id": ""
}
}

list_runs

GET /v1/runs đọc

List the most recent runs, newest first: status and profile counts, without per-profile detail (get_run_result has that). Without schedule_id it lists runs of every schedule and of run_script and run_batch. limit defaults to 20, at most 100.

Gọi route REST GET /v1/runs

Tham số

  • limit integer
  • schedule_id string

    Only this schedule's runs

Phản hồi

200 Recent runs, newest first, without their profile ids.

array<object>

  • completedAt string | null bắt buộc
  • error string | null bắt buộc
  • id string bắt buộc
  • profilesDone integer bắt buộc
  • profilesFailed integer bắt buộc
  • profilesTotal integer bắt buộc
  • scheduleId string | null bắt buộc
  • startedAt string bắt buộc
  • status "running" | "completed" | "partial" | "failed" | "skipped" bắt buộc

Ví dụ

[
  {
    "completedAt": null,
    "error": null,
    "id": "6f1c2b9e-3d4a-4e8b-9f0a-1b2c3d4e5f60",
    "profilesDone": 0,
    "profilesFailed": 0,
    "profilesTotal": 2,
    "scheduleId": null,
    "startedAt": "2026-10-16T09:00:00Z",
    "status": "running"
  }
]
400 Unknown query parameter, schedule_id not a uuid, or limit not a positive integer.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: unknown query parameter `page=2`; use schedule_id and limit"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 schedule_id names no schedule.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: schedule 3e0b7d85-bf40-4c61-99e2-5a8fbb4c7da3; call list_schedules for valid ids"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "list_runs",
"arguments": {}
}

Proxy

import_proxies

POST /v1/proxy-pools ghi

Create a static proxy pool from proxy lines (host:port, host:port:user:pass or user:pass@host:port). Prefix a line with socks5:// for a SOCKS5 proxy; http:// or no prefix means HTTP; https:// is rejected (TLS to the proxy is not supported). Bad lines are reported in rejected by line number (counting from 1) and do not block good ones; if no line is valid, nothing is created. Returns pool_id for create_profiles or assign_proxy_pool. Passwords are stored but never returned.

Gọi route REST POST /v1/proxy-pools

Tham số

  • lines array<string> bắt buộc

    One proxy per element

  • name string bắt buộc
  • type "static"

Phản hồi

200 The new pool, how many lines were imported, and the numbers of the lines refused.

object

  • imported integer bắt buộc
  • pool_id string bắt buộc
  • rejected array<object> bắt buộc
    • line integer bắt buộc
    • reason string bắt buộc

Ví dụ

{
  "imported": 9,
  "pool_id": "7a1d9e42-0c3b-4d5e-8f6a-9b0c1d2e3f40",
  "rejected": [
    {
      "line": 4,
      "reason": "expected host:port, host:port:user:pass or user:pass@host:port, optionally prefixed by http:// or socks5://"
    }
  ]
}
400 Empty name, a type other than static, more than 1000 lines, or no valid line at all.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: `name` must not be empty"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
429 Too many expensive calls from this token: launch, script run, batch, run schedule now, create profiles and import proxies count together, 30 per rolling 60 s. The Retry-After header gives the seconds to wait.

object

  • error string bắt buộc

Ví dụ

{
  "error": "rate limited: too many expensive calls in the last minute; retry after 42s"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "import_proxies",
"arguments": {
"name": "",
"lines": []
}
}

list_proxy_pools

GET /v1/proxy-pools đọc

List proxy pools: pool_id, name, kind (static or rotating), entry_count and countries detected for their exit IPs. Never returns credentials.

Gọi route REST GET /v1/proxy-pools

Phản hồi

200 Every pool with its entry count and the countries and timezones detected for its exits.

array<object>

  • countries array<string> bắt buộc
  • entry_count integer bắt buộc
  • kind "static" | "rotating" bắt buộc
  • location_warning string
  • name string bắt buộc
  • pool_id string bắt buộc
  • timezone_warning string
  • timezones array<string> bắt buộc

Ví dụ

[
  {
    "countries": [
      "US"
    ],
    "entry_count": 10,
    "kind": "static",
    "name": "US residential",
    "pool_id": "7a1d9e42-0c3b-4d5e-8f6a-9b0c1d2e3f40",
    "timezones": [
      "America/New_York"
    ]
  }
]
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "list_proxy_pools",
"arguments": {}
}

assign_proxy_pool

POST /v1/proxy-pools/:id/assign ghi

Assign a proxy pool to existing profiles, one slot each. Refuses the whole call (nothing assigned) if any profile already has a proxy or pool, listing them; pass force: true to replace. Does NOT change the profiles' timezone: if the new proxy is in another country, launch_profile will be blocked by the geo check. New profiles should get their pool through create_profiles instead.

Gọi route REST POST /v1/proxy-pools/:id/assign

Tham số

  • force boolean

    Replace an existing proxy. Default false

  • pool_id string bắt buộc

    Proxy pool UUID

  • profile_ids array<string> bắt buộc

Phản hồi

200 Every profile was assigned; each one's slot in the pool.

object

  • assigned array<object> bắt buộc
    • profile_id string bắt buộc
    • slot integer bắt buộc
  • pool_id string bắt buộc

Ví dụ

{
  "assigned": [
    {
      "profile_id": "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70",
      "slot": 0
    }
  ],
  "pool_id": "7a1d9e42-0c3b-4d5e-8f6a-9b0c1d2e3f40"
}
400 The id is not a uuid, or profile_ids is empty or has duplicates.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: `profile_ids` has duplicates"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 The pool or one of the profiles does not exist.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: proxy pool 7a1d9e42-0c3b-4d5e-8f6a-9b0c1d2e3f40"
}
409 Some profiles already have a proxy and force is false; nothing was assigned.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: profiles already have a proxy: 0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70. Nothing was assigned; pass `force: true` to replace their proxy (their timezone is not regenerated)"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "assign_proxy_pool",
"arguments": {
"pool_id": "",
"profile_ids": []
}
}

test_proxy

POST /v1/proxy-pools/:id/test ghi

Test every proxy in a pool now: alive or dead, latency, exit IP and its country and timezone. Refreshes the pool's cached geo, which create_profiles uses. A dead proxy can take up to about 10 seconds.

Gọi route REST POST /v1/proxy-pools/:id/test

Tham số

  • pool_id string bắt buộc

    Proxy pool UUID

Phản hồi

200 One row per proxy: alive, latency, exit IP and geo. Errors never carry the password.

array<object>

  • alive boolean bắt buộc
  • country string | null bắt buộc
  • error string | null bắt buộc
  • external_ip string | null bắt buộc
  • latency_ms integer | null bắt buộc
  • location_unstable string
  • proxy string bắt buộc
  • timezone string | null bắt buộc

Ví dụ

[
  {
    "alive": true,
    "country": "US",
    "error": null,
    "external_ip": "198.51.100.23",
    "latency_ms": 212,
    "proxy": "203.0.113.7:8080",
    "timezone": "America/New_York"
  }
]
400 The id is not a uuid.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: not a uuid: 1234"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 No pool with this id.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: proxy pool 7a1d9e42-0c3b-4d5e-8f6a-9b0c1d2e3f40"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "test_proxy",
"arguments": {
"pool_id": ""
}
}

Lịch chạy

create_schedule

POST /v1/schedules ghi

Create a schedule that runs an APPROVED script on the given profiles at set times. The script must already be approved by the user in Veilus → Flow: an unapproved script is refused now, not skipped later. schedule_type: interval (interval_minutes, with interval_unit minutes or seconds, at least 5 seconds), daily (daily_hour and daily_minute, the computer's local time), weekly (daily_hour, daily_minute and weekly_day, 0 = Sunday), cron (cron_expr, 5 fields) or once (run_at, a future RFC 3339 time with offset; the schedule runs once and then turns itself off). concurrency (default 1, 1-16) and stagger_ms (default 0, 0-600000 i.e. 10 minutes) apply to every run. Returns the schedule, including nextRunAt.

Gọi route REST POST /v1/schedules

Tham số

  • concurrency integer
  • cron_expr string
  • daily_hour integer
  • daily_minute integer
  • enabled boolean
  • headless boolean

    Launch the run's profiles headless, without a window — the same launch as launch_profile's headless (see there): the profile's fingerprint is unchanged. Default false.

  • interval_minutes integer
  • interval_unit "minutes" | "seconds"
  • name string bắt buộc
  • profile_ids array<string> bắt buộc
  • run_at string

    RFC 3339 with offset, e.g. 2026-10-04T09:00:00+07:00; required for once

  • schedule_type "interval" | "daily" | "weekly" | "cron" | "once" bắt buộc
  • script_id string bắt buộc

    UUID of an approved script

  • stagger_ms integer
  • weekly_day integer

Phản hồi

200 The schedule as stored, with its next run.

object

  • concurrency integer bắt buộc
  • createdAt string bắt buộc
  • cronExpr string | null bắt buộc
  • dailyHour integer | null bắt buộc
  • dailyMinute integer | null bắt buộc
  • enabled boolean bắt buộc
  • headless boolean bắt buộc
  • id string bắt buộc
  • intervalMinutes integer | null bắt buộc
  • intervalUnit "seconds" | "minutes" bắt buộc
  • lastRunAt string | null bắt buộc
  • name string bắt buộc
  • nextRunAt string | null bắt buộc
  • profileIds array<string> bắt buộc
  • runAt string | null bắt buộc
  • scheduleType "interval" | "daily" | "weekly" | "cron" | "once" bắt buộc
  • scriptId string | null bắt buộc
  • staggerMs integer bắt buộc
  • target object | object bắt buộc
    • kind "explicit" bắt buộc
    • value array<string> bắt buộc
  • updatedAt string bắt buộc
  • weeklyDay integer | null bắt buộc

Ví dụ

{
  "concurrency": 1,
  "createdAt": "2026-10-16T08:00:00Z",
  "cronExpr": null,
  "dailyHour": 9,
  "dailyMinute": 0,
  "enabled": true,
  "headless": false,
  "id": "3e0b7d85-bf40-4c61-99e2-5a8fbb4c7da3",
  "intervalMinutes": null,
  "intervalUnit": "minutes",
  "lastRunAt": null,
  "name": "Morning check",
  "nextRunAt": "2026-10-17T02:00:00Z",
  "profileIds": [
    "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70"
  ],
  "runAt": null,
  "scheduleType": "daily",
  "scriptId": "2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92",
  "staggerMs": 0,
  "target": {
    "kind": "explicit",
    "value": [
      "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70"
    ]
  },
  "updatedAt": "2026-10-16T08:00:00Z",
  "weeklyDay": null
}
400 Empty name or profile list, concurrency or stagger_ms out of range, or timing fields that would never fire.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: this schedule would never run: interval needs interval_minutes; ..."
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 A profile or the script does not exist.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: profiles 0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70 do not exist; call list_profiles for valid ids"
}
409 The script is not approved; the user approves it in Veilus Flow.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: script `Check inbox` is not approved — ask the user to approve it in Veilus → Flow, then call this again"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "create_schedule",
"arguments": {
"name": "",
"script_id": "",
"profile_ids": [],
"schedule_type": "interval"
}
}

list_schedules

GET /v1/schedules đọc

List every schedule: its script, target profiles, timing, enabled flag, and next and last run times.

Gọi route REST GET /v1/schedules

Phản hồi

200 Every schedule, newest first.

array<object>

  • concurrency integer bắt buộc
  • createdAt string bắt buộc
  • cronExpr string | null bắt buộc
  • dailyHour integer | null bắt buộc
  • dailyMinute integer | null bắt buộc
  • enabled boolean bắt buộc
  • headless boolean bắt buộc
  • id string bắt buộc
  • intervalMinutes integer | null bắt buộc
  • intervalUnit "seconds" | "minutes" bắt buộc
  • lastRunAt string | null bắt buộc
  • name string bắt buộc
  • nextRunAt string | null bắt buộc
  • profileIds array<string> bắt buộc
  • runAt string | null bắt buộc
  • scheduleType "interval" | "daily" | "weekly" | "cron" | "once" bắt buộc
  • scriptId string | null bắt buộc
  • staggerMs integer bắt buộc
  • target object | object bắt buộc
    • kind "explicit" bắt buộc
    • value array<string> bắt buộc
  • updatedAt string bắt buộc
  • weeklyDay integer | null bắt buộc

Ví dụ

[
  {
    "concurrency": 1,
    "createdAt": "2026-10-16T08:00:00Z",
    "cronExpr": null,
    "dailyHour": 9,
    "dailyMinute": 0,
    "enabled": true,
    "headless": false,
    "id": "3e0b7d85-bf40-4c61-99e2-5a8fbb4c7da3",
    "intervalMinutes": null,
    "intervalUnit": "minutes",
    "lastRunAt": null,
    "name": "Morning check",
    "nextRunAt": "2026-10-17T02:00:00Z",
    "profileIds": [
      "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70"
    ],
    "runAt": null,
    "scheduleType": "daily",
    "scriptId": "2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92",
    "staggerMs": 0,
    "target": {
      "kind": "explicit",
      "value": [
        "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70"
      ]
    },
    "updatedAt": "2026-10-16T08:00:00Z",
    "weeklyDay": null
  }
]
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "list_schedules",
"arguments": {}
}

set_schedule_enabled

POST /v1/schedules/:id/enabled ghi

Turn a schedule on or off. Turning it on recomputes the next run from now and requires its script to still be approved; turning it off keeps the schedule and its run history.

Gọi route REST POST /v1/schedules/:id/enabled

Tham số

  • enabled boolean bắt buộc
  • schedule_id string bắt buộc

    Schedule UUID

Phản hồi

200 The schedule after the change; turning it on recomputes nextRunAt from now.

object

  • concurrency integer bắt buộc
  • createdAt string bắt buộc
  • cronExpr string | null bắt buộc
  • dailyHour integer | null bắt buộc
  • dailyMinute integer | null bắt buộc
  • enabled boolean bắt buộc
  • headless boolean bắt buộc
  • id string bắt buộc
  • intervalMinutes integer | null bắt buộc
  • intervalUnit "seconds" | "minutes" bắt buộc
  • lastRunAt string | null bắt buộc
  • name string bắt buộc
  • nextRunAt string | null bắt buộc
  • profileIds array<string> bắt buộc
  • runAt string | null bắt buộc
  • scheduleType "interval" | "daily" | "weekly" | "cron" | "once" bắt buộc
  • scriptId string | null bắt buộc
  • staggerMs integer bắt buộc
  • target object | object bắt buộc
    • kind "explicit" bắt buộc
    • value array<string> bắt buộc
  • updatedAt string bắt buộc
  • weeklyDay integer | null bắt buộc

Ví dụ

{
  "concurrency": 1,
  "createdAt": "2026-10-16T08:00:00Z",
  "cronExpr": null,
  "dailyHour": 9,
  "dailyMinute": 0,
  "enabled": true,
  "headless": false,
  "id": "3e0b7d85-bf40-4c61-99e2-5a8fbb4c7da3",
  "intervalMinutes": null,
  "intervalUnit": "minutes",
  "lastRunAt": null,
  "name": "Morning check",
  "nextRunAt": "2026-10-17T02:00:00Z",
  "profileIds": [
    "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70"
  ],
  "runAt": null,
  "scheduleType": "daily",
  "scriptId": "2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92",
  "staggerMs": 0,
  "target": {
    "kind": "explicit",
    "value": [
      "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70"
    ]
  },
  "updatedAt": "2026-10-16T08:00:00Z",
  "weeklyDay": null
}
400 The id is not a uuid, the body is not {enabled: boolean}, or a one-time schedule's run_at has passed.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: body must be JSON {enabled: boolean}"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 No schedule with this id.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: schedule 3e0b7d85-bf40-4c61-99e2-5a8fbb4c7da3; call list_schedules for valid ids"
}
409 Turning on a schedule whose script is no longer approved.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: script `Check inbox` is not approved — ask the user to approve it in Veilus → Flow, then call this again"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "set_schedule_enabled",
"arguments": {
"schedule_id": "",
"enabled": false
}
}

run_schedule_now

POST /v1/schedules/:id/run ghi

Run a schedule once right now, without waiting for its timer. Returns the run IMMEDIATELY; its id is the run_id for get_run_result. Refused while the schedule already has a run in progress, or if its script is not approved.

Gọi route REST POST /v1/schedules/:id/run

Tham số

  • schedule_id string bắt buộc

    Schedule UUID

Phản hồi

200 The run as recorded now, still running; poll GET /v1/runs/:id with its id.

object

  • completedAt string | null bắt buộc
  • error string | null bắt buộc
  • id string bắt buộc
  • profileIds array<string> bắt buộc
  • profilesDone integer bắt buộc
  • profilesFailed integer bắt buộc
  • profilesTotal integer bắt buộc
  • scheduleId string | null bắt buộc
  • scriptId string | null bắt buộc
  • source "schedule" | "app" | "agent" | null bắt buộc
  • startedAt string bắt buộc
  • status "running" | "completed" | "partial" | "failed" | "skipped" bắt buộc

Ví dụ

{
  "completedAt": null,
  "error": null,
  "id": "6f1c2b9e-3d4a-4e8b-9f0a-1b2c3d4e5f60",
  "profileIds": [
    "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70",
    "1c8f5b63-9d2e-4a4f-b7c0-3e6d9f2a5b81"
  ],
  "profilesDone": 0,
  "profilesFailed": 0,
  "profilesTotal": 2,
  "scheduleId": null,
  "scriptId": "2d9a6c74-ae3f-4b50-88d1-4f7eaa3b6c92",
  "source": "agent",
  "startedAt": "2026-10-16T09:00:00Z",
  "status": "running"
}
400 The id is not a uuid.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: not a uuid: 1234"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 No schedule with this id, or its script is gone.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: schedule 3e0b7d85-bf40-4c61-99e2-5a8fbb4c7da3; call list_schedules for valid ids"
}
409 The schedule already has a run in progress, its script is not approved, or no target profile is left.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: schedule already has a run in progress — wait for it to finish (list_runs or get_run_result), then try again"
}
429 Too many expensive calls from this token: launch, script run, batch, run schedule now, create profiles and import proxies count together, 30 per rolling 60 s. The Retry-After header gives the seconds to wait.

object

  • error string bắt buộc

Ví dụ

{
  "error": "rate limited: too many expensive calls in the last minute; retry after 42s"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "run_schedule_now",
"arguments": {
"schedule_id": ""
}
}

Bộ dữ liệu

create_dataset

POST /v1/datasets ghi

Create a dataset: a table stored in Veilus that approved scripts read per profile. mode fixed: each profile gets ONE row for good (accounts); its columns arrive as process.env.VEILUS_VAR_<COLUMN>. mode consume: each run takes rows_per_run (1-50, default 1) unused rows; a failed run gives them back, a successful run marks them used; they arrive as VEILUS_VAR_ROWS (JSON array of {COLUMN: value}) and, when rows_per_run is 1, also one variable per column. VEILUS_VAR_ROW_INDEX is the row's number. Columns are UPPER_SNAKE_CASE; ROWS, ROW_INDEX, PROFILE_ID, RUN_ID and DEBUG_PORT are reserved. Mark a column secret: true for passwords: it is stored and given to approved scripts, but no tool ever returns it. Bad rows are reported in rejected by row number (from 1). Returns datasetId.

Gọi route REST POST /v1/datasets

Tham số

  • columns array<object> bắt buộc
    • name string bắt buộc
    • secret boolean
  • mode "fixed" | "consume" bắt buộc
  • name string bắt buộc
  • rows array<object>

    One object per row, keyed by column name; every value must be a string — convert numbers and dates to text before sending

  • rows_per_run integer

Phản hồi

200 The new dataset, how many rows were imported, and the numbers of the rows refused.

object

  • datasetId string bắt buộc
  • imported integer bắt buộc
  • rejected array<object> bắt buộc
    • lineNo integer bắt buộc
    • reason "fieldCount" | "unclosedQuote" | "unknownColumn" | "emptyRow" bắt buộc

Ví dụ

{
  "datasetId": "5c2e8f17-4a6b-4d9c-b1e3-7f0a2b4c6d81",
  "imported": 9,
  "rejected": [
    {
      "lineNo": 4,
      "reason": "unknownColumn"
    }
  ]
}
400 Bad column names, a reserved column, rows_per_run on a fixed dataset, or more than 5000 rows.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: invalid dataset: column `email` must match ^[A-Z_][A-Z0-9_]*$"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
409 A dataset with this name already exists.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: a dataset named \"Accounts\" already exists"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "create_dataset",
"arguments": {
"name": "",
"mode": "fixed",
"columns": [
{
"name": ""
}
]
}
}

append_dataset_rows

POST /v1/datasets/:id/rows ghi

Add rows to a dataset, in the same shape as create_dataset's rows. Bad rows are reported in rejected by row number and do not block good ones.

Gọi route REST POST /v1/datasets/:id/rows

Tham số

  • dataset_id string bắt buộc

    Dataset UUID

  • rows array<object> bắt buộc

    One object per row, keyed by column name; every value must be a string — convert numbers and dates to text before sending

Phản hồi

200 How many rows were appended, and the numbers of the rows refused.

object

  • imported integer bắt buộc
  • rejected array<object> bắt buộc
    • lineNo integer bắt buộc
    • reason "fieldCount" | "unclosedQuote" | "unknownColumn" | "emptyRow" bắt buộc

Ví dụ

{
  "imported": 5,
  "rejected": []
}
400 The id is not a uuid, the body is not {rows: object[]}, or more than 5000 rows.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: at most 5000 rows per call"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 No dataset with this id.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: dataset 5c2e8f17-4a6b-4d9c-b1e3-7f0a2b4c6d81"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "append_dataset_rows",
"arguments": {
"dataset_id": "",
"rows": []
}
}

list_datasets

GET /v1/datasets đọc

List datasets: id, name, mode, columns with their secret flag, rowsPerRun, row counts (total and assigned for fixed; available, reserved and used for consume) and how many profiles use each. Never returns row values.

Gọi route REST GET /v1/datasets

Phản hồi

200 Every dataset with its columns and row counts by state; no row values.

array<object>

  • columns array<object> bắt buộc
    • name string bắt buộc
    • secret boolean bắt buộc
  • counts object bắt buộc
    • assigned integer bắt buộc
    • available integer bắt buộc
    • reserved integer bắt buộc
    • total integer bắt buộc
    • used integer bắt buộc
  • createdAt string bắt buộc
  • id string bắt buộc
  • mode "fixed" | "consume" bắt buộc
  • name string bắt buộc
  • profileCount integer bắt buộc
  • rowsPerRun integer | null bắt buộc
  • updatedAt string bắt buộc

Ví dụ

[
  {
    "columns": [
      {
        "name": "EMAIL",
        "secret": false
      },
      {
        "name": "PASSWORD",
        "secret": true
      }
    ],
    "counts": {
      "assigned": 3,
      "available": 0,
      "reserved": 0,
      "total": 10,
      "used": 0
    },
    "createdAt": "2026-10-16 08:00:00",
    "id": "5c2e8f17-4a6b-4d9c-b1e3-7f0a2b4c6d81",
    "mode": "fixed",
    "name": "Accounts",
    "profileCount": 3,
    "rowsPerRun": null,
    "updatedAt": "2026-10-16 08:00:00"
  }
]
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "list_datasets",
"arguments": {}
}

get_dataset_rows

GET /v1/datasets/:id/rows đọc

Read a dataset's rows in order: limit rows (default 100, at most 500) from offset. Each row has its index, its values, and for a fixed dataset the profile it is assigned to, for a consume dataset its state. Secret columns are always left out of values.

Gọi route REST GET /v1/datasets/:id/rows

Tham số

  • dataset_id string bắt buộc

    Dataset UUID

  • limit integer
  • offset integer

Phản hồi

200 One page of rows. Secret columns are absent from values, not empty.

object

  • datasetId string bắt buộc
  • offset integer bắt buộc
  • rows array<object> bắt buộc
    • id string bắt buộc
    • index integer bắt buộc
    • profileId string | null bắt buộc
    • runId string | null bắt buộc
    • state "available" | "reserved" | "used" | null bắt buộc
    • usedAt string | null bắt buộc
    • values object bắt buộc
  • total integer bắt buộc

Ví dụ

{
  "datasetId": "5c2e8f17-4a6b-4d9c-b1e3-7f0a2b4c6d81",
  "offset": 0,
  "rows": [
    {
      "id": "8e4a1c39-6b2d-4f7e-a0c5-9d3b5e7f1a24",
      "index": 1,
      "profileId": "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70",
      "runId": null,
      "state": null,
      "usedAt": null,
      "values": {
        "EMAIL": "a@example.com"
      }
    }
  ],
  "total": 10
}
400 The id is not a uuid, or a query parameter is unknown or not a non-negative integer.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: unknown query parameter `page`; use offset and limit"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 No dataset with this id.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: dataset 5c2e8f17-4a6b-4d9c-b1e3-7f0a2b4c6d81"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "get_dataset_rows",
"arguments": {
"dataset_id": ""
}
}

assign_dataset

POST /v1/datasets/:id/assign ghi

Assign a dataset to existing profiles. A fixed dataset goes to each profile's Identity slot and gives it one unassigned row (lowest index first); profiles left without a row are named in withoutRow and get nothing — never share one account between profiles. A consume dataset goes to the Content slot. Refuses the whole call if a profile already has a different dataset in that slot, unless force: true; refuses column names that also exist in the dataset in the profile's other slot. Every later run of an APPROVED script on those profiles carries the data; schedules and run_batch need no new field.

Gọi route REST POST /v1/datasets/:id/assign

Tham số

  • dataset_id string bắt buộc

    Dataset UUID

  • force boolean

    Replace a dataset already in the slot. Default false

  • profile_ids array<string> bắt buộc

Phản hồi

200 The profiles that took the dataset into its slot, and by name those a fixed dataset had no row left for.

object

  • assigned array<string> bắt buộc
  • datasetId string bắt buộc
  • slot "identity" | "content" bắt buộc
  • withoutRow array<object> bắt buộc
    • name string bắt buộc
    • profileId string bắt buộc

Ví dụ

{
  "assigned": [
    "0b7e4a52-8c1d-4f3e-a6b9-2d5c8e1f4a70"
  ],
  "datasetId": "5c2e8f17-4a6b-4d9c-b1e3-7f0a2b4c6d81",
  "slot": "identity",
  "withoutRow": []
}
400 The id is not a uuid, or profile_ids is empty or has duplicates.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: need at least one `profile_id`"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 The dataset or one of the profiles does not exist.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: dataset 5c2e8f17-4a6b-4d9c-b1e3-7f0a2b4c6d81"
}
409 A profile already has another dataset in that slot and force is false, or the columns clash with the other slot's dataset.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: profiles already have a different identity dataset: Shop 1. Nothing was assigned; pass `force: true` to replace it"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "assign_dataset",
"arguments": {
"dataset_id": "",
"profile_ids": []
}
}

unassign_dataset

POST /v1/datasets/:id/unassign ghi

Remove a dataset from profiles. For a fixed dataset their rows become unassigned again. Profile ids that no longer exist are accepted, so rows held by deleted profiles can be freed.

Gọi route REST POST /v1/datasets/:id/unassign

Tham số

  • dataset_id string bắt buộc

    Dataset UUID

  • profile_ids array<string> bắt buộc

Phản hồi

200 How many profiles lost the dataset.

object

  • changed integer bắt buộc

Ví dụ

{
  "changed": 1
}
400 The id is not a uuid, or profile_ids is empty or has duplicates.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: `profile_ids` has duplicates"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 No dataset with this id.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: dataset 5c2e8f17-4a6b-4d9c-b1e3-7f0a2b4c6d81"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "unassign_dataset",
"arguments": {
"dataset_id": "",
"profile_ids": []
}
}

reset_dataset_rows

POST /v1/datasets/:id/reset ghi

For a consume dataset: put every used row back to available, so runs take them again. Returns how many rows changed.

Gọi route REST POST /v1/datasets/:id/reset

Tham số

  • dataset_id string bắt buộc

    Dataset UUID

Phản hồi

200 How many used rows became available again.

object

  • changed integer bắt buộc

Ví dụ

{
  "changed": 12
}
400 The id is not a uuid, or the dataset is not a consume dataset.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: not a uuid: 1234"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 No dataset with this id.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: dataset 5c2e8f17-4a6b-4d9c-b1e3-7f0a2b4c6d81"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "reset_dataset_rows",
"arguments": {
"dataset_id": ""
}
}

Điều khiển trang

navigate

POST /v1/profiles/:id/navigate ghi

Load a URL in the tab of a RUNNING profile and wait for its load event (up to 15 s); on timeout it PROCEEDS ANYWAY and the result says the page is still loading - then call wait_for_element for what you need before reading the page. The profile must already be open - call launch_profile first; this never opens it.

Gọi route REST POST /v1/profiles/:id/navigate

Tham số

  • profile_id string bắt buộc

    UUID of a running profile (launch_profile first)

  • url string bắt buộc

Phản hồi

200 Navigated. The sentence says when the page was still loading after 15 s.

object

  • result string bắt buộc

Ví dụ

{
  "result": "navigated to https://example.com"
}
400 The id is not a uuid, or the body is missing a field or has a value out of range.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: body must be JSON {node_id: integer}"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
409 The profile is not running, its tab is gone, or the page did not answer in time.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: profile is not running; call launch_profile first"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "navigate",
"arguments": {
"profile_id": "",
"url": ""
}
}

snapshot

GET /v1/profiles/:id/snapshot đọc

Accessibility snapshot of the current page of a running profile: one line per element with role, name and [id=N]; pass N as node_id to click or type. Ids change when the page changes - take a new snapshot after navigating or clicking. Lists at most 150 elements and 64 KiB; truncated: true means the page has more - use wait_for_element with a CSS selector to reach an element that is not listed. Elements inside same-origin iframes follow a --- iframe URL --- line and work with click and type like any other; a cross-origin iframe gets a (cross-origin …) line with its URL but its elements are not listed - navigate to that URL to work inside it.

Gọi route REST GET /v1/profiles/:id/snapshot

Tham số

  • profile_id string bắt buộc

    UUID of a running profile (launch_profile first)

Phản hồi

200 The accessibility tree as text, one element per line with [id=N]; truncated past 150 elements or 64 KiB.

object

  • dialogs array<object>
    • accepted boolean bắt buộc
    • kind "alert" | "confirm" | "prompt" | "beforeunload" bắt buộc
    • message string bắt buộc
  • text string bắt buộc
  • truncated boolean bắt buộc

Ví dụ

{
  "text": "- heading \"Example Domain\" [id=12]\n- link \"More information...\" [id=15]",
  "truncated": false
}
400 The id is not a uuid.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: not a uuid: 1234"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
409 The profile is not running, its tab is gone, or the page did not answer in time.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: profile is not running; call launch_profile first"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "snapshot",
"arguments": {
"profile_id": ""
}
}

click

POST /v1/profiles/:id/click ghi

Click an element of a running profile's page by node_id with a real mouse: the pointer moves to a point inside the element, then presses and releases. Fails if the page changed since the snapshot (take a new one), if the element has no visible box (hidden or zero-size — click its visible label or parent), or if another element covers it (the error names it — close or scroll past it first). A JavaScript alert/confirm/prompt that the action opens is answered at once: dialog "dismiss" (default, i.e. Cancel) or "accept" (OK), with prompt_text as the typed answer to a prompt; the result says which dialog opened and how it was answered.

Gọi route REST POST /v1/profiles/:id/click

Tham số

  • dialog "dismiss" | "accept"
  • node_id integer bắt buộc

    node_id from snapshot ([id=N]) or wait_for_element

  • profile_id string bắt buộc

    UUID of a running profile (launch_profile first)

  • prompt_text string

Phản hồi

200 Clicked. Any JS dialog the click opened is named in the sentence.

object

  • result string bắt buộc

Ví dụ

{
  "result": "Clicked element [id=15]"
}
400 The id is not a uuid, or the body is missing a field or has a value out of range.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: body must be JSON {node_id: integer}"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 The node id is stale: the page changed since the snapshot. Call snapshot again.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: element [id=42] — the page changed since the snapshot; call snapshot for fresh ids, then retry"
}
409 The profile is not running, its tab is gone, or the page did not answer in time.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: profile is not running; call launch_profile first"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "click",
"arguments": {
"profile_id": "",
"node_id": 0
}
}

type

POST /v1/profiles/:id/type ghi

Focus an element by node_id and type text into it, one key event per character (at most 5000 characters). Replaces the field's current content: existing text is removed before typing. If the result notes that the value could not be confirmed (masked, length-limited or auto-formatted fields), verify the field with snapshot or evaluate_js.

Gọi route REST POST /v1/profiles/:id/type

Tham số

  • node_id integer bắt buộc

    node_id from snapshot ([id=N]) or wait_for_element

  • profile_id string bắt buộc

    UUID of a running profile (launch_profile first)

  • text string bắt buộc

Phản hồi

200 Typed. The sentence notes a field that could not be cleared or did not change.

object

  • result string bắt buộc

Ví dụ

{
  "result": "Typed 11 chars into element [id=21]"
}
400 The id is not a uuid, or the body is missing a field or has a value out of range.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: body must be JSON {node_id: integer}"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 The node id is stale: the page changed since the snapshot. Call snapshot again.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: element [id=42] — the page changed since the snapshot; call snapshot for fresh ids, then retry"
}
409 The profile is not running, its tab is gone, or the page did not answer in time.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: profile is not running; call launch_profile first"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "type",
"arguments": {
"profile_id": "",
"node_id": 0,
"text": ""
}
}

press_key

POST /v1/profiles/:id/press-key ghi

Press one named key in a running profile's page: Enter, Tab, Escape, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Backspace, Delete or Space. If no input is focused, the LAST input on the page is focused first. For text use type. A JavaScript alert/confirm/prompt that the action opens is answered at once: dialog "dismiss" (default, i.e. Cancel) or "accept" (OK), with prompt_text as the typed answer to a prompt; the result says which dialog opened and how it was answered.

Gọi route REST POST /v1/profiles/:id/press-key

Tham số

  • dialog "dismiss" | "accept"
  • key "Enter" | "Tab" | "Escape" | "ArrowDown" | "ArrowUp" | "ArrowLeft" | "ArrowRight" | "Backspace" | "Delete" | "Space" bắt buộc
  • profile_id string bắt buộc

    UUID of a running profile (launch_profile first)

  • prompt_text string

Phản hồi

200 Pressed. Any JS dialog the key opened is named in the sentence.

object

  • result string bắt buộc

Ví dụ

{
  "result": "Pressed key: Enter"
}
400 The id is not a uuid, or the body is missing a field or has a value out of range.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: body must be JSON {node_id: integer}"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
409 The profile is not running, its tab is gone, or the page did not answer in time.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: profile is not running; call launch_profile first"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "press_key",
"arguments": {
"profile_id": "",
"key": "Enter"
}
}

scroll

POST /v1/profiles/:id/scroll ghi

Scroll a running profile's page by amount pixels (1 to 20000) in direction up, down, left or right, with mouse-wheel steps at the pointer's position. Like a real wheel, a scrollable area under the pointer scrolls instead of the page — after a click inside such an area, scroll there, or click outside it first. On a macOS profile the distance varies a few percent around amount, like a real wheel; the result reports the pixels actually scrolled.

Gọi route REST POST /v1/profiles/:id/scroll

Tham số

  • amount integer bắt buộc
  • direction "up" | "down" | "left" | "right" bắt buộc
  • profile_id string bắt buộc

    UUID of a running profile (launch_profile first)

Phản hồi

200 Scrolled; the sentence gives the direction and pixels.

object

  • result string bắt buộc

Ví dụ

{
  "result": "Scrolled down by 600px"
}
400 The id is not a uuid, or the body is missing a field or has a value out of range.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: body must be JSON {node_id: integer}"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
409 The profile is not running, its tab is gone, or the page did not answer in time.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: profile is not running; call launch_profile first"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "scroll",
"arguments": {
"profile_id": "",
"direction": "up",
"amount": 1
}
}

evaluate_js

POST /v1/profiles/:id/evaluate ghi

Run a JavaScript expression in a running profile's page and return its value as text, JSON-encoded (strings come back quoted); promises are awaited. undefined comes back as the text (undefined), not JSON null. A thrown error comes back as text starting with [JS Error] — this is a normal call result, not a tool failure. Results over 64 KiB are cut and flagged truncated: true. A synchronous loop is stopped by the PAGE ITSELF after about 9 s; its result also comes back as ordinary [JS Error] text. A promise that never settles instead makes the call itself fail after 10 s with a timeout error. This is NOT a sandbox: it runs with the full rights of the logged-in page (reads cookies, sends requests as the user). A JavaScript alert/confirm/prompt that the action opens is answered at once: dialog "dismiss" (default, i.e. Cancel) or "accept" (OK), with prompt_text as the typed answer to a prompt; the result says which dialog opened and how it was answered.

Gọi route REST POST /v1/profiles/:id/evaluate

Tham số

  • dialog "dismiss" | "accept"
  • expression string bắt buộc
  • profile_id string bắt buộc

    UUID of a running profile (launch_profile first)

  • prompt_text string

Phản hồi

200 The expression's value as text, cut at 64 KiB, with any JS dialog it opened.

object

  • dialogs array<object>
    • accepted boolean bắt buộc
    • kind "alert" | "confirm" | "prompt" | "beforeunload" bắt buộc
    • message string bắt buộc
  • text string bắt buộc
  • truncated boolean bắt buộc

Ví dụ

{
  "text": "\"Example Domain\"",
  "truncated": false
}
400 The id is not a uuid, or the body is missing a field or has a value out of range.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: body must be JSON {node_id: integer}"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
409 The profile is not running, its tab is gone, or the page did not answer in time.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: profile is not running; call launch_profile first"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "evaluate_js",
"arguments": {
"profile_id": "",
"expression": ""
}
}

wait_for_element

POST /v1/profiles/:id/wait-for-element ghi

Wait until a CSS selector matches an element in a running profile's page (polls every 200 ms; timeout_ms 1 to 30000, default 5000) and return its node_id for click or type. Use after navigate or click to wait for the next page.

Gọi route REST POST /v1/profiles/:id/wait-for-element

Tham số

  • profile_id string bắt buộc

    UUID of a running profile (launch_profile first)

  • selector string bắt buộc

    CSS selector

  • timeout_ms integer

Phản hồi

200 The node id of the first element the selector matched.

object

  • node_id integer bắt buộc

Ví dụ

{
  "node_id": 21
}
400 The id is not a uuid, or the body is missing a field or has a value out of range.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: body must be JSON {node_id: integer}"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
409 The profile is not running, its tab is gone, or the page did not answer in time.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: profile is not running; call launch_profile first"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "wait_for_element",
"arguments": {
"profile_id": "",
"selector": ""
}
}

set_file

POST /v1/profiles/:id/set-file ghi

Attach a file to a file input (<input type=file>, often shown as a "Choose File" button) of a running profile's page by node_id, instead of clicking it - a click opens the system file picker, which cannot be controlled. Only files inside the app's uploads folder (~/.veilus/data/uploads) are allowed: pass the file name, or an absolute path inside that folder; anything else is refused. Ask the user to copy the file there first.

Gọi route REST POST /v1/profiles/:id/set-file

Tham số

  • node_id integer bắt buộc

    node_id from snapshot ([id=N]) or wait_for_element

  • path string bắt buộc

    file name inside ~/.veilus/data/uploads

  • profile_id string bắt buộc

    UUID of a running profile (launch_profile first)

Phản hồi

200 The file is attached to the input.

object

  • result string bắt buộc

Ví dụ

{
  "result": "file set on node 30"
}
400 The id is not a uuid, or path is not a file inside the uploads folder.

object

  • error string bắt buộc

Ví dụ

{
  "error": "invalid request: `path` must be a file inside the uploads folder ~/.veilus/uploads; copy the file there first"
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
404 The node id is stale: the page changed since the snapshot. Call snapshot again.

object

  • error string bắt buộc

Ví dụ

{
  "error": "not found: element [id=42] — the page changed since the snapshot; call snapshot for fresh ids, then retry"
}
409 The profile is not running, its tab is gone, or the page did not answer in time.

object

  • error string bắt buộc

Ví dụ

{
  "error": "conflict: profile is not running; call launch_profile first"
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "set_file",
"arguments": {
"profile_id": "",
"node_id": 0,
"path": ""
}
}

Hệ thống

get_capacity

GET /v1/capacity đọc

How many browsers are open (active), waiting for a slot (queued) and allowed at once (max) on this machine. Use it to choose run_batch concurrency.

Gọi route REST GET /v1/capacity

Phản hồi

200 Pool capacity and current usage.

object

  • active integer bắt buộc
  • max integer bắt buộc
  • queued integer bắt buộc

Ví dụ

{
  "active": 1,
  "max": 4,
  "queued": 0
}
401 No bearer token, or not a token this app issued. The body is empty: it never says which.

null

403 Refused by the plan: it no longer includes the local API (checked on every request), or it does not allow this action (profile or schedule limit, parallel runs). A request whose Host header is not loopback is also 403, with an empty body.

object | null

  • error string bắt buộc

Ví dụ

{
  "error": "API access requires a paid plan."
}
500 Veilus failed: storage could not be read or written, or a task panicked. The message says what failed; retrying rarely helps.

object

  • error string bắt buộc

Ví dụ

{
  "error": "internal error: list profiles: database is locked"
}

Mã mẫu

Lệnh gọi tool
{
"name": "get_capacity",
"arguments": {}
}

Để LLM làm tự động hoá giúp bạn đi qua trọn việc mà các tool này dùng cho, và các quy tắc an toàn chúng tuân theo.