---
title: "approvals rules create"
description: "Create an approval rule"
canonical: "https://pgbeam.com/docs/cli/approvals/rules/create"
last-updated: "2026-11-09T17:53:44.000Z"
---

# approvals rules create

> Create an approval rule

URL: https://pgbeam.com/docs/cli/approvals/rules/create

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

Sends the agent statements the rule matches to a human for approval, whatever the policy profile's approval_mode says. A rule can only add approval; nothing here can exempt a statement from approval_mode.

The rule is pushed to connected data planes when it is written. A reviewer sees its name on every approval request it holds.

Returns 409 for an enabled rule while the organization has a live self-hosted data plane enrollment, because PgBeam cannot yet confirm that a self-hosted proxy runs a build that enforces approval rules. A rule with enabled set to false is still accepted.

## Usage

```bash
pgbeam approvals rules create <name> [flags]
```

## Options

| Option                        | Description                                                                                                                                                                                                                                                           | Required | Default |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
| `<name>`                      |                                                                                                                                                                                                                                                                       | Yes      | -       |
| `--statement-kinds <value>`   | Statement kinds the rule holds. Empty or omitted holds every kind. One of: insert, update, delete, ddl.                                                                                                                                                               | No       | -       |
| `--schema-name <value>`       | Schema to scope the rule to. Null, empty or omitted matches every schema.                                                                                                                                                                                             | No       | -       |
| `--relation-name <value>`     | Relation to scope the rule to. Null, empty or omitted matches every relation. Without a schema it matches that name in every schema.                                                                                                                                  | No       | -       |
| `--min-affected-rows <value>` | Hold only statements affecting at least this many rows. Must be at least 1. Null or omitted holds every matching statement. The count is taken in a rolled-back trial run; a statement that reports no count (DDL, a batch, a data-modifying CTE) is held regardless. | No       | -       |
| `--enabled <value>`           | False switches the rule off, so it holds nothing.                                                                                                                                                                                                                     | 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
# Create an approval rule
pgbeam approvals rules create

# Output as JSON
pgbeam approvals rules create --json
```

## Output

Renders a human-readable table or detail view by default; pass `--json` for the raw API response.