---
title: "Create Monitor"
method: POST
path: "/monitors"
tags: ["Monitors"]
---

# Create Monitor

`POST /monitors`

## Request

- Base URL: `https://api.croma.run`
- URL: `https://api.croma.run/monitors`
- Auth: HTTP bearer

Watch any data endpoint on a schedule and email up to three addresses what is new. The monitor runs once right away to record what already matches (the baseline) and sends a welcome email; from then on every run reports only what appeared since the last one: on a search, its new results; on a lookup of one record, the values that changed (each with what it was before) and any new item in its lists, such as a new action on a case. With `schedule.cadence: "source"` (the default) each run starts after the endpoint's own refresh has completed, so a daily source is checked once a day, right after new data lands; an endpoint served live has no refresh to follow and runs `daily` or `weekly` instead. Each run spends the same credits as one request to the endpoint. An organization may have up to 20 monitors.

## Headers

- `Idempotency-Key` string

## Request body

- MonitorCreateRequest
  - `name` string, required
  - `endpoint` string, required: The endpoint to watch, by path or catalog id. Only endpoints with `monitorable: true` in `/catalog` are accepted: every data source, served from a Croma dataset or queried live. A search reports its new results; a lookup (one case, company, vehicle or person) reports what changed in that record.
  - `query` object: The request body the monitor sends to the endpoint, validated exactly as a direct request would be. `page` and `per_page` are not allowed.
  - `schedule` object: When the monitor runs. `source` (the default) runs right after the endpoint's own refresh completes, and is only available on endpoints with `served_from: "dataset"`; `hourly`, `daily` and `weekly` run on the clock, never faster than the source refreshes. An endpoint with `served_from: "live"` queries the source on every run, so it takes `daily` or `weekly`.
    - `cadence` 'source' | 'hourly' | 'daily' | 'weekly'
    - `at` string: Time of day for daily and weekly, HH:MM. Default 08:00.
    - `weekday` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday': Day for weekly. Default monday.
    - `timezone` string: IANA timezone for `at`. Defaults to the dataset's own.
  - `recipients` string[], required: Up to three addresses that receive the results.
  - `notify` 'always' | 'on_new': `always` sends an email on every run, including one that found nothing new; `on_new` only when there is something to report.
  - `language` 'es' | 'en': Language of the emails.
  - `relevance` string, nullable: Optional instruction, in plain language, that filters new results by relevance before they are sent (e.g. "solo avisos sobre suspensión o caducidad del título"). Results the filter discards stay available under `GET /monitors/{id}/matches?relevant=false`.

## Response `201`

The monitor, with its compiled schedule and next run.

- MonitorResponse
  - `data` Monitor, required
    - `id` string, required
    - `name` string, required
    - `endpoint` object, required
      - `id` string, required
      - `path` string, required
      - `source` string, required
      - `name` string, required
    - `query` object, required
    - `relevance` string, nullable, required
    - `schedule` object, required
      - `cadence` 'source' | 'hourly' | 'daily' | 'weekly', required
      - `at` string
      - `weekday` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday'
      - `timezone` string, required
      - `cron` string, required: The compiled schedule, five-field cron in `timezone`.
      - `next_run_at` string, date-time, nullable, required
    - `recipients` string[], required
    - `notify` 'always' | 'on_new', required
    - `language` 'es' | 'en', required
    - `status` 'active' | 'paused', required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `last_run` MonitorLastRun, nullable, required
      - `id` string, required
      - `at` string, date-time, required
      - `status` 'running' | 'completed' | 'failed' | 'skipped_plan_limit', required
      - `new_results` integer, required
      - `relevant_results` integer, required
      - `source_as_of` string, nullable, required
      - `source_stale` boolean, required

## Other responses

- `400`: Invalid body: unknown endpoint, endpoint not monitorable, invalid query for that endpoint, schedule faster than the source, or too many recipients
- `401`: Missing or invalid API key
- `403`: Monitor limit reached for the organization (`monitor_limit_reached`), or monitors are not enabled for it yet (`monitors_not_enabled`)
- `409`: A monitor with the same endpoint, query and schedule already exists (`details.existing_id`)
- `429`: Rate limit exceeded
- `503`: The schedule could not be created; retry

---

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