---
title: "oz0 subject rule"
description: "Usage and flags for oz0 subject rule."
canonical_url: "https://docs.oz0.ai/reference/cli/oz0/subject/rule"
---
# oz0 subject rule

> Usage and flags for oz0 subject rule.

For: Operators and developers looking up a command.

A mapping rule names the data subjects of the jobs a trigger starts, from what the trigger carries: for a webhook, its JSON body; for an event source, {body, event}: the delivery's body and the event its source's function made of it (none yet for the delivery's own job, so point into /body); for a routine, {input, body}: the job's input and what fired it; for a channel binding, the message ({text, room, workspace}) and identity: the author's {id, name, account}.

Each of up to 8 expressions is a JSON pointer (--pointer /buyer/email) or a CEL expression (--cel 'payload.items.map(i, i.owner)'), yielding a string or a list of strings; the union, at most 8 subjects, are the job's. A scheduled routine fire has no payload and gets none. Try a rule with `subject rule test` on a sample before you set it.

## Usage

```bash
oz0 subject rule [command]
```

## Subcommands

- [`delete`](https://docs.oz0.ai/reference/cli/oz0/subject/rule/delete)
- [`list`](https://docs.oz0.ai/reference/cli/oz0/subject/rule/list)
- [`set`](https://docs.oz0.ai/reference/cli/oz0/subject/rule/set)
- [`test`](https://docs.oz0.ai/reference/cli/oz0/subject/rule/test)

## Inherited flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --context
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        $OZ0_CONTEXT or &lt;config dir>/orchestrator-zero/context.json
      </code>
    </td>
    
    <td>
      CLI context file written by server init
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --log-level
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        info
      </code>
    </td>
    
    <td>
      log level: debug, info, warn or error
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --tenant
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        default
      </code>
    </td>
    
    <td>
      the tenant
    </td>
  </tr>
</tbody>
</table>

See [all `oz0` commands](https://docs.oz0.ai/reference/cli/oz0) and the [global flags](https://docs.oz0.ai/reference/cli/oz0#global-flags).


## Sitemap

See the full [sitemap](https://docs.oz0.ai/sitemap.md) for all pages.
