Bàn làm việc nhà phát triển
Quản lý triển khai bằng REST API, MCP hoặc CLI.
Request API đầu tiên của bạn
Dùng token có quyền read để liệt kê các bot nó thấy. Trong shell, đặt BH_PORTAL_URL thành origin bảng điều khiển của bạn và BH_API_TOKEN thành token từ Tài khoản → tác nhân AI.
GET/api/v1/botscurl --fail-with-body \
-H "Authorization: Bearer $BH_API_TOKEN" \
"$BH_PORTAL_URL/api/v1/bots"200 OK{
"bots": []
}Khi token này không thấy bot nào.
Tài liệu REST API
Xem JSON OpenAPIread26 thao tác
Xem tài khoản, triển khai, runtime còn trống, tên miền, trạng thái và nhật ký.
GET/api/v1/me
- ID thao tác
whoami- Scope bắt buộc
read
GET/api/v1/plans
- ID thao tác
list_plans- Scope bắt buộc
read
GET/api/v1/bots
- ID thao tác
list_bots- Scope bắt buộc
read
GET/api/v1/bots/{id}
- ID thao tác
get_bot- Scope bắt buộc
read
GET/api/v1/bots/{id}/status
- ID thao tác
get_status- Scope bắt buộc
read
GET/api/v1/bots/{id}/usage
- ID thao tác
get_usage- Scope bắt buộc
read
GET/api/v1/bots/{id}/logs
- ID thao tác
get_logs- Scope bắt buộc
read
GET/api/v1/bots/{id}/logs/stream
- ID thao tác
tail_logs- Scope bắt buộc
read
GET/api/v1/deployments/{id}/database
Đọc endpoint cơ sở dữ liệu thuộc sở hữu và cách xác thực. Tải định danh client riêng trong bảng điều khiển của chủ sở hữu.
- ID thao tác
get_database_connection- Scope bắt buộc
read
GET/api/v1/pool
Đọc sức chứa gói tài khoản và tài nguyên đã giữ.
- ID thao tác
get_resource_pool- Scope bắt buộc
read
GET/api/v1/runtimes
- ID thao tác
list_runtimes- Scope bắt buộc
read
GET/api/v1/deployments
- ID thao tác
list_deployments- Scope bắt buộc
read
GET/api/v1/deployments/{id}
- ID thao tác
get_deployment- Scope bắt buộc
read
GET/api/v1/deployments/{id}/backups/history
Liệt kê điểm khôi phục tự động cùng khoảng và thời gian giữ bản sao lưu của triển khai.
- ID thao tác
list_recovery_points- Scope bắt buộc
read- Tham số truy vấn
before
GET/api/v1/deployments/{id}/domains
Liệt kê hostname đã gắn. Dịch vụ tên miền gán địa chỉ triển khai mặc định ở lần dùng đầu.
- ID thao tác
list_domains- Scope bắt buộc
read
GET/api/v1/deployments/{id}/releases
- ID thao tác
get_site_releases- Scope bắt buộc
read
GET/api/v1/deployments/{id}/runs
- ID thao tác
get_job_runs- Scope bắt buộc
read
GET/api/v1/deployments/{id}/ports
Liệt kê cổng triển khai đã gán, giới hạn mỗi triển khai và revision hiện tại.
- ID thao tác
list_ports- Scope bắt buộc
read
GET/api/v1/projects
- ID thao tác
list_projects- Scope bắt buộc
read
GET/api/v1/docs/search
- ID thao tác
search_docs- Scope bắt buộc
read- Tham số truy vấn
query,limit
GET/api/v1/docs/{slug}
- ID thao tác
get_doc- Scope bắt buộc
read
GET/api/v1/templates
- ID thao tác
list_templates- Scope bắt buộc
read- Tham số truy vấn
sort,category,q,official,page,perPage
GET/api/v1/templates/{slug}
- ID thao tác
get_template- Scope bắt buộc
read
GET/api/v1/deployments/{id}/check
- ID thao tác
check_deployment- Scope bắt buộc
read- Tham số truy vấn
path
GET/api/v1/deployments/{id}/diagnose
- ID thao tác
diagnose_deployment- Scope bắt buộc
read
GET/api/v1/deployments/{id}/logs/search
- ID thao tác
search_logs- Scope bắt buộc
read- Tham số truy vấn
pattern,context
manage75 thao tác
Vận hành triển khai thuộc sở hữu, tệp, biến, package, tên miền và bản sao lưu.
POST/api/v1/bots/{id}/power
- ID thao tác
power- Scope bắt buộc
manage- Trường JSON
signal,confirm
GET/api/v1/bots/{id}/env
- ID thao tác
get_env- Scope bắt buộc
manage
POST/api/v1/bots/{id}/token
- ID thao tác
set_bot_token- Scope bắt buộc
manage- Trường JSON
token,confirm
POST/api/v1/bots/{id}/env
- ID thao tác
set_env- Scope bắt buộc
manage- Trường JSON
values,confirm
GET/api/v1/bots/{id}/files
- ID thao tác
list_files- Scope bắt buộc
manage- Tham số truy vấn
directory
GET/api/v1/bots/{id}/files/read
- ID thao tác
read_file- Scope bắt buộc
manage- Tham số truy vấn
path
POST/api/v1/bots/{id}/files/write
- ID thao tác
write_file- Scope bắt buộc
manage- Trường JSON
path,content,confirm
POST/api/v1/bots/{id}/files/upload
- ID thao tác
upload_files- Scope bắt buộc
manage- Trường JSON
path,base64,confirm
POST/api/v1/bots/{id}/files/extract
- ID thao tác
extract_file- Scope bắt buộc
manage- Trường JSON
path,confirm
DELETE/api/v1/bots/{id}
- ID thao tác
delete_bot- Scope bắt buộc
manage- Trường JSON
confirm
PATCH/api/v1/deployments/{id}/allocation
Giữ và áp giới hạn tài nguyên native mới cho một triển khai pool thuộc sở hữu.
- ID thao tác
resize_deployment- Scope bắt buộc
manage- Trường JSON
resources,confirm
POST/api/v1/deployments/{id}/runtime
Dừng triển khai, giữ tệp dự án và cài lại runtime đã chọn. Kiểm tra trạng thái thiết lập trước khi khởi động.
- ID thao tác
change_runtime- Scope bắt buộc
manage- Trường JSON
profile,confirm
GET/api/v1/deployments/{id}/startup
Đọc profile workload hiện tại, họ runtime và tệp vào.
- ID thao tác
get_startup- Scope bắt buộc
manage
PATCH/api/v1/deployments/{id}/startup
Đặt tệp vào tương đối với thư mục gốc triển khai. Thay đổi có hiệu lực ở lần khởi động sau.
- ID thao tác
set_startup- Scope bắt buộc
manage- Trường JSON
entry,confirm
POST/api/v1/deployments/{id}/files/folder
- ID thao tác
create_folder- Scope bắt buộc
manage- Trường JSON
path
POST/api/v1/deployments/{id}/files/delete
- ID thao tác
delete_file- Scope bắt buộc
manage- Trường JSON
path,confirm
GET/api/v1/deployments/{id}/packages
Liệt kê phụ thuộc khai báo trong package.json hoặc requirements.txt ở thư mục gốc.
- ID thao tác
list_packages- Scope bắt buộc
manage
POST/api/v1/deployments/{id}/packages
Thêm hoặc cập nhật khai báo phụ thuộc Node.js hoặc Python. Khởi động triển khai để cài. Cập nhật lockfile hoặc requirements phức tạp qua trình sửa tệp.
- ID thao tác
set_package- Scope bắt buộc
manage- Trường JSON
name,version,confirm
POST/api/v1/deployments/{id}/packages/remove
Gỡ khai báo phụ thuộc khỏi manifest ở thư mục gốc.
- ID thao tác
remove_package- Scope bắt buộc
manage- Trường JSON
name,confirm
GET/api/v1/deployments/{id}/backups
Liệt kê bản sao lưu tệp trong dung lượng được quản lý của triển khai và giới hạn giữ của gói.
- ID thao tác
list_backups- Scope bắt buộc
manage
GET/api/v1/deployments/{id}/backups/detail
Xem một điểm khôi phục thuộc triển khai này.
- ID thao tác
get_backup- Scope bắt buộc
manage- Tham số truy vấn
backup
POST/api/v1/deployments/{id}/backups
Yêu cầu bản sao lưu được quản lý. Bản sao lưu hoàn thành được xoay theo chính sách giữ của gói.
- ID thao tác
create_backup- Scope bắt buộc
manage- Trường JSON
confirm
POST/api/v1/deployments/{id}/backups/restore
Khôi phục bản sao lưu tệp đã xác minh. Bảng điều khiển dừng triển khai và tạo điểm hoàn tác trước khi thay tệp.
- ID thao tác
restore_backup- Scope bắt buộc
manage- Trường JSON
backup,confirm
POST/api/v1/deployments/{id}/domains
Gắn hostname riêng và trả về bằng chứng TXT dùng một lần cùng đích CNAME.
- ID thao tác
register_domain- Scope bắt buộc
manage- Trường JSON
host,confirm
POST/api/v1/deployments/{id}/domains/verify
Kiểm tra CNAME và bằng chứng TXT của hostname riêng với dịch vụ tên miền.
- ID thao tác
verify_domain- Scope bắt buộc
manage- Trường JSON
domain
DELETE/api/v1/deployments/{id}/domains/custom
- ID thao tác
remove_domain- Scope bắt buộc
manage- Trường JSON
domain,confirm
POST/api/v1/deployments/{id}/runs
Yêu cầu một lần chạy thủ công từ worker script đang hoạt động.
- ID thao tác
request_job_run- Scope bắt buộc
manage- Trường JSON
confirm
POST/api/v1/deployments/{id}/ports
Gán thêm một cổng native từ pool node đã cấu hình.
- ID thao tác
allocate_port- Scope bắt buộc
manage- Trường JSON
revision
DELETE/api/v1/deployments/{id}/ports
Nhả một cổng phụ được quản lý theo ID cấp phát.
- ID thao tác
release_port- Scope bắt buộc
manage- Trường JSON
revision,allocation_id
POST/api/v1/projects
- ID thao tác
create_project- Scope bắt buộc
manage- Trường JSON
name
PATCH/api/v1/projects/{id}
- ID thao tác
rename_project- Scope bắt buộc
manage- Trường JSON
name
DELETE/api/v1/projects/{id}
- ID thao tác
delete_project- Scope bắt buộc
manage- Trường JSON
confirm
POST/api/v1/deployments/{id}/move
- ID thao tác
move_deployment- Scope bắt buộc
manage- Trường JSON
toProjectId
PATCH/api/v1/deployments/{id}
- ID thao tác
update_deployment- Scope bắt buộc
manage- Trường JSON
name,confirm
GET/api/v1/deployments/{id}/restart-policy
- ID thao tác
get_restart_policy- Scope bắt buộc
manage
PATCH/api/v1/deployments/{id}/restart-policy
- ID thao tác
set_restart_policy- Scope bắt buộc
manage- Trường JSON
enabled,confirm
GET/api/v1/deployments/{id}/git
- ID thao tác
get_git- Scope bắt buộc
manage
PATCH/api/v1/deployments/{id}/git
- ID thao tác
set_auto_pull- Scope bắt buộc
manage- Trường JSON
autoPull,confirm
GET/api/v1/deployments/{id}/sftp
- ID thao tác
get_sftp- Scope bắt buộc
manage
PATCH/api/v1/deployments/{id}/env
- ID thao tác
update_env_key- Scope bắt buộc
manage- Trường JSON
key,value,confirm
POST/api/v1/deployments/{id}/env/clear
- ID thao tác
clear_env_key- Scope bắt buộc
manage- Trường JSON
key,confirm
GET/api/v1/deployments/{id}/env/changes
- ID thao tác
get_env_changes- Scope bắt buộc
manage- Tham số truy vấn
page
GET/api/v1/deployments/{id}/files/content
- ID thao tác
read_file_content- Scope bắt buộc
manage- Tham số truy vấn
path,offset,limit
POST/api/v1/deployments/{id}/files/content
- ID thao tác
write_file_content- Scope bắt buộc
manage- Trường JSON
path,content,mode,confirm
POST/api/v1/deployments/{id}/files/read-many
- ID thao tác
read_many_files- Scope bắt buộc
manage- Trường JSON
paths,maxBytes
POST/api/v1/deployments/{id}/files/writeMany
- ID thao tác
write_many_files- Scope bắt buộc
manage- Trường JSON
files,confirm
POST/api/v1/deployments/{id}/files/edit
- ID thao tác
edit_file- Scope bắt buộc
manage- Trường JSON
oldString,newString,replaceAll,path,confirm
POST/api/v1/deployments/{id}/files/editMany
- ID thao tác
edit_many_file- Scope bắt buộc
manage- Trường JSON
path,edits,confirm
GET/api/v1/deployments/{id}/files/tree
- ID thao tác
file_tree- Scope bắt buộc
manage- Tham số truy vấn
path,depth,maxEntries,includeVendor
GET/api/v1/deployments/{id}/files/search
- ID thao tác
search_files- Scope bắt buộc
manage- Tham số truy vấn
path,query,regex,caseSensitive,glob,maxResults
GET/api/v1/deployments/{id}/files/outline
- ID thao tác
file_outline- Scope bắt buộc
manage- Tham số truy vấn
path
POST/api/v1/deployments/{id}/files/index
- ID thao tác
file_index- Scope bắt buộc
manage- Trường JSON
path,ignore,hashMaxBytes,digest
GET/api/v1/deployments/{id}/files/history
- ID thao tác
file_history- Scope bắt buộc
manage- Tham số truy vấn
path
POST/api/v1/deployments/{id}/files/restore
- ID thao tác
restore_file- Scope bắt buộc
manage- Trường JSON
path,versionId,confirm
POST/api/v1/deployments/{id}/files/rename
- ID thao tác
rename_file- Scope bắt buộc
manage- Trường JSON
root,from,to,confirm
POST/api/v1/deployments/{id}/files/move
- ID thao tác
move_files- Scope bắt buộc
manage- Trường JSON
files,to,confirm
POST/api/v1/deployments/{id}/files/copy
- ID thao tác
copy_file- Scope bắt buộc
manage- Trường JSON
location,confirm
POST/api/v1/deployments/{id}/files/chmod
- ID thao tác
chmod_file- Scope bắt buộc
manage- Trường JSON
root,file,mode,confirm
POST/api/v1/deployments/{id}/files/compress
- ID thao tác
compress_files- Scope bắt buộc
manage- Trường JSON
root,files,confirm
POST/api/v1/deployments/{id}/files/decompress
- ID thao tác
decompress_file- Scope bắt buộc
manage- Trường JSON
root,file,removeArchive,confirm
GET/api/v1/deployments/{id}/files/download-url
- ID thao tác
file_download_url- Scope bắt buộc
manage- Tham số truy vấn
path
POST/api/v1/deployments/{id}/files/upload-url
- ID thao tác
file_upload_url- Scope bắt buộc
manage- Trường JSON
path,confirm
POST/api/v1/deployments/{id}/console/command
Send one line of input to a running deployment’s console, exactly as typed in the dashboard console. The command runs inside the application, so its effect depends on the app. Read get_logs afterward for the output.
- ID thao tác
send_console_command- Scope bắt buộc
manage- Trường JSON
command,confirm
POST/api/v1/deployments/{id}/reinstall
Stop the deployment and reinstall its current runtime, keeping project files. Use change_runtime to switch runtimes instead. Check get_status before starting it again.
- ID thao tác
reinstall_deployment- Scope bắt buộc
manage- Trường JSON
confirm
POST/api/v1/deployments/{id}/token/reset
Clear the stored bot token so the deployment no longer signs in with it. Set a new one with set_bot_token before starting the bot again.
- ID thao tác
reset_bot_token- Scope bắt buộc
manage- Trường JSON
confirm
POST/api/v1/deployments/{id}/restore-deleted
Restore a deployment that was marked for deletion, from the verified backup taken at deletion, before its recovery deadline. Its files are replaced by that backup and automatic restart stays off.
- ID thao tác
restore_deleted_deployment- Scope bắt buộc
manage- Trường JSON
confirm
GET/api/v1/deployments/{id}/alerts
Report whether Discord crash alerts are connected for a deployment. The webhook address is never returned.
- ID thao tác
get_crash_alerts- Scope bắt buộc
manage
POST/api/v1/deployments/{id}/alerts
Connect a Discord webhook that receives a message when the deployment stops without a stop the owner requested. Replaces any existing webhook. The address is stored encrypted and is not shown again.
- ID thao tác
set_crash_alerts- Scope bắt buộc
manage- Trường JSON
webhookUrl,confirm
POST/api/v1/deployments/{id}/alerts/test
Send a test message to the deployment’s connected crash-alert webhook.
- ID thao tác
test_crash_alert- Scope bắt buộc
manage
DELETE/api/v1/deployments/{id}/alerts
Disconnect the deployment’s crash-alert webhook.
- ID thao tác
remove_crash_alerts- Scope bắt buộc
manage- Trường JSON
confirm
GET/api/v1/deployments/{id}/access
List the other Bothosting accounts that can use this deployment and the areas each one can use.
- ID thao tác
list_access- Scope bắt buộc
manage
POST/api/v1/deployments/{id}/access
Let another existing, verified Bothosting account use this deployment. Areas: console (console and power), files, settings (settings and environment), backups (view backups). An empty list gives view-only access. Sharing exposes the chosen areas to that person, so get explicit owner approval.
- ID thao tác
grant_access- Scope bắt buộc
manage- Trường JSON
email,areas,confirm
DELETE/api/v1/deployments/{id}/access
Remove another account’s access to this deployment. Use list_access for the id.
- ID thao tác
revoke_access- Scope bắt buộc
manage- Trường JSON
grantId,confirm
POST/api/v1/deployments/{id}/database/rotate
Issue a new client identity for a managed database, revoking the current one. The database must be stopped first. Every client must then download the new identity in the dashboard.
- ID thao tác
rotate_database_identity- Scope bắt buộc
manage- Trường JSON
confirm
POST/api/v1/deployments/{id}/database/sources
Replace the public IPv4 addresses allowed to open new connections to a managed database (up to eight). An empty list blocks new connections.
- ID thao tác
set_database_sources- Scope bắt buộc
manage- Trường JSON
sources,confirm
deploy11 thao tác
Yêu cầu thiết lập triển khai, xuất bản revision và cấu hình GitHub với quyền quản lý.
POST/api/v1/bots
- ID thao tác
create_bot- Scope bắt buộc
deploy- Trường JSON
name,runtime,tier,period
POST/api/v1/checkout
- ID thao tác
start_checkout- Scope bắt buộc
deploy- Trường JSON
name,runtime,tier,period
POST/api/v1/bots/{id}/upgrade
- ID thao tác
request_upgrade- Scope bắt buộc
deploy- Trường JSON
tier,period
POST/api/v1/bots/{id}/github
- ID thao tác
connect_github- Scope bắt buộc
deploy,manage- Trường JSON
repo,branch,confirm
POST/api/v1/bots/{id}/deploy
- ID thao tác
deploy- Scope bắt buộc
deploy- Trường JSON
confirm
POST/api/v1/pool/reservations/{id}/release
Nhả một lần giữ pool đang chờ đã đặt tên trước khi tạo native bắt đầu.
- ID thao tác
release_reservation- Scope bắt buộc
deploy- Trường JSON
confirm
POST/api/v1/pool/checkout
Trả về trang thanh toán cho người dùng để xác nhận gói tài khoản.
- ID thao tác
choose_account_plan- Scope bắt buộc
deploy- Trường JSON
plan,period
POST/api/v1/deployments
Tạo workload thuộc sở hữu bằng cách giữ tài nguyên trong gói tài khoản. Nhận miễn phí cần chủ sở hữu trên trình duyệt.
- ID thao tác
create_deployment- Scope bắt buộc
deploy- Trường JSON
name,profile,resources,tier,period
POST/api/v1/deployments/{id}/releases
Yêu cầu xuất bản hoặc hoàn tác từ worker website tĩnh đang chạy.
- ID thao tác
request_site_release- Scope bắt buộc
deploy- Trường JSON
action,confirm
POST/api/v1/deployments/{id}/sync
- ID thao tác
sync_git- Scope bắt buộc
deploy- Trường JSON
confirm
DELETE/api/v1/deployments/{id}/github
Remove the GitHub push-deploy link for a deployment. Repository settings in its environment stay; pushes no longer trigger deploys.
- ID thao tác
disconnect_github- Scope bắt buộc
deploy- Trường JSON
confirm
billing-read1 thao tác
Đọc trạng thái đăng ký và thanh toán.
GET/api/v1/billing
- ID thao tác
billing_status- Scope bắt buộc
billing-read
Không có thao tác khớp. Thử method, đường dẫn hoặc scope.
Máy chủ MCP
Kết nối client Streamable HTTP tới /mcp trên origin bảng điều khiển của bạn. Scope của token và các triển khai đã chọn quyết định công cụ mà client dùng được.
- Thiết lập trình soạn thảo
- Công cụ có sẵn
- 117 công cụ
- Kiểm tra kết nối
- Bảo trình soạn thảo chạy
list_deploymentsdùng token córeadquyền. - Triển khai GitHub
- Kết nối kho mã và nhánh trong tab Triển khai để triển khai thay đổi từ trình soạn thảo. Tìm hướng dẫn runtime
Token và OAuth
Chọn triển khai mà thông tin xác thực tới được, đặt hạn và thu hồi quyền trong Tài khoản → tác nhân AI.
Token Bearer
Sao chép token khi bạn tạo. Gửi token trong header Authorization như minh họa trong request đầu tiên. Yêu cầu ngoài các scope đã cấp sẽ trả về HTTP 403.
OAuth cho ứng dụng
- Đăng ký client công khai và URL callback tại
/oauth/register. - Yêu cầu đồng ý tại
/oauth/authorizevới state, scope và thử thách PKCE S256. Đặt resource thành origin bảng điều khiển của bạn cộng/api/v1cho REST hoặc/mcpcho trình soạn thảo. - Đổi mã ủy quyền và verifier tại
/oauth/token.
Công cụ dòng lệnh
Tải gói CLIDùng Node.js 22 trở lên và Git. Xuất BH_API_TOKEN và BH_PORTAL_URL trong shell. Dùng origin HTTPS của bảng điều khiển hoặc http://127.0.0.1 với cổng cục bộ.
Dùng read để liệt kê và liên kết triển khai. Thêm manage trước khi đồng bộ tệp. Dry run xem trước thay đổi. Bật watcher sẽ tải chúng lên rồi đồng bộ khi bạn sửa.
npm install -g ./bothosting-cli.tgz
bothosting list
bothosting link DEPLOYMENT_ID
bothosting push --dry-run
bothosting watchCài từ thư mục tải xuống. Chạy các lệnh còn lại trong thư mục dự án, thay DEPLOYMENT_ID bằng một ID trong danh sách. Nhấn Ctrl+C để ngừng theo dõi.