Skip to content

Requests and responses

HTTP, the CLI, SSH and MCP run the same commands with the same fields and results. This page covers choosing resources, sending fields, and reading responses, pages and headers.

On this page

Choosing resources

#

Use a Computer's name or ID to select it. Either identifies its organization. Pool names are unique within an organization. If you can reach several pools with the same name, specify the organization or use the pool's ID.

For a request that needs an organization and has no resource to identify it, supply the organization's name or ID. Heaven uses your only organization when the choice is unambiguous. If you belong to several, requests that need one return invalid until you specify it. An organization API key supplies its own organization.

Lists of accessible Computers and pools can span organizations. Where the request accepts an organization field, use it to narrow the list.

Requests

#

Each request selects one command. The endpoint index gives its HTTP method and path. Reads use GET with query fields. A view selects a specific read when the endpoint offers several. Give a query field once per value for lists and use true or false for switches.

A management change uses POST with a JSON object of up to 512 KiB and Content-Type: application/json. On a /modify path, action selects the change. Heaven returns invalid for unknown or repeated top-level fields and values of the wrong type. Omit optional fields instead of sending null to use their documented defaults.

An HTTP change runs when you send it. On requests that support dry_run, set it to true to preview the result without applying the change. The CLI and management SSH ask for --yes on changes that require confirmation.

Some commands accept several targets in one request. Use the fields listed for that command and inspect each target's result. Guest commands and file transfers have their own request and response formats.

Responses

#
JSON fieldMeaning
versionThe management envelope version, currently 1.
dataThe command's result on success. An accepted change can return an operation.
errorAn error object when the request fails or Heaven can't confirm its outcome.

Management success uses HTTP 200. A multi-target request can succeed while individual targets report errors. Some reads include related sections. When a section is withheld for lack of permission, Heaven can list it in data.withheld.

Pagination

#

Computer lists and snapshot lists support pagination. Set limit for the first page. To continue, send the same filters and limit with the response's data.next as after. When next is absent, you've reached the last page. data.total counts the matches across pages.

Without a limit, HTTP and command-line requests return all matches for these lists. The corresponding MCP tools default to 100 entries. On the CLI and over management SSH, use --limit and --after.

Headers

#
HeaderUse
AuthorizationSends your bearer credential.
Content-TypeNames the request body's format. Management JSON uses application/json.
AcceptSelects a response format. The default is JSON. Use text/plain for command text or application/x-ndjson for supported operation streams and guest output.
Idempotency-KeySends a request ID on commands that support replay.
Heaven-Request-IdIdentifies the request in the response. Include it when contacting support.
Heaven-Exit-StatusGives the management command's exit status on JSON and text responses. A value of 1 indicates a refusal or a change with failed targets.
Retry-AfterGives the delay in seconds for a retryable refusal when Heaven supplies one.
Heaven-Read-TagIdentifies a read's JSON response for use with live updates.