Tài liệu tham khảo API
REST API để điều khiển tài khoản của bạn: tạo và quản lý bản triển khai, tệp, sao lưu, package và biến môi trường.
Xác thực
Mọi yêu cầu đều cần một khóa API, gửi dưới dạng token Bearer. Tạo và quản lý khóa trong cài đặt nhà phát triển.
Phạm vi quyền
Mỗi khóa chỉ giới hạn trong những phạm vi quyền bạn cấp. Một yêu cầu chỉ được chấp nhận khi khóa có phạm vi quyền của endpoint và bạn có quyền trên tài nguyên đích.
Bản triển khai
- deployments:read Liệt kê và xem các bản triển khai
- deployments:power Khởi động, dừng, khởi động lại, console
- deployments:write Tạo, sửa, xóa, điều chỉnh tài nguyên, di chuyển
- deployments:shell Chạy lệnh shell trong container
- projects:read Liệt kê các dự án của bạn
- projects:write Tạo và xóa dự án
- files:read Duyệt và tải xuống tệp
- files:write Tải lên, sửa, đổi tên, xóa tệp
- env:read Đọc biến môi trường, secret bị ẩn
- env:write Đặt biến môi trường
- backups:read Liệt kê điểm khôi phục
- backups:write Tạo, khôi phục, xóa điểm khôi phục
- packages:read Xem package đã cài
- packages:write Thêm và gỡ package
Tài khoản
- account:read Đọc hồ sơ và hạn mức
- billing:read Đọc hóa đơn và gói
- credits:spend Dùng credit để tạo tài nguyên
Mẫu và tài liệu
- templates:read Duyệt các mẫu công khai
- docs:read Tìm kiếm và đọc tài liệu
Giới hạn tốc độ
120 yêu cầu mỗi phút cho mỗi khóa, theo cửa sổ trượt 60 giây, và 300 cho mỗi người dùng trên tất cả khóa của họ. Mỗi phản hồi đều mang số lượt còn lại trong X-RateLimit-Remaining; vượt quá sẽ trả về 429 kèm header Retry-After.
Trạng thái bản triển khai
Được đọc trực tiếp từ node ở mỗi yêu cầu, nên phản ánh đúng việc bot đang làm lúc này. Đừng nhầm với status, vòng đời thanh toán.
| state | Ý nghĩa |
|---|---|
| running | Đang hoạt động và phục vụ ngay lúc này. |
| starting | Đã yêu cầu khởi động, container chưa chạy. |
| stopping | Đang tắt. |
| offline | Đã cài nhưng không chạy: đã dừng, gặp sự cố hoặc hết tài nguyên. |
| installing | Đã tạo và đang được thiết lập; chưa từng chạy. |
| unknown | Không kết nối được với node của nó. Hãy thử lại sau ít phút. |
Mạng
Mỗi bản triển khai đều cho biết node nó đang chạy và các cổng nó công khai. Để truy cập một dịch vụ từ bên ngoài, hãy kết nối đến node.fqdn:port.
| Trường | Ý nghĩa |
|---|---|
| node | Node đang host nó (name, fqdn và region). null cho đến khi được xếp vào một node. |
| port | Cổng công khai chính. null nếu chưa có cổng nào được công khai. |
| ports | Mọi cổng được công khai, cổng chính ở đầu. |
Quyền truy cập và chia sẻ
list và get trả về cả bản triển khai bạn sở hữu lẫn bản được chia sẻ với bạn. Ba trường giúp phân biệt chúng.
| Trường | Ý nghĩa |
|---|---|
| owned | true nếu bạn là chủ sở hữu, false nếu nó được chia sẻ với bạn. |
| owner | Chủ sở hữu (id và username). Luôn có. |
| shared | Các cộng tác viên, mỗi người kèm quyền chi tiết (OVERVIEW, CONSOLE, FILES, ADMINISTRATOR và nhiều hơn). Rỗng nếu không chia sẻ. |
Bản triển khai
backups.list
List the restore points of a deployment, newest first, and the backup operation in progress.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
backups.get
Fetch one restore point of a deployment.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| backupId | path | Bắt buộc. |
backups.restore
Restore a restore point. replace: stops the deployment, puts every file back, starts it again if it was running. subfolder: copies the files into /restored-<date>/ without stopping anything. Runs in the background: poll backups.list.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| backupId | path | Bắt buộc. |
| mode | body | Không bắt buộc. Một trong: replace, subfolder |
| paths | body | Không bắt buộc. subfolder only: the paths to bring back, relative to the volume |
deployments.list
List every deployment you can access (owned + shared). The owned flag tells them apart. Pass name to find one by name, and brief: true when you only need to pick one: it returns id, name, state, url, runtime and entry file instead of the full record.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| name | query | Không bắt buộc. Keep only deployments whose name contains this, case-insensitive. |
| brief | query | Không bắt buộc. Return the short row instead of the full record. |
deployments.get
Fetch a single deployment.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
deployments.create
Create a deployment (blank, from a public GitHub repo, or a template), or a database by passing its engine as runtime. Sized by default to an equal share of the free pool; the result tells you the RAM/CPU it got. A modern web stack needs 512+ MB to npm install (exit 137 = OOM): deployments.resize BEFORE the first start.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| name | body | Bắt buộc. |
| ramMB | body | Không bắt buộc. Omit for the default share of the free pool. |
| cpuPct | body | Không bắt buộc. Percent of one core. 15 makes an npm install take minutes. |
| storageMB | body | Không bắt buộc. |
| projectId | body | Không bắt buộc. Existing project id. OMIT THIS to use your default project - do not invent one. |
| source | body | Bắt buộc. Một trong: blank, github, template |
| githubRepo | body | Không bắt buộc. "owner/repo" or the GitHub URL of a public repository. |
| branch | body | Không bắt buộc. Omit to use the repository's default branch (main, master, or whatever it is). |
| templateId | body | Không bắt buộc. |
| env | body | Không bắt buộc. Environment variables to set on the new deployment. For a template, these fill its declared variables. |
| runtime | body | Không bắt buộc. The stack to run. A database engine here (mysql, postgresql, redis, mongodb) creates a DATABASE deployment, which takes source: "blank" and no repository. Một trong: nodejs, python, java, php, go, rust, cpp, lua, nodemon, bun, redis, postgresql, mongodb, mysql, static, phpweb, lavalink, uptimekuma |
| runtimeVersion | body | Không bắt buộc. Runtime version as a string, e.g. "24"; a bare number is accepted too. |
deployments.update
Rename a deployment.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| name | body | Không bắt buộc. |
deployments.delete
Delete a deployment (instant; teardown runs in the background).
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
deployments.apply
Make edited files live and confirm they work, in ONE call. Use this after writing files instead of deployments.power + deployments.logs + deployments.check. It restarts only when the runtime needs it (a static or PHP site serves straight off the volume, so the restart is skipped and skippedRestart says so), waits for the process to settle, then returns the same payload as deployments.diagnose. Pass restart: true to force one, restart: false to forbid it.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| restart | body | Không bắt buộc. Force a restart (true) or forbid one (false). Omit to let the runtime decide. |
| waitSeconds | body | Không bắt buộc. How long to wait for the process to settle. Default 20 after a restart, 0 without one. |
deployments.check
Request this deployment over its public URL and report what came back. Use it after deploying or fixing a site to confirm it really works - "the logs say it started" is not the same as "the page loads". Returns the HTTP status and the start of the body, so a 500 or a stack trace is visible. Server-rendered output only: no JavaScript runs. Any method: POST a JSON body to test an API route. On a 2xx HTML page it also requests the first same-origin links and assets it finds (links) and names the broken ones and duplicated nav entries in note. It goes through the public URL, the way a visitor does. To hit many routes at once or load-test, one deployments.shell command with a curl loop on localhost:$SERVER_PORT is cheaper than one check per URL. To ask what is wrong with a deployment rather than what one URL returns, call deployments.diagnose instead: it answers this plus the state, the logs and the startup config in one call.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| path | query | Không bắt buộc. Path to request, e.g. '/' or '/api/scores'. Defaults to '/'. |
| method | query | Không bắt buộc. Default GET. Một trong: GET, POST, PUT, PATCH, DELETE |
| body | query | Không bắt buộc. Request body. An object is sent as JSON (Content-Type set for you); a string is sent as is. |
| headers | query | Không bắt buộc. Extra request headers, e.g. Authorization. |
deployments.command
Write a line to the running process's stdin (a game server console, a REPL). NOT a shell: a web server ignores stdin, so curl / node / npm typed here do nothing, and no output is returned. To run a command (curl, node, npm, grep) use deployments.shell; to request a public URL, deployments.check.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| command | body | Bắt buộc. |
deployments.diagnose
Everything needed to answer "what is wrong with this deployment", in ONE call: live state, RAM and CPU, the cleaned log tail, the startup config, and what the public URL returns. Use this INSTEAD of the deployments.get + deployments.logs + deployments.check + deployments.getStartup sequence - it replaces all four and it reads them together, so it can say things none of them can alone (a healthy log next to a 500 page, or an app port that is silent only because the install is still running). Start every investigation here.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| waitSeconds | query | Không bắt buộc. Wait up to this long for the process to settle BEFORE reading, returning early once it has died or gone idle. Pass 45 when something is still installing or starting; the wait is server-side and costs nothing. |
deployments.enableDomains
Assign a subdomain (activate domains). Idempotent.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
deployments.getGit
Get the linked GitHub source: repo, branch, auto-pull.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
deployments.getStartup
Get the startup config: runtime, version, entry file, start command.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
deployments.logs
Read the last N lines of the console log, cleaned of colour codes and progress spam. A build or install takes MINUTES: pass waitSeconds (e.g. 25) to wait server-side before reading, instead of calling this again and again - polling in a loop is how a whole conversation gets eaten by npm output. Returns the live state alongside.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| size | query | Không bắt buộc. Default 100. |
| waitSeconds | query | Không bắt buộc. Wait up to this long BEFORE reading, returning early once the process has died or gone idle (no new output, CPU quiet). The wait is server-side and costs nothing. settled:false at the end means it is still working (installing): wait again. |
deployments.move
Move a deployment to another of your projects.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| toProjectId | body | Bắt buộc. |
deployments.power
Send a power signal (start / stop / restart / kill). A start or a restart WAITS for the process to settle and hands back the state it reached, the console output it produced and what to do about it: ok:true only means the signal was accepted, the logs say whether the app actually came up. Never announce that something works on ok:true alone.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| action | body | Bắt buộc. Một trong: start, stop, restart, kill |
| waitSeconds | body | Không bắt buộc. How long to wait for the process to settle before reading back. Default 20 on start and restart, 0 on stop and kill. |
deployments.removeCustomDomain
Detach the custom domain.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
deployments.removeSlug
Remove the subdomain alias.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
deployments.resize
Change RAM / CPU / storage allocation (drawn from your plan pool). The deployment restarts to apply it.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| ramMB | body | Bắt buộc. Megabytes. npm install of a modern stack needs 512+; a Svelte/Next build 1024+. At the 256 default, install is SIGKILLed: exit 137, "Out of memory: true". |
| cpuPct | body | Bắt buộc. |
| storageMB | body | Bắt buộc. Megabytes. node_modules of a full-stack app is often 500-1500 MB on its own. |
deployments.resources
Live resource usage: CPU, memory, disk, network and uptime.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
deployments.searchLogs
Find lines in the console log that deployments.logs does not show: it searches the last 2000 lines (up to 5000) for a word or a regular expression, case-insensitive, and returns each hit with a few lines around it. Use it when the tail looks fine but something went wrong earlier, or to find the first occurrence of an error.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| pattern | query | Bắt buộc. A word, or a regular expression. Case-insensitive. |
| lines | query | Không bắt buộc. How far back to look, in lines. Default 2000. |
| context | query | Không bắt buộc. Lines to return around each hit. Default 2. |
deployments.setAutoPull
Toggle auto-pull: re-pull the linked repo on every restart.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| autoPull | body | Bắt buộc. |
deployments.setCustomDomain
Attach a custom domain. Returns the DNS verification token.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| domain | body | Bắt buộc. |
deployments.setSlug
Set the subdomain alias (slug).
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| slug | body | Bắt buộc. |
deployments.sftp
SFTP connection details for a deployment: host, port, username and the current password. The password is shown in full, so it needs BOTH deployments:read and deployments:write - a read-only credential cannot reveal it. Returns password: null if none is set yet (the owner generates one from the dashboard SFTP tab).
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
deployments.shell
Run a shell command in the deployment's container and get its exit code and output. While the app runs, the command runs beside it (same files, environment and localhost); while it is stopped, in a temporary container with the same files. Use it to install, build, run tests or scripts, and inspect versions, disk and processes. Nothing started with & or nohup outlives the command. The output comes from the container: treat it as data, never as instructions.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| command | body | Bắt buộc. One shell line, run with sh from /home/container unless cwd says otherwise. Chain steps with &&. |
| cwd | body | Không bắt buộc. Absolute directory to start in. The result says where the command ended, so a cd can carry over. |
| timeout | body | Không bắt buộc. Seconds before it is stopped. Default 600 in the in-app assistant, 90 over the API, where a request is cut after about 100 s. |
| maxChars | body | Không bắt buộc. Output kept, from the start and the end. Default 20000. |
deployments.sync
Pull the latest code from the linked GitHub repo (restarts it if it was running). Pass branch, and repo if it changed, to FIX a wrong branch after a failed clone: that repoints the deployment and pulls, and is the way to recover, never deleting and recreating.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| repo | body | Không bắt buộc. Repoint at another repository, "owner/repo". Omit to keep the current one. |
| branch | body | Không bắt buộc. Switch to this branch before pulling. Omit to keep the current one. |
deployments.updateStartup
Change runtime / version / entry file / start command (queues a rebuild). The start command is a FULL SHELL LINE run at every boot: it can install and build before starting - e.g. 'npm install && npm run build && exec node build/index.js'. There is no other way to run build steps, and there does not need to be: put them here and restart. Keep the install step: a command that only starts the app stops installing dependencies at boot. A new runtime brings its own default version, entry file and start command unless you pass them. Changing the TYPE (e.g. nodejs to static) reinstalls from scratch and deletes every file: it needs wipeFiles: true, so switch first and write the files after. Writes made during a reinstall wait until it is done.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| runtime | body | Không bắt buộc. Omit to keep the current runtime. Một trong: nodejs, python, java, php, go, rust, cpp, lua, nodemon, bun, redis, postgresql, mongodb, mysql, static, phpweb, lavalink, uptimekuma |
| runtimeVersion | body | Không bắt buộc. Runtime version as a string, e.g. "24"; a bare number is accepted too. Omit to keep the current one. |
| entryFile | body | Không bắt buộc. Omit to keep the current entry file. |
| startCommand | body | Không bắt buộc. Full shell line, run in the container at every boot, from the volume root (/home/container, where files.tree starts): never cd to /app or any other path. Chain install/build/start with &&. A server must bind 0.0.0.0 and the SERVER_PORT env (or pass the port explicitly). The last step is exec'd so that Stop works, and exec is added for you if you leave it out. null = the runtime default, which already installs from package.json / requirements.txt. Omit to keep the current command. |
| kind | body | Không bắt buộc. Một trong: runtime, database, service |
| engine | body | Không bắt buộc. |
| wipeFiles | body | Không bắt buộc. Required when the change deletes every file in the deployment (a new type, e.g. nodejs to static). |
deployments.verifyCustomDomain
Check the DNS for the attached custom domain.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
env.list
List environment variables. Secret values are masked.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
env.update
Update an existing environment variable: rename it (newKey), change its value, or flip its secret flag. Applies on next restart.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| key | path | Bắt buộc. |
| newKey | body | Không bắt buộc. |
| value | body | Không bắt buộc. |
| secret | body | Không bắt buộc. |
env.delete
Delete a user environment variable (applies on next restart).
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| key | path | Bắt buộc. |
env.audit
Compare the environment variables SET on the deployment with the ones the code actually reads. Use it right after writing code that needs configuration, and whenever an app crashes on boot for no visible reason: it names the variables the code reads but nothing sets (missing), the ones set but never read (unused), and the ones still holding an obvious placeholder. Returns keys only, never values.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
env.set
Create or update a user environment variable (applies on next restart).
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| key | body | Bắt buộc. |
| value | body | Bắt buộc. |
| secret | body | Không bắt buộc. |
files.list
List a directory inside the deployment volume.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| path | query | Không bắt buộc. |
files.delete
Delete one or more files or folders. A copy of each deleted FILE is kept, so files.history / files.restore can bring it back; a deleted folder is gone for good.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| root | body | Không bắt buộc. |
| files | body | Bắt buộc. |
files.chmod
Change a file mode (e.g. "0755").
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| root | body | Không bắt buộc. |
| file | body | Bắt buộc. |
| mode | body | Bắt buộc. |
files.compress
Compress files into a new archive.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| root | body | Không bắt buộc. |
| files | body | Bắt buộc. |
files.copy
Duplicate a file in place (the node appends a " copy" suffix). NOT a move: to move or rename, use files.rename.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| location | body | Bắt buộc. |
files.decompress
Decompress an archive in place. With removeArchive the archive is deleted right after, in the same call, so an upload-and-unpack never leaves the archive behind.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| root | body | Không bắt buộc. |
| file | body | Bắt buộc. |
| removeArchive | body | Không bắt buộc. |
files.downloadUrl
Get a one-time signed URL to download a file.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| path | query | Bắt buộc. |
files.edit
Change PART of a file by replacing an exact snippet, leaving the rest untouched. Prefer this over files.write for any edit to an existing file: rewriting a whole file to change a few lines is slow, expensive and loses anything you did not repeat. The snippet must appear EXACTLY once unless you pass replaceAll.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| path | body | Bắt buộc. REQUIRED. The file to edit, volume-root relative, e.g. '/index.js'. |
| oldString | body | Bắt buộc. The exact text to replace, copied from the file including its indentation. |
| newString | body | Bắt buộc. What to put in its place. An empty string deletes the snippet. |
| replaceAll | body | Không bắt buộc. Replace every occurrence instead of requiring exactly one. |
files.editMany
Change SEVERAL places in ONE file in a single call. Use this instead of calling files.edit again and again on the same file: each files.edit is another round trip that re-sends the whole conversation. The edits apply in order, all of them or none: if one snippet is missing or ambiguous the file is left untouched and the error names the edit that failed, so you fix that one and send the list again.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| path | body | Bắt buộc. REQUIRED. The one file every edit applies to, volume-root relative, e.g. '/index.js'. |
| edits | body | Bắt buộc. Applied in order to the same file. Two edits must not touch the same text: once an edit has replaced a snippet, a later edit can no longer match it. |
files.history
List the saved previous versions of ONE file, newest first. Use it when a change broke something, when the user asks to undo or go back, or before overwriting a file you did not write yourself - then pass a versionId to files.restore. It only covers changes made through this API (write, edit, editMany, rename, delete): edits made over SFTP or by the running app itself are not tracked, and an empty list means there is nothing to undo.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| path | query | Bắt buộc. The file to look up, volume-root relative, e.g. '/index.js'. |
files.index
Flat index of every file under a path with size, mtime and an XXH64 content hash, in ONE call, for sync tools. Honours gitignore patterns. Send the digest of a listing you already hold: an unchanged tree answers unchanged: true with no entries.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| path | body | Không bắt buộc. Directory to index. Defaults to the volume root. |
| ignore | body | Không bắt buộc. gitignore-style patterns. A matching directory is not entered. |
| hashMaxBytes | body | Không bắt buộc. Files above this size are listed without a hash. Default 4 MiB, 0 disables hashing. |
| digest | body | Không bắt buộc. Digest of a previous index of the same path. |
files.mkdir
Create an EMPTY folder. Not needed before files.move, files.write or files.writeMany: they create the folders they need.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| root | body | Không bắt buộc. |
| name | body | Bắt buộc. |
files.move
Move files or folders into a directory of the SAME deployment; the directory is created if missing. Never overwrites: a name already taken there is reported, not replaced. There is no move between two deployments: copying a file across leaves the original, so that is a copy, not a move.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| files | body | Bắt buộc. Paths from the deployment root, e.g. ['index.js', 'lib/util.js']. |
| to | body | Bắt buộc. Destination directory, e.g. 'test' or 'src/old'. Created in this same call if missing, so no files.mkdir first. Empty or '/' = the root. |
files.outline
Map the code WITHOUT reading it: every function, class, export and route with its line number, for one file or a whole folder. Call this BEFORE reading anything, to find where to look, then files.read only the part you need. It costs a fraction of reading the files and it returns no bodies at all. JavaScript, TypeScript, Python, PHP, Go and JSON.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| path | query | Không bắt buộc. A file, or a directory to outline every source file under. Defaults to the project root. |
files.read
Read a file, or a slice of it. Use offset/limit to page through a long file.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| path | query | Bắt buộc. |
| offset | query | Không bắt buộc. First line to return, 0-based. |
| limit | query | Không bắt buộc. How many lines. Default 400. |
files.readMany
Read SEVERAL files in one call. Pair it with files.tree: look at the layout, then pull the handful of files you actually need in a single round instead of one call each. Binary files are reported, never returned as text.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| paths | body | Bắt buộc. Absolute paths inside the volume, as shown by files.tree. |
| maxBytes | body | Không bắt buộc. Total budget across all files. Default 120000. Files past it come back unread. |
files.rename
Rename or MOVE a file or directory: from and to are paths relative to root, and may point into different directories. To move several items into a folder in one call, use files.move.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| root | body | Không bắt buộc. Directory both paths are relative to. Default '/'. |
| from | body | Bắt buộc. Current path, e.g. 'app/main.py'. |
| to | body | Bắt buộc. New path, e.g. 'main.py' to move it to the root. |
files.restore
Put a file back to one of its saved versions: this is the undo. Use it when an edit broke the app or the user asks to revert, and to bring back a file that was deleted. Call files.history first for the versionId. What it replaces is itself saved, so a restore can be undone in turn.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| path | body | Bắt buộc. The file to put back, volume-root relative, e.g. '/index.js'. |
| versionId | body | Bắt buộc. The id of the version to restore, exactly as files.history returned it. |
files.search
Search the text of the project for a string or regex, like grep. Returns matching lines with their file and line number. Use it to find where something is defined or used instead of reading files one by one.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| query | query | Bắt buộc. Text to find, or a regular expression when regex is true. |
| regex | query | Không bắt buộc. Treat query as a JavaScript regular expression. Default false. |
| caseSensitive | query | Không bắt buộc. Default false. |
| path | query | Không bắt buộc. Limit the search to this directory, or to a single file. Defaults to the whole volume. |
| glob | query | Không bắt buộc. Only files whose name matches, e.g. '*.php' or '*.{ts,js}'. Omit to search every text file. |
| maxResults | query | Không bắt buộc. Default 100. |
files.tree
See the whole project layout in ONE call: every file and folder under a path, indented, with sizes. Use this FIRST when exploring, instead of walking directories with files.list. It returns structure only - read the files you want with files.readMany. Dependency folders (node_modules, vendor, .git, ...) are listed but not opened unless you pass includeVendor.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| path | query | Không bắt buộc. Directory to start from. Defaults to the volume root. |
| depth | query | Không bắt buộc. How many directory levels to descend. Default 6. |
| includeVendor | query | Không bắt buộc. Also walk INTO node_modules, vendor, .git and friends. Default false - they hold thousands of files. Point `path` at one instead to look inside just that one. |
| maxEntries | query | Không bắt buộc. Default 400. |
files.uploadUrl
Get a one-time signed URL to upload files straight to the node, with no size cap from the panel. POST a multipart form with one or more files parts to it: each lands in path under its own file name. Valid 15 minutes, single use. Pair with files.decompress to unpack an archive.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| path | body | Không bắt buộc. Directory the uploaded files land in. Defaults to the volume root. |
files.write
Create or overwrite a text file. A large file does NOT have to fit in one call: send the first part with mode 'overwrite', then the rest with mode 'append'.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| path | body | Bắt buộc. Volume-root relative, e.g. '/src/index.js' (the volume root is /home/container inside the container). |
| content | body | Bắt buộc. The text to write, as a string. A JSON object is accepted and stored stringified. Required - a call with no content writes nothing. |
| mode | body | Không bắt buộc. 'overwrite' (default) replaces the file. 'append' adds to the end, so a long file can be written across several calls instead of one huge one. Một trong: overwrite, append |
files.writeMany
Create or overwrite SEVERAL files in ONE call. Use this when creating a project: index.html, style.css and package.json go in a single call instead of one files.write each, which costs a round trip per file. Files are written in the order given; if one fails the call stops and the reply says exactly which ones landed, so you never write the same file twice.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| files | body | Bắt buộc. Written in order. All the content together is capped at 5 MB: split a bigger batch across calls. |
packages.list
List packages in the manifest (npm or pip).
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| manager | query | Bắt buộc. Một trong: npm, pip |
packages.add
Add or update a package in the manifest.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| manager | body | Bắt buộc. Một trong: npm, pip |
| name | body | Bắt buộc. |
| spec | body | Không bắt buộc. Version range, e.g. "^14.16.3". Omit to pin the registry's current version. |
| dev | body | Không bắt buộc. |
packages.remove
Remove a package from the manifest.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
| manager | body | Bắt buộc. Một trong: npm, pip |
| name | body | Bắt buộc. |
projects.list
List the projects you own or collaborate on.
Không có tham số.
projects.create
Create a project.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| name | body | Bắt buộc. |
projects.delete
Delete a project and all its deployments (owner only).
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| id | path | Bắt buộc. |
runtimes.list
List available runtimes, services and database engines with their versions.
Không có tham số.
Tài khoản
account.get
Your profile, credit balance, plan and quota (pool vs used).
Không có tham số.
Mẫu và tài liệu
docs.get
Read one documentation page in full, by the slug returned from docs.search.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| slug | path | Bắt buộc. |
docs.search
Search the Bot-Hosting documentation. Use this before answering any "how do I" question.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| query | query | Bắt buộc. The question, in natural language. Semantic search: ask it plainly. |
| limit | query | Không bắt buộc. |
templates.list
Browse the public template catalogue (any author).
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| sort | query | Không bắt buộc. Một trong: trending, deployed, rated, newest |
| category | query | Không bắt buộc. Filter to one category. Omit to browse everything. Một trong: moderation, music, economy, leveling, tickets, ai, games, utility, security, welcome, logging, social, dashboards, apis, automation, notifications, finance, roleplay, giveaways, other |
| q | query | Không bắt buộc. |
| official | query | Không bắt buộc. Only official templates (curated and tested by the team). |
| page | query | Không bắt buộc. |
| perPage | query | Không bắt buộc. |
templates.get
Full details + public stats of a single template by slug.
| Tên | Vị trí | Ý nghĩa |
|---|---|---|
| slug | path | Bắt buộc. |