API: Git, Node.js, Python, Ruby, Redis, Memcached and Docker
Deploy from Git, run Node.js, Python and Ruby apps, switch Redis or Memcached on and manage Docker apps through the token API.
These endpoints do what the Git, Node.js, Python, Ruby, Redis, Memcached and Docker screens do. Starting, stopping and building run on the server through the same agent commands as the screens.
The paths name the account (/v1/accounts/{username}/…); the rules are those of every per-account endpoint. The REST conventions (paging, errors, Location) apply.
A=https://api.yourdomain.com/v1
H="Authorization: Bearer hf_xxx"
Git repositories
| Method | Path | Who | What it does |
|---|---|---|---|
| GET | /v1/accounts/{username}/git-repos |
per account | The account's Git repositories |
| POST | /v1/accounts/{username}/git-repos |
per account, write | Clone a repository (or start an empty one) into ~/web/repositories |
| GET | /v1/accounts/{username}/git-repos/{name} |
per account | One repository with its branch, branches, remote, changes and recent commits |
| PATCH | /v1/accounts/{username}/git-repos/{name} |
per account, write | Set the deploy folder (empty turns deploying off) and/or switch to another branch |
| DELETE | /v1/accounts/{username}/git-repos/{name} |
per account, write | Delete a repository (deployed files are kept) |
| POST | /v1/accounts/{username}/git-repos/{name}/deploy |
per account, write | Copy the repository into its deploy folder |
| POST | /v1/accounts/{username}/git-repos/{name}/pull |
per account, write | Pull the repository's remote |
POST /v1/accounts/{username}/git-repos
| Field | Type | Required | Meaning |
|---|---|---|---|
name |
string | yes | letters, numbers, . _ - (e.g. my-site) |
url |
string | an https:// clone address; empty starts an empty repository | |
branch |
string | clone only this branch | |
deploy |
string | the website folder inside web/ to deploy to, e.g. example.com/public_html |
PATCH /v1/accounts/{username}/git-repos/{name}
| Field | Type | Required | Meaning |
|---|---|---|---|
deploy |
string | the website folder inside web/ (empty: no deploying) | |
branch |
string | switch to this branch |
Node.js apps
| Method | Path | Who | What it does |
|---|---|---|---|
| GET | /v1/accounts/{username}/node-apps |
per account | The account's Node.js apps |
| POST | /v1/accounts/{username}/node-apps |
per account, write | Create a Node.js app on one of the account's websites |
| GET | /v1/accounts/{username}/node-apps/{name} |
per account | One Node.js app |
| PATCH | /v1/accounts/{username}/node-apps/{name} |
per account, write | Change a Node.js app's settings (what you leave out stays as it is) and restart it |
| DELETE | /v1/accounts/{username}/node-apps/{name} |
per account, write | Remove a Node.js app (its files are kept; the website serves its own folder again) |
| POST | /v1/accounts/{username}/node-apps/{name}/build |
per account, write | Build and deploy a Node.js app (install, build, restart) |
| POST | /v1/accounts/{username}/node-apps/{name}/restart |
per account, write | Restart a Node.js app |
| POST | /v1/accounts/{username}/node-apps/{name}/start |
per account, write | Start a Node.js app |
| POST | /v1/accounts/{username}/node-apps/{name}/stop |
per account, write | Stop a Node.js app |
POST /v1/accounts/{username}/node-apps
| Field | Type | Required | Meaning |
|---|---|---|---|
name |
string | yes | letters, numbers, - and _ (e.g. shop) |
domain |
string | yes | the website it takes over (one app per main domain) |
root |
string | yes | its folder in the account, e.g. apps/shop |
node |
string | an installed Node.js major version, e.g. 22 | |
mode |
one of production, development | production (default) or development | |
kind |
one of server, static | server (default) or static | |
install |
one of npm, npm-ci, yarn, pnpm, none | how dependencies are installed (default npm) | |
build |
string | the package.json script that builds it, e.g. build | |
start_cmd |
string | server: node, npm, npx, yarn or pnpm and plain words, e.g. npm start | |
outdir |
string | static: the build folder inside the app folder, e.g. dist | |
framework |
string | what it is (informational) | |
env |
object | environment variables, NAME: value (up to 30; replaces the earlier ones) |
PATCH /v1/accounts/{username}/node-apps/{name}
| Field | Type | Required | Meaning |
|---|---|---|---|
domain |
string | the website it takes over (one app per main domain) | |
root |
string | its folder in the account, e.g. apps/shop | |
node |
string | an installed Node.js major version, e.g. 22 | |
mode |
one of production, development | production (default) or development | |
kind |
one of server, static | server (default) or static | |
install |
one of npm, npm-ci, yarn, pnpm, none | how dependencies are installed (default npm) | |
build |
string | the package.json script that builds it, e.g. build | |
start_cmd |
string | server: node, npm, npx, yarn or pnpm and plain words, e.g. npm start | |
outdir |
string | static: the build folder inside the app folder, e.g. dist | |
framework |
string | what it is (informational) | |
env |
object | environment variables, NAME: value (up to 30; replaces the earlier ones) |
Python apps
| Method | Path | Who | What it does |
|---|---|---|---|
| GET | /v1/accounts/{username}/python-apps |
per account | The account's Python apps |
| POST | /v1/accounts/{username}/python-apps |
per account, write | Create a Python app on one of the account's websites |
| GET | /v1/accounts/{username}/python-apps/{name} |
per account | One Python app |
| PATCH | /v1/accounts/{username}/python-apps/{name} |
per account, write | Change a Python app's settings (what you leave out stays as it is) and restart it |
| DELETE | /v1/accounts/{username}/python-apps/{name} |
per account, write | Remove a Python app (its files are kept; the website serves its own folder again) |
| POST | /v1/accounts/{username}/python-apps/{name}/restart |
per account, write | Restart a Python app |
| POST | /v1/accounts/{username}/python-apps/{name}/setup |
per account, write | Set a Python app up (install its packages) and (re)start it |
| POST | /v1/accounts/{username}/python-apps/{name}/start |
per account, write | Start a Python app |
| POST | /v1/accounts/{username}/python-apps/{name}/stop |
per account, write | Stop a Python app |
POST /v1/accounts/{username}/python-apps
| Field | Type | Required | Meaning |
|---|---|---|---|
name |
string | yes | letters, numbers, - and _ (e.g. shop) |
domain |
string | yes | the website it takes over (one app per main domain) |
root |
string | yes | its folder in the account, e.g. apps/shop |
entry |
string | module:object, e.g. app:app (Flask), mysite.wsgi:application (Django), main:app (FastAPI); default app:app | |
server |
one of wsgi, asgi | wsgi (default) or asgi | |
python |
string | an installed Python version, e.g. 3.12 | |
workers |
integer | 1–8 (default 2) | |
env |
object | environment variables, NAME: value (up to 30; replaces the earlier ones) |
PATCH /v1/accounts/{username}/python-apps/{name}
| Field | Type | Required | Meaning |
|---|---|---|---|
domain |
string | the website it takes over (one app per main domain) | |
root |
string | its folder in the account, e.g. apps/shop | |
entry |
string | module:object, e.g. app:app (Flask), mysite.wsgi:application (Django), main:app (FastAPI); default app:app | |
server |
one of wsgi, asgi | wsgi (default) or asgi | |
python |
string | an installed Python version, e.g. 3.12 | |
workers |
integer | 1–8 (default 2) | |
env |
object | environment variables, NAME: value (up to 30; replaces the earlier ones) |
Ruby apps
| Method | Path | Who | What it does |
|---|---|---|---|
| GET | /v1/accounts/{username}/ruby-apps |
per account | The account's Ruby apps |
| POST | /v1/accounts/{username}/ruby-apps |
per account, write | Create a Ruby app on one of the account's websites |
| GET | /v1/accounts/{username}/ruby-apps/{name} |
per account | One Ruby app |
| PATCH | /v1/accounts/{username}/ruby-apps/{name} |
per account, write | Change a Ruby app's settings (what you leave out stays as it is) and restart it |
| DELETE | /v1/accounts/{username}/ruby-apps/{name} |
per account, write | Remove a Ruby app (its files are kept; the website serves its own folder again) |
| POST | /v1/accounts/{username}/ruby-apps/{name}/restart |
per account, write | Restart a Ruby app |
| POST | /v1/accounts/{username}/ruby-apps/{name}/setup |
per account, write | Set a Ruby app up (install its packages) and (re)start it |
| POST | /v1/accounts/{username}/ruby-apps/{name}/start |
per account, write | Start a Ruby app |
| POST | /v1/accounts/{username}/ruby-apps/{name}/stop |
per account, write | Stop a Ruby app |
POST /v1/accounts/{username}/ruby-apps
| Field | Type | Required | Meaning |
|---|---|---|---|
name |
string | yes | letters, numbers, - and _ (e.g. shop) |
domain |
string | yes | the website it takes over (one app per main domain) |
root |
string | yes | its folder in the account, e.g. apps/shop |
entry |
string | the rackup file, e.g. config.ru (default) | |
workers |
integer | 0–8 | |
env |
object | environment variables, NAME: value (up to 30; replaces the earlier ones) |
PATCH /v1/accounts/{username}/ruby-apps/{name}
| Field | Type | Required | Meaning |
|---|---|---|---|
domain |
string | the website it takes over (one app per main domain) | |
root |
string | its folder in the account, e.g. apps/shop | |
entry |
string | the rackup file, e.g. config.ru (default) | |
workers |
integer | 0–8 | |
env |
object | environment variables, NAME: value (up to 30; replaces the earlier ones) |
Redis
| Method | Path | Who | What it does |
|---|---|---|---|
| GET | /v1/accounts/{username}/redis |
per account | The account's Redis cache: on or off, size, memory use, hit rate |
| PUT | /v1/accounts/{username}/redis |
per account, write | Switch Redis on, or change its size (within the package) |
| DELETE | /v1/accounts/{username}/redis |
per account, write | Switch Redis off and free its memory |
| POST | /v1/accounts/{username}/redis/flush |
per account, write | Empty the cache |
| PUT | /v1/accounts/{username}/redis/wordpress/{id} |
per account, write | Turn a WordPress site's Redis object cache on or off |
PUT /v1/accounts/{username}/redis
| Field | Type | Required | Meaning |
|---|---|---|---|
memory_mb |
integer | yes | 32, 64, 128 … up to the package's limit |
PUT /v1/accounts/{username}/redis/wordpress/{id}
| Field | Type | Required | Meaning |
|---|---|---|---|
enabled |
boolean | yes | on or off |
Memcached
The account's own Memcached, like Redis: on or off, a size the package allows (the package's memcached_mb), its
figures, and emptying it. sizes is empty when the package has no Memcached; PUT then answers 422.
| Method | Path | Who | What it does |
|---|---|---|---|
| GET | /v1/accounts/{username}/memcached |
per account | The account's Memcached: on or off, size, memory use, hit rate |
| PUT | /v1/accounts/{username}/memcached |
per account, write | Switch Memcached on, or change its size (within the package) |
| DELETE | /v1/accounts/{username}/memcached |
per account, write | Switch Memcached off and free its memory |
| POST | /v1/accounts/{username}/memcached/flush |
per account, write | Empty the cache |
PUT /v1/accounts/{username}/memcached
| Field | Type | Required | Meaning |
|---|---|---|---|
memory_mb |
integer | yes | 16, 32, 64 … up to the package's limit |
{ "ok": true, "data": { "enabled": true, "running": true, "memory_mb": 64, "sizes": [16, 32, 64], "version": "1.6.21",
"used": "0.4 MB", "items": "120", "evicted": "0", "hit_rate": "93%", "socket": "/home/sarahbakes/.memcached/memcached.sock" } }
Docker apps
POST /docker-apps answers the generated admin password once when the app has one.
| Method | Path | Who | What it does |
|---|---|---|---|
| GET | /v1/accounts/{username}/docker-apps |
per account | The account's Docker apps |
| POST | /v1/accounts/{username}/docker-apps |
per account, write | Install an app from the catalogue on one of the account's domains (within the package's limit) |
| GET | /v1/accounts/{username}/docker-apps/{name} |
per account | One Docker app |
| DELETE | /v1/accounts/{username}/docker-apps/{name} |
per account, write | Remove an app (its data folder is kept; purge=1 deletes the data too) |
| GET | /v1/accounts/{username}/docker-apps/{name}/logs |
per account | An app's log |
| POST | /v1/accounts/{username}/docker-apps/{name}/restart |
per account, write | Restart an app |
| POST | /v1/accounts/{username}/docker-apps/{name}/start |
per account, write | Start an app |
| POST | /v1/accounts/{username}/docker-apps/{name}/stop |
per account, write | Stop an app |
| GET | /v1/accounts/{username}/docker-catalog |
per account | The apps that can be installed |
POST /v1/accounts/{username}/docker-apps
| Field | Type | Required | Meaning |
|---|---|---|---|
app |
string | yes | its key in the catalogue |
domain |
string | yes | the domain or subdomain to serve it on |
DELETE /v1/accounts/{username}/docker-apps/{name}
Query: purge (delete its data too)