> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rigbox.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# rig api

> Send a raw authenticated request to the Rigbox API

Available **local and workspace**. Reference source: CLI `0.13.0-rc.5` (`824aefd6ad16`).

Sends an authenticated request to the Rigbox API and prints the JSON response. `--body` takes inline JSON, a path to a JSON file, or `-` for standard input; a body that is not valid JSON fails before anything is sent. When the server answers with an error, the response body is printed as it was sent and the command exits non-zero; with `--output json`, the error event carries `status` and `body`. Inside a workspace, requests go through the workspace bridge, which serves only that workspace's routes.

## Examples

Run from your local terminal. Replace uppercase placeholders with your own values. This invocation performs the operation described above.

```bash theme={null}
rig api GET /v1/workspaces
```

Send an inline JSON body. Replace APP\_ID with an app ID from `rig app ls`.

```bash theme={null}
rig api PATCH /v1/apps/APP_ID --body '{"name":"web"}'
```

Inspect the supported arguments before running this command. Help is offline and does not modify resources.

```bash theme={null}
rig api --help
```

## Local syntax

```text theme={null}
Usage: rigbox api [OPTIONS] <METHOD> <PATH>
```

### Arguments and flags

| Argument | Description | Details |
| - | - | - |
| `method` | HTTP method (GET, POST, PUT, PATCH, DELETE) | Required; Value: METHOD |
| `path` | API path, e.g. /v1/workspaces | Required; Value: PATH |
| `--body` | Request body (non-GET): inline JSON such as '\{"name":"web"}', a JSON file path, or '-' for stdin | Value: JSON\|FILE |
| `--output` | Output format \[default: human, or `rig config set output …`] | Global; Value: OUTPUT; Choices: human, json, yaml, text, table |
| `--query` | Filter output with a JMESPath expression | Global; Value: JMESPATH |
| `--cli-input-json` | Read inputs from a JSON file or '-' (stdin) | Global; Value: FILE |
| `--cli-input-yaml` | Read inputs from a YAML file or '-' (stdin) | Global; Value: FILE; Conflicts: cli\_input\_json |
| `--generate-cli-skeleton` | Print a fillable input template, then exit | Global; Default: false |
| `--no-pager` | Do not pipe help output through a pager | Global; Default: false |
| `-v, --verbose` | Verbose diagnostics on stderr: per-phase deploy tracing, job-poll status, and transport commands. Useful for debugging a slow or stuck `rig deploy` | Global; Default: false |
| `-h, --help` | Print help | |

> **Complete command help**
>
> ```text theme={null}
> Send a raw authenticated request to the Rigbox API
>
> Usage: rigbox api [OPTIONS] <METHOD> <PATH>
>
> Arguments:
>   <METHOD>
>           HTTP method (GET, POST, PUT, PATCH, DELETE)
>
>   <PATH>
>           API path, e.g. /v1/workspaces
>
> Options:
>       --body <JSON|FILE>
>           Request body (non-GET): inline JSON such as '{"name":"web"}', a JSON file path, or '-' for stdin
>
>       --output <OUTPUT>
>           Output format [default: human, or `rig config set output …`]
>
>           [possible values: human, json, yaml, text, table]
>
>       --query <JMESPATH>
>           Filter output with a JMESPath expression
>
>       --cli-input-json <FILE>
>           Read inputs from a JSON file or '-' (stdin)
>
>       --cli-input-yaml <FILE>
>           Read inputs from a YAML file or '-' (stdin)
>
>       --generate-cli-skeleton
>           Print a fillable input template, then exit
>
>       --no-pager
>           Do not pipe help output through a pager
>
>   -v, --verbose
>           Verbose diagnostics on stderr: per-phase deploy tracing, job-poll status, and transport commands. Useful for debugging a slow or stuck `rig deploy`
>
>   -h, --help
>           Print help
> ```

## Workspace syntax

```text theme={null}
Usage: rigbox api [OPTIONS] <METHOD> <PATH>
```

### Arguments and flags

| Argument | Description | Details |
| - | - | - |
| `method` | HTTP method (GET, POST, PUT, PATCH, DELETE) | Required; Value: METHOD |
| `path` | API path, e.g. /v1/workspaces | Required; Value: PATH |
| `--body` | Request body (non-GET): inline JSON such as '\{"name":"web"}', a JSON file path, or '-' for stdin | Value: JSON\|FILE |
| `--output` | Output format \[default: human, or `rig config set output …`] | Global; Value: OUTPUT; Choices: human, json, yaml, text, table |
| `--query` | Filter output with a JMESPath expression | Global; Value: JMESPATH |
| `--no-pager` | Do not pipe help output through a pager | Global; Default: false |
| `-v, --verbose` | Verbose diagnostics on stderr (per-phase deploy tracing, job-poll status) | Global; Default: false |
| `-h, --help` | Print help | |

> **Complete command help**
>
> ```text theme={null}
> Send a raw request to the Rigbox API (through the workspace bridge)
>
> Usage: rigbox api [OPTIONS] <METHOD> <PATH>
>
> Options:
>       --output <OUTPUT>
>           Output format [default: human, or `rig config set output …`]
>
>           [possible values: human, json, yaml, text, table]
>
>       --query <JMESPATH>
>           Filter output with a JMESPath expression
>
>       --no-pager
>           Do not pipe help output through a pager
>
>   -v, --verbose
>           Verbose diagnostics on stderr (per-phase deploy tracing, job-poll status)
>
>   -h, --help
>           Print help
>
> CLI:
>       --body <JSON|FILE>
>           Request body (non-GET): inline JSON such as '{"name":"web"}', a JSON file path, or '-' for stdin
>
>   <METHOD>
>           HTTP method (GET, POST, PUT, PATCH, DELETE)
>
>   <PATH>
>           API path, e.g. /v1/workspaces
> ```


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