---
title: "Create a trigger"
method: POST
path: "/triggers"
tags: ["Triggers"]
---

# Create a trigger

`POST /triggers`

Create a trigger with an activation type of `event`, `schedule`, or `custom`. Each type requires its own fields (e.g. `eventType` and optional `conditions` for events, `scheduleRule` and `timezone` for schedules, `customPayloadSchema` for custom triggers); mismatched fields are rejected.

## Request body

- CreateTriggerBody
  - `name` string, required
  - `description` string
  - `activation` 'event' | 'schedule' | 'custom', required
  - `eventType` string
  - `conditions` object
    - `all` object[]
    - `any` object[]
  - `scheduleRule` object
    - `type` 'once' | 'cron' | 'recurring', required
    - `dateTime` string — ISO 8601 datetime (for type=once)
    - `expression` string — Cron expression (for type=cron)
    - `rrule` string — RRULE string (for type=recurring)
  - `timezone` string
  - `customPayloadSchema` CustomPayloadSchema — Optional JSON Schema for validating payloads sent to this custom trigger

## Response `201`

Trigger created

- object
  - `data` Trigger, required
    - `id` string, uuid, required
    - `userId` string, uuid, required — Deprecated: use ownerId (tenancy) / createdBy (actor).
    - `ownerId` string, uuid, required
    - `createdBy` string, uuid, nullable, required
    - `name` string, required
    - `description` string, nullable, required
    - `activation` 'event' | 'schedule' | 'custom', required
    - `scheduleRule` ScheduleRule, required
      - `type` 'once' | 'cron' | 'recurring', required
      - `dateTime` string — ISO 8601 datetime (for type=once)
      - `expression` string — Cron expression (for type=cron)
      - `rrule` string — RRULE string (for type=recurring)
    - `timezone` string, nullable, required
    - `nextFireTime` string, nullable
    - `eventType` string, nullable, required
    - `conditions` unknown
    - `customPayloadSchema` object, nullable, required
    - `createdAt` string, nullable, required
    - `updatedAt` string, nullable, required

## Changes

- **2026-07-07** `d5d1e5ee8188` — 3 info
  - response property `data/userId` deprecated
  - added the required property `data/createdBy` to the response with the `201` status
  - added the required property `data/ownerId` to the response with the `201` status
- **2026-06-28** `fd8fb6b29e38` — 1 info
  - endpoint added
- **2026-06-27** `99b4ade46263` — 1 breaking
  - api path removed without deprecation
- **2026-06-19** `7f577998739b` — 1 info
  - endpoint added
- **2026-06-19** `ec76cd771e68` — 1 breaking
  - api path removed without deprecation

[Full history](https://skmtc.dev/droidrun/apis/droidrun-cloud/changes/triggers/post.md)

---

[API](https://skmtc.dev/droidrun/apis/droidrun-cloud.md) · [All operations](https://skmtc.dev/droidrun/apis/droidrun-cloud/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/droidrun/droidrun-cloud/revisions/b6fd8aed4bf4/schema)
