---
title: "api request"
description: "Make a raw API request"
canonical: "https://pgbeam.com/docs/cli/api/request"
last-updated: "2026-10-30T03:14:55.000Z"
---

# api request

> Make a raw API request

URL: https://pgbeam.com/docs/cli/api/request

{/* Auto-generated from CLI commands. Do not edit. Run `pnpm generate:cli-docs` to regenerate. */}

Make a direct HTTP request to the PgBeam API. Supports path parameter interpolation: if the path matches a known API route template, path parameters are extracted automatically. Use `--data` (or `-d`) to send a JSON request body. Every request is authenticated via the active profile (or `--token` / `PGBEAM_API_KEY`), including reads like `/v1/regions`.

## Usage

```bash
pgbeam api request <method> <path> [flags]
```

## Options

| Option                 | Description                                   | Required | Default |
| ---------------------- | --------------------------------------------- | -------- | ------- |
| `<method>`             | HTTP method: GET, POST, PATCH, PUT, or DELETE | Yes      | -       |
| `<path>`               | API path (e.g. /v1/projects, /v1/regions)     | Yes      | -       |
| `--data <value>`, `-d` | JSON request body to send with the request    | No       | -       |

> **Global options**
>
> All [global options](/docs/cli/global-options) (`--token`, `--profile`,
> `--project`, `--org`, `--json`, `--no-color`, `--no-trunc`, `--debug`) are
> also available on this command.

## Examples

```bash
# List all regions
pgbeam api request GET /v1/regions

# Get a specific project
pgbeam api request GET /v1/projects/prj_xxx

# Create a project with a JSON body
pgbeam api request POST /v1/projects -d '{"name": "my-app", "org_id": "org_xxx"}'

# Delete a database
pgbeam api request DELETE /v1/projects/prj_xxx/databases/db_xxx
```

## Output

Outputs the API response as formatted JSON. Exits with a non-zero code on HTTP errors.