# Requests and responses

URL: https://heaven.dev/docs/reference/requests
Updated: 2026-11-22

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.

## 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](https://heaven.dev/docs/reference/authentication#credentials) 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](https://heaven.dev/docs/reference/endpoints) 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](https://heaven.dev/docs/reference/exec) have their own request and response formats.

## Responses

| JSON field | Meaning |
| --- | --- |
| `version` | The management envelope version, currently `1`. |
| `data` | The command's result on success. An accepted change can return an [operation](https://heaven.dev/docs/reference/retries#operations). |
| `error` | An [error object](https://heaven.dev/docs/reference/errors#error-fields) 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](https://heaven.dev/docs/reference/computers/view) and [snapshot lists](https://heaven.dev/docs/reference/snapshots/view) 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

| Header | Use |
| --- | --- |
| `Authorization` | Sends your [bearer credential](https://heaven.dev/docs/reference/authentication#http). |
| `Content-Type` | Names the request body's format. Management JSON uses `application/json`. |
| `Accept` | Selects a response format. The default is JSON. Use `text/plain` for command text or `application/x-ndjson` for supported [operation streams](https://heaven.dev/docs/reference/retries#waiting) and [guest output](https://heaven.dev/docs/reference/exec/run). |
| `Idempotency-Key` | Sends a [request ID](https://heaven.dev/docs/reference/retries#request-ids) on commands that support replay. |
| `Heaven-Request-Id` | Identifies the request in the response. Include it when contacting [support](https://heaven.dev/docs/support). |
| `Heaven-Exit-Status` | Gives 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-After` | Gives the delay in seconds for a [retryable refusal](https://heaven.dev/docs/reference/retries#lost-responses) when Heaven supplies one. |
| `Heaven-Read-Tag` | Identifies a read's JSON response for use with [live updates](https://heaven.dev/docs/reference/live-updates#resume). |
