# uip or triggers

> Syntax and options for `uip or triggers`, which manages time, queue, and API triggers in Orchestrator.

Manage Orchestrator **triggers**: time (schedule), queue, and API. Time and queue triggers are folder-scoped; API triggers are tenant-scoped. Every verb accepts `--type <time|queue|api>` (default `time`).

For the cross-resource conventions (auth, folder scoping, key types, output envelope), see the [`uip or` overview](./uip-or.md).

## Synopsis

```
uip or triggers list     [--type <type>] [--folder-path <path> | --folder-key <key>] [-n <name>] [--enabled | --disabled] [--sort-by <field>] [--all-fields]
uip or triggers get      <trigger-key> --type <type> [--folder-path <path> | --folder-key <key>] [--all-fields]
uip or triggers create   --type <type> --name <n> --release-key <k> --runtime-type <r> --job-priority  [type-specific flags]
uip or triggers update   <trigger-key> --type <type> [type-specific flags] [--enabled | --disabled]
uip or triggers delete   <trigger-key> --type <type> [--folder-path <path> | --folder-key <key>] --yes
uip or triggers history  <trigger-key> --type <type> [--folder-path <path> | --folder-key <key>] [-l <n>] [--offset <n>] [--all-fields]
```

:::note
There is no dedicated `enable` or `disable` command. Toggle a trigger with `update <trigger-key> --enabled` or `update <trigger-key> --disabled` instead (the two flags are mutually exclusive).
:::

## list

List triggers. Filters: `-n, --name`, `--enabled`, `--disabled` (mutually exclusive). `--sort-by <field>` sorts results. `--all-fields` returns the full API response instead of the curated subset.

```bash
uip or triggers list --type time --folder-path Shared --enabled
```

## get

Get a trigger by key. `--all-fields` returns the full API response instead of the curated subset.

## create

Create a trigger. Required flags: `--name`, `--release-key`, `--runtime-type <Serverless|Unattended|Headless|NonProduction|AgentService>`, `--job-priority <Low|Normal|High>` (default `Normal`).

Type-specific:
- **time** needs `--cron` (Quartz 6-field format) and optionally `--time-zone`.
- **queue** needs `--queue-key` (and accepts `--items-threshold`, `--max-jobs`, `--items-per-job`, `--activate-on-complete`).
- **api** needs `--slug` and `--method <Get|Post|Put|Delete>` (with optional `--calling-mode`).

Common: `-d, --description`, `--input-arguments <json>`, `--calendar-key`, `--stop-strategy <SoftStop|Kill>`, `--kill-process-expression`, `--resume-on-same-context`, `--run-as-me`, repeatable `--target "machine=<guid>,user=<guid>,session=<int>"`, `--mapping-mode <dynamic|strict>` (default `dynamic`; use `strict` when the folder has "Enable account-machine mappings" turned on).

```bash
uip or triggers create --type time \
  --name NightlyInvoices --release-key <release-guid> \
  --runtime-type Unattended --job-priority Normal \
  --folder-path Shared --cron "0 0 2 * * ?" --time-zone UTC
```

## update

Update by key. Same type-specific flags as `create`, all optional. Use `--no-*` counterparts to unset booleans (for example `--no-activate-on-complete`, `--no-resume-on-same-context`, `--no-run-as-me`). Pass `--enabled` or `--disabled` to toggle the trigger's state (mutually exclusive).

```bash
uip or triggers update <trigger-key> --type time --disabled
```

## delete

Delete a trigger by key. Requires `-y, --yes` — the CLI never prompts for destructive operations.

```bash
uip or triggers delete <trigger-key> --type time --yes
```

## history

Show the trigger execution history (fire log). Paginated via `-l, --limit` / `--offset`. `--all-fields` returns the full API response instead of the curated subset. Useful for diagnosing why a trigger did not fire (missing license, no machines, disabled, etc.).

## Exit codes

See [Exit codes](./exit-codes.md) for the shared contract. `delete` exits `1` if `-y, --yes` is omitted.

## Related commands

- [`uip or processes`](./uip-or-processes.md) — get a `--release-key` for `triggers create`.
- [`uip or queues`](./uip-or-queues.md) — queue keys for `--queue-key` on queue triggers.

## See also

- [`uip or` overview](./uip-or.md) — shared conventions for every `uip or` verb.
- [How-to: manage Orchestrator assets and queues](./howto-manage-resources.md) — trigger creation patterns.
