API Documentation
A REST API to drive your account. 37 endpoints across 3 categories.
Public beta
The API is open in beta. Build, experiment and have fun with it, but use it with care: endpoints and responses may still change, and every call acts on your real deployments.
Authentication
Every request needs an API key. Pass it as a Bearer token. Create and manage keys from your developer settings.
curl -H "Authorization: Bearer bhk_your_key" \
https://bot-hosting.net/api/v1/deploymentsScopes
A key is limited to the scopes you grant it. A request is allowed only if the key holds the endpoint's scope and you have permission on the target resource.
Deployments
Account
Templates
Rate limits
Requests are capped at 120 per minute per key (a sliding 60s window). Every response carries the remaining budget; going over returns 429 with a Retry-After header.
HTTP/1.1 200 OK X-RateLimit-Remaining: 118 # once exceeded: HTTP/1.1 429 Too Many Requests Retry-After: 42
Deployments
List every deployment the caller can access.
curl "https://bot-hosting.net/api/v1/deployments" \ -H "Authorization: Bearer bhk_your_key"
{
"deployments": [
{
"id": "dep_a1b2c3d4",
"name": "my-bot",
"description": "A cool Discord bot",
"state": "running",
"status": "active",
"createdAt": "2026-01-01T00:00:00.000Z",
"resources": {
"ramMB": 512,
"cpuPercent": 50,
"storageMB": 1024
},
"domains": {
"subdomain": "my-bot.apps",
"slug": "my-template",
"custom": "bot.example.com"
}
}
]
}Fetch a single deployment.
curl "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4" \ -H "Authorization: Bearer bhk_your_key"
{
"id": "dep_a1b2c3d4",
"name": "my-bot",
"description": "A cool Discord bot",
"state": "running",
"status": "active",
"createdAt": "2026-01-01T00:00:00.000Z",
"resources": {
"ramMB": 512,
"cpuPercent": 50,
"storageMB": 1024
},
"domains": {
"subdomain": "my-bot.apps",
"slug": "my-template",
"custom": "bot.example.com"
}
}Rename a deployment or change its description.
curl -X PATCH "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"name":"my-bot","description":"A cool Discord bot"}'{
"id": "dep_a1b2c3d4",
"name": "my-bot",
"description": "A cool Discord bot",
"state": "running",
"status": "active",
"createdAt": "2026-01-01T00:00:00.000Z",
"resources": {
"ramMB": 512,
"cpuPercent": 50,
"storageMB": 1024
},
"domains": {
"subdomain": "my-bot.apps",
"slug": "my-template",
"custom": "bot.example.com"
}
}Move a deployment to another of your projects.
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/move" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"toProjectId":"dep_a1b2c3d4"}'{
"id": "dep_a1b2c3d4",
"name": "my-bot",
"description": "A cool Discord bot",
"state": "running",
"status": "active",
"createdAt": "2026-01-01T00:00:00.000Z",
"resources": {
"ramMB": 512,
"cpuPercent": 50,
"storageMB": 1024
},
"domains": {
"subdomain": "my-bot.apps",
"slug": "my-template",
"custom": "bot.example.com"
}
}Delete a deployment (instant; teardown runs in the background).
curl -X DELETE "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4" \ -H "Authorization: Bearer bhk_your_key"
{
"ok": true
}Create a deployment (blank, from a public GitHub repo, or a template).
curl -X POST "https://bot-hosting.net/api/v1/deployments" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"name":"my-bot","description":"A cool Discord bot","projectId":"dep_a1b2c3d4","source":"blank","githubRepo":"string","branch":"string","templateId":"dep_a1b2c3d4","env":"string","runtime":"python","runtimeVersion":"string"}'{
"deployment": {
"id": "dep_a1b2c3d4",
"name": "my-bot",
"description": "A cool Discord bot",
"state": "running",
"status": "active",
"createdAt": "2026-01-01T00:00:00.000Z",
"resources": {
"ramMB": 512,
"cpuPercent": 50,
"storageMB": 1024
},
"domains": {
"subdomain": "my-bot.apps",
"slug": "my-template",
"custom": "bot.example.com"
}
}
}Send a power signal (start / stop / restart / kill).
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/power" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"action":"start"}'{
"ok": true,
"action": "restart"
}Read the last N lines of the console log.
curl "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/logs?size=1048576" \ -H "Authorization: Bearer bhk_your_key"
{
"lines": [
"Bot is online!"
]
}Live resource usage: CPU, memory, disk, network and uptime.
curl "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/resources" \ -H "Authorization: Bearer bhk_your_key"
{
"state": "running",
"cpu": {
"usedPercent": 50,
"limitPercent": 50
},
"memory": {
"usedBytes": 1048576,
"limitBytes": 1048576
},
"disk": {
"usedBytes": 1048576,
"limitBytes": 1048576
},
"network": {
"rxBytes": 1048576,
"txBytes": 1048576
},
"uptimeMs": 3600000
}Send a single command to the server console.
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/command" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"command":"say hello"}'{
"ok": true
}Change RAM / CPU / storage allocation (drawn from your plan pool).
curl -X PATCH "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/resize" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"ramMB":512,"cpuPct":50,"storageMB":1024}'{
"id": "dep_a1b2c3d4",
"name": "my-bot",
"description": "A cool Discord bot",
"state": "running",
"status": "active",
"createdAt": "2026-01-01T00:00:00.000Z",
"resources": {
"ramMB": 512,
"cpuPercent": 50,
"storageMB": 1024
},
"domains": {
"subdomain": "my-bot.apps",
"slug": "my-template",
"custom": "bot.example.com"
}
}List a directory inside the deployment volume.
curl "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/files?path=%2Fmain.py" \ -H "Authorization: Bearer bhk_your_key"
{
"path": "/main.py",
"entries": [
{
"name": "my-bot",
"type": "file",
"sizeBytes": 1048576,
"modifiedAt": "2026-01-01T00:00:00.000Z",
"mode": "0755"
}
]
}Read the text content of a single file.
curl "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/files/content?path=%2Fmain.py" \ -H "Authorization: Bearer bhk_your_key"
{
"path": "/main.py",
"content": "print(\"hello world\")"
}Create or overwrite a text file.
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/files/content" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"path":"/main.py","content":"print(\"hello world\")"}'{
"ok": true,
"path": "/main.py"
}Rename or move a file within a directory.
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/files/rename" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"root":"/","from":"old.py","to":"new.py"}'{
"ok": true
}Delete one or more files or folders.
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/files/delete" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"root":"/","files":["string"]}'{
"ok": true,
"deleted": 1
}Create a folder.
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/files/folder" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"root":"/","name":"my-bot"}'{
"ok": true
}Decompress an archive in place.
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/files/decompress" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"root":"/","file":"archive.zip"}'{
"ok": true
}Compress files into a new archive.
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/files/compress" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"root":"/","files":["string"]}'{
"ok": true,
"archive": "string"
}Duplicate a file (Wings appends a "copy" suffix).
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/files/copy" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"location":"string"}'{
"ok": true
}Change a file mode (e.g. "0755").
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/files/chmod" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"root":"/","file":"archive.zip","mode":"0755"}'{
"ok": true
}Get a one-time signed URL to download a file.
curl "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/files/download-url?path=%2Fmain.py" \ -H "Authorization: Bearer bhk_your_key"
{
"url": "https://.../files/download?path=%2Fmain.py"
}List environment variables. Secret values are masked.
curl "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/env" \ -H "Authorization: Bearer bhk_your_key"
{
"variables": [
{
"key": "MY_VAR",
"value": "some-value",
"secret": true,
"system": true
}
]
}Create or update a user environment variable (applies on next restart).
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/env" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"key":"MY_VAR","value":"some-value","secret":true}'{
"ok": true,
"key": "MY_VAR"
}Delete a user environment variable (applies on next restart).
curl -X DELETE "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/env/MY_VAR" \ -H "Authorization: Bearer bhk_your_key"
{
"ok": true
}List the backups of a deployment.
curl "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/backups" \ -H "Authorization: Bearer bhk_your_key"
{
"backups": [
{
"id": "dep_a1b2c3d4",
"deploymentId": "dep_a1b2c3d4",
"label": "Manual",
"sizeBytes": 1048576,
"status": "active",
"backupType": "manual",
"fileCount": 2,
"isOrphaned": true,
"createdAt": "2026-01-01T00:00:00.000Z",
"completedAt": "2026-01-01T00:00:00.000Z"
}
]
}Start a manual backup of a deployment.
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/backups" \ -H "Authorization: Bearer bhk_your_key"
{
"ok": true,
"backupId": "bak_a1b2c3d4"
}Fetch a single backup by id.
curl "https://bot-hosting.net/api/v1/backups/bak_a1b2c3d4" \ -H "Authorization: Bearer bhk_your_key"
{
"id": "dep_a1b2c3d4",
"deploymentId": "dep_a1b2c3d4",
"label": "Manual",
"sizeBytes": 1048576,
"status": "active",
"backupType": "manual",
"fileCount": 2,
"isOrphaned": true,
"createdAt": "2026-01-01T00:00:00.000Z",
"completedAt": "2026-01-01T00:00:00.000Z"
}Delete a backup.
curl -X DELETE "https://bot-hosting.net/api/v1/backups/bak_a1b2c3d4" \ -H "Authorization: Bearer bhk_your_key"
{
"ok": true
}Restore a backup onto a deployment (overwrites its files).
curl -X POST "https://bot-hosting.net/api/v1/backups/bak_a1b2c3d4/restore" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"deploymentId":"dep_a1b2c3d4","startAfter":true}'{
"ok": true,
"warning": "string"
}List packages in the manifest (npm or pip).
curl "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/packages?manager=npm" \ -H "Authorization: Bearer bhk_your_key"
{
"manager": "pip",
"file": "archive.zip",
"exists": true,
"packages": [
{
"name": "my-bot",
"spec": "==1.0.0",
"dev": true
}
]
}Add or update a package in the manifest.
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/packages" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"manager":"npm","name":"my-bot","spec":"==1.0.0","dev":true}'{
"manager": "pip",
"file": "archive.zip",
"exists": true,
"packages": [
{
"name": "my-bot",
"spec": "==1.0.0",
"dev": true
}
]
}Remove a package from the manifest.
curl -X POST "https://bot-hosting.net/api/v1/deployments/dep_a1b2c3d4/packages/remove" \
-H "Authorization: Bearer bhk_your_key" \
-H "Content-Type: application/json" \
-d '{"manager":"npm","name":"my-bot"}'{
"manager": "pip",
"file": "archive.zip",
"exists": true,
"packages": [
{
"name": "my-bot",
"spec": "==1.0.0",
"dev": true
}
]
}List the projects you own or collaborate on.
curl "https://bot-hosting.net/api/v1/projects" \ -H "Authorization: Bearer bhk_your_key"
{
"projects": [
{
"id": "dep_a1b2c3d4",
"name": "my-bot",
"description": "A cool Discord bot",
"isOwner": true,
"createdAt": "2026-01-01T00:00:00.000Z"
}
]
}Account
Your profile, credit balance and quota (pool vs used).
curl "https://bot-hosting.net/api/v1/account" \ -H "Authorization: Bearer bhk_your_key"
{
"id": "dep_a1b2c3d4",
"username": "grality",
"email": "[email protected]",
"createdAt": "2026-01-01T00:00:00.000Z",
"creditsCents": 5000,
"quota": {
"pool": {
"ramMB": 512,
"cpuPct": 50,
"storageMB": 1024,
"slots": 2
},
"used": {
"ramMB": 512,
"cpuPct": 50,
"storageMB": 1024,
"slots": 2
}
}
}Templates
Browse the public template catalogue (any author).
curl "https://bot-hosting.net/api/v1/templates?sort=trending&category=utility&q=search&page=2&perPage=2" \ -H "Authorization: Bearer bhk_your_key"
{
"total": 12,
"page": 2,
"perPage": 2,
"items": [
{
"id": "dep_a1b2c3d4",
"slug": "my-template",
"name": "my-bot",
"tagline": "A cool Discord bot",
"category": "utility",
"runtime": "python",
"githubRepo": "string",
"githubStars": 3,
"deployCount": 3,
"imageId": "dep_a1b2c3d4",
"owner": {
"username": "grality",
"avatar": "string"
},
"createdAt": "2026-01-01T00:00:00.000Z"
}
]
}Full details + public stats of a single template by slug.
curl "https://bot-hosting.net/api/v1/templates/my-template" \ -H "Authorization: Bearer bhk_your_key"
{
"id": "dep_a1b2c3d4",
"slug": "my-template",
"name": "my-bot",
"tagline": "A cool Discord bot",
"category": "utility",
"runtime": "python",
"githubRepo": "string",
"githubStars": 3,
"deployCount": 3,
"imageId": "dep_a1b2c3d4",
"owner": {
"username": "grality",
"avatar": "string"
},
"createdAt": "2026-01-01T00:00:00.000Z",
"branch": "string",
"runtimeVersion": "string",
"readme": "# My template",
"stats": {
"views": 3,
"deploys": 3,
"likes": 3,
"dislikes": 3,
"githubStars": 3,
"trendingScore": 1.5
},
"envSchema": [
{
"key": "MY_VAR",
"label": "Manual",
"description": "A cool Discord bot",
"required": true,
"secret": true,
"defaultValue": "string"
}
],
"updatedAt": "2026-01-01T00:00:00.000Z"
}