---
title: "Create Trigger"
method: POST
path: "/api/v1/triggers"
---

# Create Trigger

`POST /api/v1/triggers`

## Request

- Base URL: `https://api.mesharc.dev` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mesharc.dev/api/v1/triggers`
- Auth: none declared

Start work when a project's change record, or a monitor's run, matches
a condition: an agent run from a prompt template, a re-crawl of the
changed pages, a monitor run, or a re-check of the records read on the
changed pages. Fired by a tick once a source run has finished, once per
source run, within its cooldown, fires a day and monthly budget. It
looks from now on: what came before it is not news.

## Headers

- `authorization` string, nullable
- `x-mesharc-tenant` string, nullable

## Request body

- TriggerRequest
  - `name` string, nullable
  - `source` object, required
  - `when` object, nullable
  - `action` object, required
  - `limits` object, nullable
  - `status` string, nullable

## Response `201`

Successful Response

- Trigger
  - `id` string, required
  - `name` string, required
  - `status` string, required
  - `source` object, required
  - `when` object, required
  - `action` object, required
  - `limits` object, required
  - `spentThisMonth` integer
  - `lastFiredAt` string, nullable
  - `lastFire` TriggerFire
    - `id` string, required
    - `at` string, nullable
    - `status` string, required
    - `reason` string
    - `sourceRunId` string, required
    - `matched` integer, required
    - `items` object[]
    - `action` string, required
    - `refKind` string, nullable
    - `refId` string, nullable
    - `credits` integer
  - `createdAt` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/mesharc/apis/mesharc-api.md) · [All operations](https://skmtc.dev/mesharc/apis/mesharc-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mesharc/apis/mesharc-api/revisions/d63cc02dfec2?raw)
