> ## Documentation Index
> Fetch the complete documentation index at: https://helix-isolate-failing-index-entities.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# helix api

> Call a Helix Cloud API endpoint with your CLI login session

<div className="flex flex-wrap gap-2"><Badge color="gray" size="sm">Reference</Badge></div>

Send an authenticated request to any `/v1/...` path of the Helix Cloud API using your WorkOS
session, and print the JSON response. Cloud only. Use a resource-specific command
when one exists.

## Usage

```bash theme={null}
helix api get <path>
helix api post <path> [--body '<json>']
helix api patch <path> [--body '<json>']
helix api delete <path>
```

## Subcommands

| Subcommand | Description |
| - | - |
| `get` | Send a `GET` request. |
| `post` | Send a `POST` request with a JSON body. |
| `patch` | Send a `PATCH` request with a JSON body. |
| `delete` | Send a `DELETE` request. |

## Arguments

| Argument | Description |
| - | - |
| `PATH` | Absolute Helix Cloud API path starting with `/v1/`. Required. |

## Options

| Flag | Description | Default |
| - | - | - |
| `--body <JSON>` | Request body for `post` and `patch`. Must be valid JSON. | `{}` |
| `--json` | Print the response as compact JSON. | Off (highlighted, pretty-printed) |

## Behavior

* Only absolute `/v1/...` paths are accepted. Absolute URLs and direct gateway paths (the database endpoint used with application keys) are rejected.
* The response is printed on stdout as syntax-highlighted, pretty-printed JSON, or as compact JSON with `--json`.
* The command uses the same rotating WorkOS session as all other Cloud commands.
* If the API rejects an expired token before handling the request, the CLI refreshes the session and retries once. No other failure is retried.

## Examples

```bash theme={null}
helix api get /v1/workspaces
helix api post /v1/example --body '{"value":"example"}'
helix api patch /v1/example --body '{"value":"updated"}'
helix api delete /v1/example
```

## Related

* [`helix auth`](/cli/command-reference/auth) — log in before calling the API.
* [`helix workspace`](/cli/command-reference/workspace) — list workspaces without a raw API call.
* [Helix Cloud workflow](/cli/workflows/helix_cloud) — end-to-end Cloud usage.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.