---
title: "Create a trigger"
method: POST
path: "/sheets/{sheetId}/triggers"
tags: ["triggers"]
---

# Create a trigger

`POST /sheets/{sheetId}/triggers`

## Request

- Base URL: `https://api.orcascan.com/v1`
- URL: `https://api.orcascan.com/v1/sheets/{sheetId}/triggers`
- Auth: HTTP bearer

## Request body

- NewTrigger: Writable trigger configuration properties
  - `name` string, required: Trigger name
  - `conditionField` string, required: Field title to evaluate. For `exists in` / `does not exist in`, use the barcode column
  - `conditionType` 'is empty' | 'is not empty' | 'contains' | 'does not contain' | 'starts with' | 'does not start with' | 'ends with' | 'does not end with' | 'equals' | 'does not equal' | 'is less than' | 'is greater than' | 'matches regex' | 'does not match regex' | 'contains GS1 AI' | 'exists in' | 'does not exist in', required: Condition operator
  - `conditionValue` string: Value to compare against. For `exists in` / `does not exist in`: `lookup` (Lookup URL), `datasource` (a data source) or `sheet` (this sheet)
  - `actionType` 'show' | 'hide' | 'set value' | 'clear value' | 'set readonly' | 'clear readonly' | 'set required' | 'clear required' | 'notify me' | 'play sound' | 'move row' | 'copy row', required: Action to perform when condition is met
  - `actionField` string: Target field for the action
  - `actionValue` string: Value to set when action is 'set value'
  - `notifyMethod` 'email' | 'in app notification' | 'in app dialog': Notification delivery method
  - `notifyEmails` string: Comma-separated email addresses for notifications (required when `notifyMethod` is `email`)
  - `notifyType` 'success' | 'warning' | 'error': Notification severity
  - `soundType` 'success' | 'warning' | 'error': Sound to play
  - `toSheet` string: Target sheet for move/copy row actions
  - `enabled` boolean: Whether the trigger is active

## Response `201`

Created trigger wrapped in data envelope

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key
- `429`: Rate limit exceeded (15 requests/sec per IP). Retry after the specified delay.

---

[API](https://skmtc.dev/orcascan/apis/orca-scan-rest-api.md) · [All operations](https://skmtc.dev/orcascan/apis/orca-scan-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/orcascan/apis/orca-scan-rest-api/revisions/13236cc773c3?raw)
