Workbench per sviluppatori

Gestisci i deploy con la REST API, MCP o la CLI.

La tua prima richiesta API

Usa un token con accesso read per elencare i bot che può vedere. Nella shell, imposta BH_PORTAL_URL sull'origine del pannello e BH_API_TOKEN sul token da Account → agenti AI.

GET/api/v1/bots
Richiesta
curl --fail-with-body \
  -H "Authorization: Bearer $BH_API_TOKEN" \
  "$BH_PORTAL_URL/api/v1/bots"
Risposta di esempio200 OK
{
  "bots": []
}

Quando nessun bot è visibile a questo token.

Reference della REST API

Vedi il JSON OpenAPI
read26 operazioni

Ispeziona account, deploy, disponibilità dei runtime, domini, stato e log.

GET/api/v1/me
ID operazione
whoami
Scope richiesti
read
GET/api/v1/plans
ID operazione
list_plans
Scope richiesti
read
GET/api/v1/bots
ID operazione
list_bots
Scope richiesti
read
GET/api/v1/bots/{id}
ID operazione
get_bot
Scope richiesti
read
GET/api/v1/bots/{id}/status
ID operazione
get_status
Scope richiesti
read
GET/api/v1/bots/{id}/usage
ID operazione
get_usage
Scope richiesti
read
GET/api/v1/bots/{id}/logs
ID operazione
get_logs
Scope richiesti
read
GET/api/v1/bots/{id}/logs/stream
ID operazione
tail_logs
Scope richiesti
read
GET/api/v1/deployments/{id}/database

Leggi l'endpoint e il metodo di autenticazione di un database di tua proprietà. Scarica l'identità client privata nel pannello del proprietario.

ID operazione
get_database_connection
Scope richiesti
read
GET/api/v1/pool

Leggi la capacità del piano account e le risorse riservate.

ID operazione
get_resource_pool
Scope richiesti
read
GET/api/v1/runtimes
ID operazione
list_runtimes
Scope richiesti
read
GET/api/v1/deployments
ID operazione
list_deployments
Scope richiesti
read
GET/api/v1/deployments/{id}
ID operazione
get_deployment
Scope richiesti
read
GET/api/v1/deployments/{id}/backups/history

Elenca i punti di recupero automatici e l'intervallo e la conservazione dei backup del deploy.

ID operazione
list_recovery_points
Scope richiesti
read
Parametri di query
before
GET/api/v1/deployments/{id}/domains

Elenca gli hostname collegati. Il servizio di dominio assegna l'indirizzo predefinito del deploy al primo uso.

ID operazione
list_domains
Scope richiesti
read
GET/api/v1/deployments/{id}/releases
ID operazione
get_site_releases
Scope richiesti
read
GET/api/v1/deployments/{id}/runs
ID operazione
get_job_runs
Scope richiesti
read
GET/api/v1/deployments/{id}/ports

Elenca le porte di deploy assegnate, il limite per deploy e la revisione corrente.

ID operazione
list_ports
Scope richiesti
read
GET/api/v1/projects
ID operazione
list_projects
Scope richiesti
read
GET/api/v1/docs/search
ID operazione
search_docs
Scope richiesti
read
Parametri di query
query, limit
GET/api/v1/docs/{slug}
ID operazione
get_doc
Scope richiesti
read
GET/api/v1/templates
ID operazione
list_templates
Scope richiesti
read
Parametri di query
sort, category, q, official, page, perPage
GET/api/v1/templates/{slug}
ID operazione
get_template
Scope richiesti
read
GET/api/v1/deployments/{id}/check
ID operazione
check_deployment
Scope richiesti
read
Parametri di query
path
GET/api/v1/deployments/{id}/diagnose
ID operazione
diagnose_deployment
Scope richiesti
read
GET/api/v1/deployments/{id}/logs/search
ID operazione
search_logs
Scope richiesti
read
Parametri di query
pattern, context
manage75 operazioni

Gestisci deploy di tua proprietà, file, variabili, pacchetti, domini e backup.

POST/api/v1/bots/{id}/power
ID operazione
power
Scope richiesti
manage
Campi JSON
signal, confirm
GET/api/v1/bots/{id}/env
ID operazione
get_env
Scope richiesti
manage
POST/api/v1/bots/{id}/token
ID operazione
set_bot_token
Scope richiesti
manage
Campi JSON
token, confirm
POST/api/v1/bots/{id}/env
ID operazione
set_env
Scope richiesti
manage
Campi JSON
values, confirm
GET/api/v1/bots/{id}/files
ID operazione
list_files
Scope richiesti
manage
Parametri di query
directory
GET/api/v1/bots/{id}/files/read
ID operazione
read_file
Scope richiesti
manage
Parametri di query
path
POST/api/v1/bots/{id}/files/write
ID operazione
write_file
Scope richiesti
manage
Campi JSON
path, content, confirm
POST/api/v1/bots/{id}/files/upload
ID operazione
upload_files
Scope richiesti
manage
Campi JSON
path, base64, confirm
POST/api/v1/bots/{id}/files/extract
ID operazione
extract_file
Scope richiesti
manage
Campi JSON
path, confirm
DELETE/api/v1/bots/{id}
ID operazione
delete_bot
Scope richiesti
manage
Campi JSON
confirm
PATCH/api/v1/deployments/{id}/allocation

Riserva e applica nuovi limiti di risorse native a un deploy del pool di tua proprietà.

ID operazione
resize_deployment
Scope richiesti
manage
Campi JSON
resources, confirm
POST/api/v1/deployments/{id}/runtime

Ferma il deploy, conserva i file del progetto e reinstalla il runtime selezionato. Controlla lo stato del setup prima di avviare.

ID operazione
change_runtime
Scope richiesti
manage
Campi JSON
profile, confirm
GET/api/v1/deployments/{id}/startup

Leggi il profilo di carico attuale, la famiglia di runtime e il file di ingresso.

ID operazione
get_startup
Scope richiesti
manage
PATCH/api/v1/deployments/{id}/startup

Imposta il file di ingresso relativo alla root del deploy. La modifica ha effetto al prossimo avvio.

ID operazione
set_startup
Scope richiesti
manage
Campi JSON
entry, confirm
POST/api/v1/deployments/{id}/files/folder
ID operazione
create_folder
Scope richiesti
manage
Campi JSON
path
POST/api/v1/deployments/{id}/files/delete
ID operazione
delete_file
Scope richiesti
manage
Campi JSON
path, confirm
GET/api/v1/deployments/{id}/packages

Elenca le dipendenze dichiarate nel package.json o nel requirements.txt della root.

ID operazione
list_packages
Scope richiesti
manage
POST/api/v1/deployments/{id}/packages

Aggiungi o aggiorna una dichiarazione di dipendenza Node.js o Python. Avvia il deploy per installarla. Aggiorna lockfile o requirements complessi dall'editor di file.

ID operazione
set_package
Scope richiesti
manage
Campi JSON
name, version, confirm
POST/api/v1/deployments/{id}/packages/remove

Rimuovi una dichiarazione di dipendenza dal manifest della root.

ID operazione
remove_package
Scope richiesti
manage
Campi JSON
name, confirm
GET/api/v1/deployments/{id}/backups

Elenca i backup dei file nello spazio gestito del deploy e il limite di conservazione del piano.

ID operazione
list_backups
Scope richiesti
manage
GET/api/v1/deployments/{id}/backups/detail

Ispeziona un punto di ripristino di questo deploy.

ID operazione
get_backup
Scope richiesti
manage
Parametri di query
backup
POST/api/v1/deployments/{id}/backups

Richiedi un backup gestito. I backup completati ruotano secondo la politica di conservazione del piano.

ID operazione
create_backup
Scope richiesti
manage
Campi JSON
confirm
POST/api/v1/deployments/{id}/backups/restore

Ripristina un backup dei file verificato. Il pannello ferma il deploy e crea un checkpoint di rollback prima di sostituire i file.

ID operazione
restore_backup
Scope richiesti
manage
Campi JSON
backup, confirm
POST/api/v1/deployments/{id}/domains

Collega un hostname proprio e restituisci la prova TXT monouso e la destinazione CNAME.

ID operazione
register_domain
Scope richiesti
manage
Campi JSON
host, confirm
POST/api/v1/deployments/{id}/domains/verify

Controlla il CNAME dell'hostname proprio e la prova TXT con il servizio di dominio.

ID operazione
verify_domain
Scope richiesti
manage
Campi JSON
domain
DELETE/api/v1/deployments/{id}/domains/custom
ID operazione
remove_domain
Scope richiesti
manage
Campi JSON
domain, confirm
POST/api/v1/deployments/{id}/runs

Richiedi un'esecuzione manuale da un worker di script attivo.

ID operazione
request_job_run
Scope richiesti
manage
Campi JSON
confirm
POST/api/v1/deployments/{id}/ports

Assegna una porta nativa aggiuntiva dal pool di nodi configurato.

ID operazione
allocate_port
Scope richiesti
manage
Campi JSON
revision
DELETE/api/v1/deployments/{id}/ports

Rilascia una porta secondaria gestita tramite il suo ID di allocazione.

ID operazione
release_port
Scope richiesti
manage
Campi JSON
revision, allocation_id
POST/api/v1/projects
ID operazione
create_project
Scope richiesti
manage
Campi JSON
name
PATCH/api/v1/projects/{id}
ID operazione
rename_project
Scope richiesti
manage
Campi JSON
name
DELETE/api/v1/projects/{id}
ID operazione
delete_project
Scope richiesti
manage
Campi JSON
confirm
POST/api/v1/deployments/{id}/move
ID operazione
move_deployment
Scope richiesti
manage
Campi JSON
toProjectId
PATCH/api/v1/deployments/{id}
ID operazione
update_deployment
Scope richiesti
manage
Campi JSON
name, confirm
GET/api/v1/deployments/{id}/restart-policy
ID operazione
get_restart_policy
Scope richiesti
manage
PATCH/api/v1/deployments/{id}/restart-policy
ID operazione
set_restart_policy
Scope richiesti
manage
Campi JSON
enabled, confirm
GET/api/v1/deployments/{id}/git
ID operazione
get_git
Scope richiesti
manage
PATCH/api/v1/deployments/{id}/git
ID operazione
set_auto_pull
Scope richiesti
manage
Campi JSON
autoPull, confirm
GET/api/v1/deployments/{id}/sftp
ID operazione
get_sftp
Scope richiesti
manage
PATCH/api/v1/deployments/{id}/env
ID operazione
update_env_key
Scope richiesti
manage
Campi JSON
key, value, confirm
POST/api/v1/deployments/{id}/env/clear
ID operazione
clear_env_key
Scope richiesti
manage
Campi JSON
key, confirm
GET/api/v1/deployments/{id}/env/changes
ID operazione
get_env_changes
Scope richiesti
manage
Parametri di query
page
GET/api/v1/deployments/{id}/files/content
ID operazione
read_file_content
Scope richiesti
manage
Parametri di query
path, offset, limit
POST/api/v1/deployments/{id}/files/content
ID operazione
write_file_content
Scope richiesti
manage
Campi JSON
path, content, mode, confirm
POST/api/v1/deployments/{id}/files/read-many
ID operazione
read_many_files
Scope richiesti
manage
Campi JSON
paths, maxBytes
POST/api/v1/deployments/{id}/files/writeMany
ID operazione
write_many_files
Scope richiesti
manage
Campi JSON
files, confirm
POST/api/v1/deployments/{id}/files/edit
ID operazione
edit_file
Scope richiesti
manage
Campi JSON
oldString, newString, replaceAll, path, confirm
POST/api/v1/deployments/{id}/files/editMany
ID operazione
edit_many_file
Scope richiesti
manage
Campi JSON
path, edits, confirm
GET/api/v1/deployments/{id}/files/tree
ID operazione
file_tree
Scope richiesti
manage
Parametri di query
path, depth, maxEntries, includeVendor
GET/api/v1/deployments/{id}/files/search
ID operazione
search_files
Scope richiesti
manage
Parametri di query
path, query, regex, caseSensitive, glob, maxResults
GET/api/v1/deployments/{id}/files/outline
ID operazione
file_outline
Scope richiesti
manage
Parametri di query
path
POST/api/v1/deployments/{id}/files/index
ID operazione
file_index
Scope richiesti
manage
Campi JSON
path, ignore, hashMaxBytes, digest
GET/api/v1/deployments/{id}/files/history
ID operazione
file_history
Scope richiesti
manage
Parametri di query
path
POST/api/v1/deployments/{id}/files/restore
ID operazione
restore_file
Scope richiesti
manage
Campi JSON
path, versionId, confirm
POST/api/v1/deployments/{id}/files/rename
ID operazione
rename_file
Scope richiesti
manage
Campi JSON
root, from, to, confirm
POST/api/v1/deployments/{id}/files/move
ID operazione
move_files
Scope richiesti
manage
Campi JSON
files, to, confirm
POST/api/v1/deployments/{id}/files/copy
ID operazione
copy_file
Scope richiesti
manage
Campi JSON
location, confirm
POST/api/v1/deployments/{id}/files/chmod
ID operazione
chmod_file
Scope richiesti
manage
Campi JSON
root, file, mode, confirm
POST/api/v1/deployments/{id}/files/compress
ID operazione
compress_files
Scope richiesti
manage
Campi JSON
root, files, confirm
POST/api/v1/deployments/{id}/files/decompress
ID operazione
decompress_file
Scope richiesti
manage
Campi JSON
root, file, removeArchive, confirm
GET/api/v1/deployments/{id}/files/download-url
ID operazione
file_download_url
Scope richiesti
manage
Parametri di query
path
POST/api/v1/deployments/{id}/files/upload-url
ID operazione
file_upload_url
Scope richiesti
manage
Campi 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 operazione
send_console_command
Scope richiesti
manage
Campi 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 operazione
reinstall_deployment
Scope richiesti
manage
Campi 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 operazione
reset_bot_token
Scope richiesti
manage
Campi 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 operazione
restore_deleted_deployment
Scope richiesti
manage
Campi 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 operazione
get_crash_alerts
Scope richiesti
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 operazione
set_crash_alerts
Scope richiesti
manage
Campi JSON
webhookUrl, confirm
POST/api/v1/deployments/{id}/alerts/test

Send a test message to the deployment’s connected crash-alert webhook.

ID operazione
test_crash_alert
Scope richiesti
manage
DELETE/api/v1/deployments/{id}/alerts

Disconnect the deployment’s crash-alert webhook.

ID operazione
remove_crash_alerts
Scope richiesti
manage
Campi 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 operazione
list_access
Scope richiesti
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 operazione
grant_access
Scope richiesti
manage
Campi 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 operazione
revoke_access
Scope richiesti
manage
Campi 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 operazione
rotate_database_identity
Scope richiesti
manage
Campi 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 operazione
set_database_sources
Scope richiesti
manage
Campi JSON
sources, confirm
deploy11 operazioni

Richiedi il setup del deploy, pubblica revisioni e configura GitHub con accesso di gestione.

POST/api/v1/bots
ID operazione
create_bot
Scope richiesti
deploy
Campi JSON
name, runtime, tier, period
POST/api/v1/checkout
ID operazione
start_checkout
Scope richiesti
deploy
Campi JSON
name, runtime, tier, period
POST/api/v1/bots/{id}/upgrade
ID operazione
request_upgrade
Scope richiesti
deploy
Campi JSON
tier, period
POST/api/v1/bots/{id}/github
ID operazione
connect_github
Scope richiesti
deploy, manage
Campi JSON
repo, branch, confirm
POST/api/v1/bots/{id}/deploy
ID operazione
deploy
Scope richiesti
deploy
Campi JSON
confirm
POST/api/v1/pool/reservations/{id}/release

Rilascia una prenotazione di pool in attesa con nome prima che inizi la creazione nativa.

ID operazione
release_reservation
Scope richiesti
deploy
Campi JSON
confirm
POST/api/v1/pool/checkout

Torna alla pagina di fatturazione per confermare un piano account.

ID operazione
choose_account_plan
Scope richiesti
deploy
Campi JSON
plan, period
POST/api/v1/deployments

Crea un carico di tua proprietà riservando risorse nel piano dell'account. Le richieste gratis richiedono il proprietario nel browser.

ID operazione
create_deployment
Scope richiesti
deploy
Campi JSON
name, profile, resources, tier, period
POST/api/v1/deployments/{id}/releases

Richiedi la pubblicazione o il rollback da un worker di sito statico in esecuzione.

ID operazione
request_site_release
Scope richiesti
deploy
Campi JSON
action, confirm
POST/api/v1/deployments/{id}/sync
ID operazione
sync_git
Scope richiesti
deploy
Campi 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 operazione
disconnect_github
Scope richiesti
deploy
Campi JSON
confirm
billing-read1 operazione

Leggi lo stato di abbonamento e fatturazione.

GET/api/v1/billing
ID operazione
billing_status
Scope richiesti
billing-read

Nessuna operazione corrispondente. Prova un metodo, un percorso o uno scope.

Server MCP

Connetti un client Streamable HTTP a /mcp sull'origine del pannello. Gli scope del token e i deploy selezionati determinano quali strumenti può usare il client.

Setup dell'editor
Strumenti disponibili
117 strumenti
Controlla la connessione
Chiedi al tuo editor di eseguire list_deployments con un token con read accesso.
Deploy GitHub
Connetti un repository e un branch nella scheda Deploy per fare il deploy delle modifiche dal tuo editor. Trova la guida del tuo runtime

Token e OAuth

Scegli quali deploy può raggiungere una credenziale, imposta la scadenza e revoca l'accesso in Account → agenti AI.

Token Bearer

Copia il token quando lo crei. Invialo nell'header Authorization come mostrato in prima richiesta. Una richiesta fuori dagli scope concessi restituisce HTTP 403.

OAuth per applicazioni

  1. Registra un client pubblico e il suo URL di callback su /oauth/register.
  2. Richiedi il consenso su /oauth/authorize con state, scope e una challenge PKCE S256. Imposta la resource sull'origine del pannello più /api/v1 per REST o /mcp per un editor.
  3. Scambia il codice di autorizzazione e il verifier su /oauth/token.
Apri le impostazioni di connessione

Strumenti da riga di comando

Scarica il pacchetto CLI

Usa Node.js 22 o più recente e Git. Esporta BH_API_TOKEN e BH_PORTAL_URL nella shell. Usa l'origine HTTPS del pannello oppure http://127.0.0.1 con la porta locale.

Usa read per elencare e collegare un deploy. Aggiungi manage prima di sincronizzare i file. Il dry run mostra in anteprima le modifiche. Avviare il watcher le carica e poi sincronizza mentre modifichi.

Terminale del progetto
npm install -g ./bothosting-cli.tgz
bothosting list
bothosting link DEPLOYMENT_ID
bothosting push --dry-run
bothosting watch

Installa dalla cartella di download. Esegui i comandi rimanenti nella cartella del progetto, sostituendo DEPLOYMENT_ID con un ID della tua lista. Premi Ctrl+C per smettere di osservare.