Endpoints
Computers
A Computer is a persistent Linux machine with root access. It runs in a pool and shares the pool's CPU and memory.
Read Computers with GET /v1/computer/, and create and delete them with /create and /delete. Change one with POST /v1/computer/modify, naming the computer and one action. Each section below is one read or action.
Several at once. start, stop, restart, pause, resume, move, tag, comment, transfer, share add, share remove, snapshot create and snapshot delete take computers instead of computer. Heaven checks every name first, so a typo changes nothing. The response is HTTP 200 with one result per Computer, either an operation or an error, even when some fail. Each Computer counts against the rate limit.
Read
List or get Computers
GET/v1/computer/
Lists the Computers you can see, or returns one Computer with its recent operations and every part of it you can read.
The parts of one Computer are access, domains, ports, mail and snapshots.
Query
computerstringRead this Computer, its recent operations and everything you can read of it.
patternstringOnly names matching this pattern, such as web-*.
groupstringGroup the list by pool, tag, access, or (with
organization) user.organizationstringAct in this organization (its name or ID) instead of your personal account.
Each Computer in the list
id,namestring- Its ID and name.
pool,pool_idstring- Its pool's name (when the pool is in an account you belong to) and ID.
statestringcreating,preparing_image,starting,running,checking,degraded,restarting,resetting,stopping,stopped,paused,failed,image_failed,held,deletingorunknown.state_messagestring- The state in a sentence, with the next step when there is one. Show this to people rather than working it out from
status. accessstring- Your role on it:
owner,admin,rootorweb. ssh_deststring- The address for
sshandscp, such asmy-site@heaven.dev. urlstring- Its website:
https://my-site.heaven.dev. sizeobjectvcpus,memory_mibanddisk_bytes.image,tags- The image it was made from, and its tags.
memory_messagestring- Where its memory is now, such as "Asleep, 40 MB in RAM; the first request takes a moment." Present only while it's running and was measured recently.
processors_messagestring- How many of its vCPUs it can use while its server is busy. Absent otherwise.
When you read one Computer with computer, the response's computer is its whole view:
- its record,
computer, withid,name,pool_id,image,tags,comment, its network address and its creation time; owner_id,account_id,status,diskandusage;ssh_destand its parts,ssh_host(port 22) andssh_user;tier, which says where its memory is:active,idleorasleep.
- An API key needs
viewin its commands.
curl 'https://heaven.dev/v1/computer/' \
-H "Authorization: Bearer $HEAVEN_API_KEY"{
"version": 1,
"data": {
"computers": [
{
"id": "7cd4a3ec-7411-402c-b74b-43f6d7587ae7",
"name": "my-site",
"pool": "web",
"pool_id": "pool-832036a4f8a142bf",
"state": "running",
"state_message": "Running.",
"memory_message": "Asleep, 40 MB in RAM; the first request takes a moment.",
"access": "owner",
"ssh_dest": "my-site@heaven.dev",
"url": "https://my-site.heaven.dev",
"size": { "vcpus": 2, "memory_mib": 4096, "disk_bytes": 20000000000 },
"image": "heaven-ubuntu",
"tags": ["web"]
}
]
}
}?computer=my-site{
"version": 1,
"data": {
"computer": {
"computer": { "id": "7cd4a3ec-…", "name": "my-site", … },
"owner_id": "a308210e-005c-43ba-b452-db81b4034d90",
"account_id": "ee225ef4-b631-45d3-b876-49f542ed0809",
"access": "owner",
"state": "running",
"state_message": "Running.",
"ssh_dest": "my-site@heaven.dev",
"ssh_host": "heaven.dev",
"ssh_user": "my-site",
"url": "https://my-site.heaven.dev",
…
},
"operations": [
{
"id": "7bbd53b7-8a68-4f61-a03f-db54072e591d",
"kind": "restart",
"state": "complete",
"created_at": "2026-11-01T23:25:02Z",
"completed_at": "2026-11-01T23:25:19Z"
}
],
"access": {…},
"domains": [],
"ports": {…},
"mail": {
"receiving_enabled": true,
"reply_policy": "all",
"sending_suspended": false
},
"snapshots": {…}
}
}Read usage
GET/v1/computer/?view=usage
Returns a Computer's CPU, memory, disk and network use over 24 hours, 7 days or 30 days.
Query
computerstring requiredA Computer: its name or ID.
rangestringThe span of history: 24h (the default), 7d or 30d.
resolutionstringA point every minute (1m), five minutes (5m) or hour (1h), over any
range; it wins overpoints. Without it, 24h has a point every 5 minutes and 7d and 30d one an hour.pointsstringAt most this many points in the series, but never fewer than one a day: its intervals are merged into the narrowest step that fits (a minute up to a day), so 30d returns 30 points for any N below 30. Without it or
resolution, 24h has a point every 5 minutes and 7d and 30d one an hour; MCP tools ask for 24.
- An API key needs
usagein its commands.
curl 'https://heaven.dev/v1/computer/?computer=my-site&view=usage' \
-H "Authorization: Bearer $HEAVEN_API_KEY"Read the boot console
GET/v1/computer/?view=logs
Returns a Computer's boot console, for the current boot or the one before.
Query
computerstring requiredA Computer: its name or ID.
previousbooleanThe boot before the current one.
- An API key needs
logsin its commands.
curl 'https://heaven.dev/v1/computer/?computer=my-site&view=logs' \
-H "Authorization: Bearer $HEAVEN_API_KEY"Open the browser terminal
GET/v1/computer/?view=terminal
Returns a link to a Computer's terminal in the browser.
The link is in url. It opens only in a browser signed in to Heaven. Programs use exec or SSH instead.
Query
computerstring requiredA Computer: its name or ID.
- An API key needs
terminalin its commands.
curl 'https://heaven.dev/v1/computer/?computer=my-site&view=terminal' \
-H "Authorization: Bearer $HEAVEN_API_KEY"Open the desktop
GET/v1/computer/?view=desktop
Returns a link to a Computer's desktop in the browser. Only its owner and people with root access can open it.
Query
computerstring requiredA Computer: its name or ID.
- An API key needs
desktopin its commands.
curl 'https://heaven.dev/v1/computer/?computer=my-site&view=desktop' \
-H "Authorization: Bearer $HEAVEN_API_KEY"Read who has access
GET/v1/computer/?view=access
Returns who can reach a Computer and its website.
The response lists its shares, invitations, links, domains and ports, and says whether its website is public.
Query
computerstring requiredA Computer: its name or ID.
- An API key needs
accessin its commands.
curl 'https://heaven.dev/v1/computer/?computer=my-site&view=access' \
-H "Authorization: Bearer $HEAVEN_API_KEY"Create and delete
Create a Computer
POST/v1/computer/create
Creates a Computer in a pool from an image, or as a copy of a Computer or one of its snapshots.
A Computer uses its pool's CPU, memory and storage, so you don't need to size it. It returns an operation at once, and the Computer is ready when its state is running.
Body
namestringIts name, which becomes
NAME.heaven.dev. Without one, Heaven picks a free adjective-noun name, such asswift-otter. The answer'snamesays which.poolstringThe pool it runs in. Required unless you have exactly one.
imagestringAny OCI image, such as
debian:12orghcr.io/you/app:latest. Defaults to Heaven's Ubuntu.registry_authstringUSERNAME:PASSWORDfor a private image's registry.integrationsstring[]Integrations to attach to it.
githubobject{"repo": "OWNER/REPO"}clones that repository into the home directory at first boot, before your setup script. It uses a GitHub integration you can attach that reaches OWNER. If the clone keeps failing for a minute, setup stops there, but the Computer stays.repostring requiredA GitHub repository (OWNER/REPO) to clone into the Computer, through your GitHub integration.
setup_scriptstringA script run once at first boot, up to 10 KiB. Without one, your default runs. A pool's setup script runs first either way.
envstring[]Environment variables for the setup script, such as
["PORT=8000"].tagsstring[]Tags to group, filter and attach integrations by.
commentstringA note for people.
cpustringvCPUs of its own, within its pool's, as
resizegives. Without it, the Computer can use the whole pool.memorystringMemory of its own, such as
8GiB, within its pool's. Without it, the Computer can use the whole pool.diskstringA disk of its own, such as 20GB, up to the pool's storage. By default, it shares the pool's storage, or takes the pool's default disk.
copyobject{"computer": "NAME"}copies a Computer's disk. Add"snapshot"to copy one of its snapshots instead. A copy takes noimage,setup_script,env,tagsorcomment. Copying a disk needs root access or ownership. Copying a snapshot needs ownership, or a pool snapshot shared with you. The copy must be made in a pool on the source's server, or it's refused (conflict). A copy from a shared snapshot names yourpooland keeps none of the source's tags.computerstring requiredMake a copy of this Computer (or, with
snapshot, of one of its snapshots).snapshotstringCopy this snapshot of it.
copy_tagsbooleanWhether a copy keeps the source's tags. Defaults to
true.organizationstringAct in this organization (its name or ID) instead of your personal account.
waitboolean or stringWait until it finishes and return how it ended:
truewaits up to 10m, a duration such as2mwaits that long.
- An API key needs
createin its commands.
curl https://heaven.dev/v1/computer/create \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{
"name": "my-site",
"pool": "web",
"setup_script": "apt-get install -y nginx",
"tags": ["web"]
}'{
"version": 1,
"data": {
"request_id": "f4515dc8-125c-45d4-9000-fcb344896108",
"operation": {
"id": "8540e6f2-9f39-4d39-89b5-eeac80d0ac97",
"kind": "create",
"computer_id": "0098166a-9908-43ab-967b-4111c45c3b33",
"revision": 1,
"state": "accepted"
},
"name": "my-site",
"ssh_dest": "my-site@heaven.dev",
"url": "https://my-site.heaven.dev"
}
}{"name": "my-site-test", "copy": {"computer": "my-site", "snapshot": "before-upgrade"}}Delete Computers
POST/v1/computer/delete
Deletes Computers with their disks and snapshots, at once. Heaven's operators can restore one from backups for 7 days.
You can't undo a delete yourself. Heaven checks every name before anything is deleted, so a typo deletes nothing. Each Computer gets its own result, either an operation or an error.
Body
computersstring[] requiredThe Computers to delete, by name or ID, any number. Use
computerto name just one.
- An API key needs
deletein its commands.
curl https://heaven.dev/v1/computer/delete \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"computers": ["my-site", "my-api"]}'{
"version": 1,
"data": {
"request_id": "05576c57-a681-4949-b029-47b5cf175489",
"results": [
{
"computer": { "id": "7cd4a3ec-…", "name": "my-site" },
"operation": {
"id": "95ea2943-c2d2-4468-97c4-80c56fe47337",
"kind": "delete",
"state": "accepted"
}
}
]
}
}Power
Paused Computers. start doesn't continue a paused Computer. It returns conflict and suggests resume. While a Computer is paused, move, resize, snapshot restore, exec with its downloads and uploads, and the browser terminal are refused the same way. Its clock stands still until it resumes. stop and restart still work.
pause_reason says why it's paused: requested, storage_limit, host_storage_full, disk_error or host. If its server loses its memory, the operation fails with memory_lost, the Computer reads stopped, and start boots it fresh.
Start a Computer
POST/v1/computer/modify"action": "start"
Starts a stopped Computer. A running one is left as it is.
Body
computerstringA Computer: its name or ID.
computersstring[]Several Computers at once, instead of
computer.waitboolean or stringWait until it finishes and return how it ended:
truewaits up to 10m, a duration such as2mwaits that long.
- An API key needs
startin its commands. - Give
computersinstead ofcomputerto act on several at once.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "start", "computer": "my-site"}'Stop a Computer
POST/v1/computer/modify"action": "stop"
Shuts a Computer down and keeps it off. Its disk, address and settings stay.
Body
computerstringA Computer: its name or ID.
computersstring[]Several Computers at once, instead of
computer.waitboolean or stringWait until it finishes and return how it ended:
truewaits up to 10m, a duration such as2mwaits that long.
- An API key needs
stopin its commands. - Give
computersinstead ofcomputerto act on several at once.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "stop", "computer": "my-site"}'Restart a Computer
POST/v1/computer/modify"action": "restart"
Restarts a Computer, or starts a stopped one. Its disk and settings stay.
Body
computerstringA Computer: its name or ID.
computersstring[]Several Computers at once, instead of
computer.waitboolean or stringWait until it finishes and return how it ended:
truewaits up to 10m, a duration such as2mwaits that long.
- An API key needs
restartin its commands. - Give
computersinstead ofcomputerto act on several at once.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "restart", "computer": "my-site"}'{
"version": 1,
"data": {
"request_id": "c44821a3-a72c-44d6-bf5e-c388d18265c3",
"operation": {
"id": "7bbd53b7-8a68-4f61-a03f-db54072e591d",
"kind": "restart",
"computer_id": "7cd4a3ec-7411-402c-b74b-43f6d7587ae7",
"revision": 2,
"state": "accepted"
}
}
}curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "restart", "computers": ["my-site", "my-shop"]}'{
"version": 1,
"data": {
"results": [
{
"computer": {"id": "8f2a8286-7123-4a64-874f-23a1c2bc61a0", "name": "my-site"},
"operation": {"id": "dd4ccc4f-6ff5-44a8-8812-3142d067ba6f", "kind": "restart", "state": "accepted", …}
},
{
"computer": {"id": "0d4e03b1-862f-4012-b14d-d7ffda5273c4", "name": "my-shop"},
"operation": {"id": "8fa85d89-f289-404e-91c9-a1a14dab1fcc", "kind": "restart", "state": "accepted", …}
}
],
"request_id": "f42ab1d8-0af8-4418-abfc-6d85f07b4a62"
}
}Pause a Computer
POST/v1/computer/modify"action": "pause"
Freezes a Computer where it is, keeping its memory and processes.
Body
computerstringA Computer: its name or ID.
computersstring[]Several Computers at once, instead of
computer.
- An API key needs
pausein its commands. - Give
computersinstead ofcomputerto act on several at once.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "pause", "computer": "my-site"}'Resume a Computer
POST/v1/computer/modify"action": "resume"
Continues a paused Computer where it was, in the same boot.
Its memory and processes come back as they were, within milliseconds.
Body
computerstringA Computer: its name or ID.
computersstring[]Several Computers at once, instead of
computer.
- An API key needs
resumein its commands. - Give
computersinstead ofcomputerto act on several at once.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "resume", "computer": "my-site"}'Reinstall a Computer
POST/v1/computer/modify"action": "reset"
Replaces a Computer's disk with a fresh one from its image and runs its setup again. Without yes, it only shows what would be erased.
With a new setup_script, the pool's current script runs first. Without one, the setup it was created with runs again.
Body
computerstring requiredA Computer: its name or ID.
imagestringReinstall from this image instead of its own.
setup_scriptstringRun this setup script instead of its own; it becomes its own, which later resets run. Or - to read it from standard input. Treated as a secret and never included in errors.
yesbooleanConfirm. Without it nothing changes, and the response says what would happen.
waitboolean or stringWait until it finishes and return how it ended:
truewaits up to 10m, a duration such as2mwaits that long.
- An API key needs
resetin its commands. - A key whose commands allow it must also allow
delete.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "reset", "computer": "my-site"}'Name, pool and size
Rename a Computer
POST/v1/computer/modify"action": "rename"
Gives a Computer a new name. Its address, SSH login and mail address follow at once; its ID and disk stay.
Body
computerstring requiredA Computer: its name or ID.
namestring requiredIts new name.
- An API key needs
renamein its commands.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "rename", "computer": "my-site", "name": "my-shop"}'Move a Computer
POST/v1/computer/modify"action": "move"
Moves a Computer to another of your pools on the same server. A running one restarts there.
Body
computerstringA Computer: its name or ID.
computersstring[]Several Computers at once, instead of
computer.poolstring requiredThe pool to move it to, on the same server.
yesbooleanConfirm. Without it nothing changes, and the response says what would happen.
- An API key needs
movein its commands. - Give
computersinstead ofcomputerto act on several at once.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "move", "computer": "my-site", "pool": "web-2"}'Resize a Computer
POST/v1/computer/modify"action": "resize"
Gives a Computer its own vCPUs, memory or a larger disk, within its pool's, or returns it to sharing the pool's.
The Computer doesn't restart.
Body
computerstring requiredA Computer: its name or ID.
cpustringvCPUs of its own, within its pool's, or pool to use the pool's again.
memorystringMemory of its own, such as 8GiB, within its pool's, or pool to use the pool's again.
diskstringA larger disk of its own, such as 50GB, up to the pool's storage; a disk only grows.
waitboolean or stringWait until it finishes and return how it ended:
truewaits up to 10m, a duration such as2mwaits that long.
- An API key needs
resizein its commands.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "resize", "computer": "my-site", "memory": "8GB"}'Tag a Computer
POST/v1/computer/modify"action": "tag"
Adds tags to a Computer, or takes them off.
Body
computerstringA Computer: its name or ID.
computersstring[]Several Computers at once, instead of
computer.tagsstring[]Tags to add; commas also separate them.
removestring[]A tag to take off.
- An API key needs
tagin its commands. - Give
computersinstead ofcomputerto act on several at once.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "tag", "computer": "my-site", "tags": ["web"]}'Comment on a Computer
POST/v1/computer/modify"action": "comment"
Replaces a Computer's comment. An empty one clears it.
Body
computerstringA Computer: its name or ID.
computersstring[]Several Computers at once, instead of
computer.commentstring requiredThe new comment, one line of at most 200 bytes; an empty one clears it.
- An API key needs
commentin its commands. - Give
computersinstead ofcomputerto act on several at once.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "comment", "computer": "my-site", "comment": "COMMENT"}'Snapshots
A snapshot saves the disk as it is, while the Computer keeps running. Snapshots live on the same server, so they're an undo button, not a backup. To keep a copy elsewhere, export the disk.
If copies were made from a snapshot you delete, Heaven keeps it until those copies are deleted, and it counts toward its pool's storage. ?view=snapshots lists it with kept_by_computers, and kept_by_other_copies counts copies in other accounts.
List snapshots
GET/v1/computer/?view=snapshots
Lists the snapshots of all your Computers or of one, or returns everything about one snapshot.
Query
computerstringOnly this Computer's snapshots.
snapshotstringRead this snapshot in full.
sortstringSort by size instead of newest first.
- An API key needs
snapshot viewin its commands.
curl 'https://heaven.dev/v1/computer/?view=snapshots' \
-H "Authorization: Bearer $HEAVEN_API_KEY"Snapshot a Computer
POST/v1/computer/modify"action": "snapshot create"
Saves a Computer's disk as it is now. A snapshot expires after 7 days unless you set another expiry.
Body
computerstringA Computer: its name or ID.
computersstring[]Several Computers at once, instead of
computer.namestringThe snapshot's name: letters, digits and hyphens. Defaults to the time.
notestringA note, one line of at most 200 bytes; an empty one clears it.
expiresstringHow long it is kept: 1d to 365d, or never (default 7d).
- An API key needs
snapshot createin its commands. - Give
computersinstead ofcomputerto act on several at once.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "snapshot create", "computer": "my-site"}'Change a snapshot
POST/v1/computer/modify"action": "snapshot edit"
Renames a snapshot or changes its note or expiry.
Body
computerstring requiredA Computer: its name or ID.
snapshotstring requiredA snapshot: its name or ID.
namestringA new name for the snapshot.
notestringA note, one line of at most 200 bytes; an empty one clears it.
expiresstringHow long it is kept: 1d to 365d, or never (default 7d).
- An API key needs
snapshot editin its commands.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "snapshot edit", "computer": "my-site", "snapshot": "before-upgrade"}'Restore a snapshot
POST/v1/computer/modify"action": "snapshot restore"
Returns a Computer's disk to a snapshot and starts it.
The current disk is saved first, so a restore can be undone.
Body
computerstring requiredA Computer: its name or ID.
snapshotstring requiredA snapshot: its name or ID.
- An API key needs
snapshot restorein its commands.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "snapshot restore", "computer": "my-site", "snapshot": "before-upgrade"}'Delete snapshots
POST/v1/computer/modify"action": "snapshot delete"
Deletes one or more snapshots.
You can delete up to 100 at once.
Body
computerstringA Computer: its name or ID.
computersstring[]Several Computers at once, instead of
computer.snapshotsstring[] requiredThe snapshots to delete: names or IDs.
- An API key needs
snapshot deletein its commands. - Give
computersinstead ofcomputerto act on several at once.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "snapshot delete", "computer": "my-site", "snapshots": ["before-upgrade"]}'Sharing
Share a Computer with people by email or ID, with a team of your organization, or with the whole organization (whole_organization: true). A role decides what they get:
web(the default): the website only.root: the website, plus SSH, the terminal,execand files.admin: everythingrootgets, plus the owner's changes, includingdeleteandreset. It excludes transferring, sharing,websiteand support access.
A team's admins own the Computers the team owns. The organization's billing owner and admins own the organization's Computers. Other members reach those only through a share, or as the team's member-access setting allows.
Share a Computer
POST/v1/computer/modify"action": "share add"
Gives people, a team or the whole organization access to a Computer, as web, root or admin.
Someone without an account gets an invitation, valid for 30 days, that their first sign-in accepts. The response is the share as it now stands.
Body
computerstringA Computer: its name or ID.
computersstring[]Several Computers at once, instead of
computer.usersstring[]A person: email address or user ID.
teamstringOne of your organization's teams.
whole_organizationbooleanEveryone in your organization.
rolestringweb (the default: the website only), root (SSH and the website) or admin (also manage it).
commandsstring[]Management commands on top of the role, such as
restartordomain add. It can't includeexec,terminal,logs,export,transfer, sharing,websiteorgrant-support-root.messagestringText sent with the email invitation, at most 500 bytes.
- API keys you create can't run it. Use a sign-in key or SSH.
- Give
computersinstead ofcomputerto act on several at once.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "share add", "computer": "my-site", "users": ["ada@example.com"], "role": "root"}'Stop sharing a Computer
POST/v1/computer/modify"action": "share remove"
Removes someone's access, or lowers their role.
With role, they keep that lesser role instead of losing access.
Body
computerstringA Computer: its name or ID.
computersstring[]Several Computers at once, instead of
computer.usersstring[]A person: email address or user ID.
teamstringA team it is shared with.
whole_organizationbooleanEveryone in your organization.
rolestringLeave them this lesser role instead of nothing.
- An API key needs
share removein its commands. - Give
computersinstead ofcomputerto act on several at once.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "share remove", "computer": "my-site"}'Create a share link
POST/v1/computer/modify"action": "share link add"
Creates a link that gives web access to a Computer.
The link is shown once, as url.
Body
computerstring requiredA Computer: its name or ID.
labelstringA label to recognize it by.
expiresstringHow long the link works: up to 365d, or never (default 30d).
max_usesstringHow many people can claim it.
- API keys you create can't run it. Use a sign-in key or SSH.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "share link add", "computer": "my-site"}'Remove a share link
POST/v1/computer/modify"action": "share link remove"
Removes a link that gives web access to a Computer.
Nobody new can claim the link. People who already claimed it keep access until you remove them with share remove.
Body
computerstring requiredA Computer: its name or ID.
linkstring requiredThe link's ID (see
access).
- An API key needs
share link removein its commands.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "share link remove", "computer": "my-site", "link": "LINK"}'Transfer a Computer
POST/v1/computer/modify"action": "transfer"
Gives a Computer in your organization to a member, a team or the organization itself. Its shares are cleared, unless keep_shares keeps those the new owner could make.
Body
computerstringA Computer: its name or ID.
computersstring[]Several Computers at once, instead of
computer.userstringThe member who gets it.
teamstringThe team that gets it.
whole_organizationbooleanThe organization itself gets it.
keep_sharesbooleanKeep shares with people, teams and the organization that the new owner could make themselves; without it, shares are cleared.
poolstringA pool: its name or ID.
- API keys you create can't run it. Use a sign-in key or SSH.
- Give
computersinstead ofcomputerto act on several at once.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "transfer", "computer": "my-site"}'Give support root access
POST/v1/computer/modify"action": "grant-support-root"
Gives Heaven's operators root access to a Computer, or takes it back.
Body
computerstring requiredA Computer: its name or ID.
statestring requiredon gives Heaven's operators root access, and off takes it away.
- An API key needs
grant-support-rootin its commands.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "grant-support-root", "computer": "my-site", "state": "STATE"}'Website, domains and ports
Every Computer serves a website at https://NAME.heaven.dev, from the port its image exposes. The website is private, open only to people with access, until you make it public.
To give a Computer one of your static addresses (not offered yet) for all its traffic in and out, use ip attach with computer. ip detach takes it off.
Set who reaches the website
POST/v1/computer/modify"action": "website"
Makes a Computer's website public or private, and sets the port it is served from. With neither, returns the current settings.
It returns the website's settings: computer, url, public, port, and default_port, which is the port the image exposes.
Body
computerstring requiredA Computer: its name or ID.
publicbooleanWith
true, anyone can visit. Withfalse, only people with access can.portstringThe port the website is served from.
0goes back to the image's port.
- An API key needs
websitein its commands.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "website", "computer": "my-site"}'"public": true{
"version": 1,
"data": {
"updated": true,
"computer": "my-site",
"url": "https://my-site.heaven.dev/",
"public": true,
"port": 0,
"default_port": 8080
}
}List domains
GET/v1/computer/?view=domains
Lists the verified website domains of all your Computers, or of one.
Query
computerstringA Computer: its name or ID.
- An API key needs
domain viewin its commands.
curl 'https://heaven.dev/v1/computer/?view=domains' \
-H "Authorization: Bearer $HEAVEN_API_KEY"Add a domain
POST/v1/computer/modify"action": "domain add"
Serves a Computer's website at your own domain. The domain's DNS must point at the Computer and have its verification record.
Before you add the domain, point its DNS at NAME.heaven.dev, and add a _heaven.DOMAIN TXT record holding heaven=COMPUTER_ID. If a record is missing, the error names it.
Body
computerstring requiredA Computer: its name or ID.
domainstring requiredA domain name you control, such as www.example.com.
wildcardbooleanAlso serve every name under the domain (*.DOMAIN).
- An API key needs
domain addin its commands.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "domain add", "computer": "my-site", "domain": "shop.example.com"}'Remove a domain
POST/v1/computer/modify"action": "domain remove"
Stops serving a Computer's website at one of your domains.
Body
computerstring requiredA Computer: its name or ID.
domainstring requiredA domain name you control, such as www.example.com.
- An API key needs
domain removein its commands.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "domain remove", "computer": "my-site", "domain": "shop.example.com"}'List public ports
GET/v1/computer/?view=ports
Lists the public TCP ports of all your Computers or of one, and each pool's allowance.
Query
computerstringA Computer: its name or ID.
- An API key needs
port viewin its commands.
curl 'https://heaven.dev/v1/computer/?view=ports' \
-H "Authorization: Bearer $HEAVEN_API_KEY"Publish a port
POST/v1/computer/modify"action": "port add"
Publishes one of a Computer's TCP ports to the internet, at a public port Heaven picks.
It returns the public port as address: ADDRESS:PORT on a static address, or NAME.heaven.dev:PORT otherwise.
Body
computerstring requiredA Computer: its name or ID.
guest_portstring requiredThe Computer's TCP port to publish.
- API keys you create can't run it. Use a sign-in key or SSH.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "port add", "computer": "my-site", "guest_port": "GUEST_PORT"}'Close a port
POST/v1/computer/modify"action": "port remove"
Closes a public TCP port. Name either the public port or the Computer's port.
Body
computerstring requiredA Computer: its name or ID.
portstring requiredThe public port, or the Computer's port it publishes.
- An API key needs
port removein its commands.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "port remove", "computer": "my-site", "port": "PORT"}'Read mail settings
GET/v1/computer/?view=mail
Returns whether a Computer receives mail, and whom it can send mail to.
Query
computerstring requiredA Computer: its name or ID.
- An API key needs
mail viewin its commands.
curl 'https://heaven.dev/v1/computer/?computer=my-site&view=mail' \
-H "Authorization: Bearer $HEAVEN_API_KEY"Set mail
POST/v1/computer/modify"action": "mail"
Turns receiving mail at the Computer's address on or off, and sets whom the Computer can send mail to.
A Computer receives mail at NAME.heaven.dev. It sends mail from inside itself through Heaven's mail API, with no credential:
curl http://169.254.169.254/gateway/email/send \
-H 'Content-Type: application/json' -H 'Idempotency-Key: build-123' \
-d '{"to":"alex@example.com","subject":"Build complete","body":"All green."}'
curl http://169.254.169.254/gateway/email/status/OPERATION_IDSending returns an operation ID once the message is accepted. If the response is lost, send it again with the same Idempotency-Key, never a new one. The message's status goes from queued through provider_accepted to delivered, or ends as refused, expired or unknown. reply_policy decides whom the Computer can send to, and mail to anyone else is refused.
Body
computerstring requiredA Computer: its name or ID.
statestringWith on, receive mail at NAME@ the domain. With off, refuse mail, and permanently delete its reply threads and unsubscribe everyone allowed to write to it.
reply_policystringWhom the Computer can send mail to:
all(the default: its owner, team members, those given access, and people who wrote to it while it receives mail),known(its owner, team members and those given access),owner(its owner only) ornone(it sends no mail).yesbooleanConfirm turning mail off when that deletes reply threads or subscriptions. Without it, off changes nothing and says what it would remove.
- An API key needs
mailin its commands.
curl https://heaven.dev/v1/computer/modify \
-H "Authorization: Bearer $HEAVEN_API_KEY" \
--json '{"action": "mail", "computer": "my-site"}'Read a message's delivery
GET/v1/computer/?operation=…
Returns whether a message a Computer sent was delivered, using the ID returned when it was sent.
Query
computerstring requiredA Computer: its name or ID.
operationstring requiredThe ID returned when the Computer sent it.
- An API key needs
mail statusin its commands.
curl 'https://heaven.dev/v1/computer/?computer=my-site&operation=OPERATION' \
-H "Authorization: Bearer $HEAVEN_API_KEY"