---
title: "Create Monitor"
method: POST
path: "/api/v1/monitors"
---

# Create Monitor

`POST /api/v1/monitors`

## 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/monitors`
- Auth: none declared

Keep a search or an agent request and run it on a schedule. Each run
is the ordinary search or agent run, charged as one; when it ends it is
compared with the last run that answered -- new, dropped and moved
results, or the answer's added, changed and removed values -- and the
`webhook` hears `search.changed` / `agent.changed` when something did.
The first run is `baselineId`'s (a finished run with the same request)
or starts now.

## Headers

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

## Request body

- MonitorRequest
  - `kind` string, required
  - `request` object, required
  - `schedule` string, required
  - `name` string, nullable
  - `webhook` union
    - object
    - string
  - `baselineId` string, nullable
  - `budget` object, nullable
  - `alerts` object, nullable
  - `addToProject` string, nullable
  - `rows` union
    - object
    - boolean
  - `destination` string, nullable
  - `sentiment` union
    - object
    - boolean

## Response `201`

Successful Response

- Monitor
  - `id` string, required
  - `kind` string, required
  - `name` string, required
  - `request` object, required
  - `schedule` string, required
  - `status` string, required
  - `webhook` object, nullable
  - `budget` object, nullable
  - `spentThisMonth` integer
  - `alerts` object, nullable
  - `addToProject` string, nullable
  - `rows` object, nullable
  - `destination` string, nullable
  - `sentiment` object, nullable
  - `nextRunAt` string, nullable
  - `lastRunAt` string, nullable
  - `lastRun` MonitorRun
    - `id` string, required
    - `monitorId` string, required
    - `kind` string, required
    - `trigger` string, required
    - `status` string, required
    - `refId` string, required
    - `credits` integer, required
    - `answered` boolean, required
    - `changed` boolean, required
    - `summary` string, required
    - `diff` object, nullable
    - `error` string
    - `addedToProject` integer
    - `rows` object, nullable
    - `destinationSync` object, nullable
    - `triggeredBy` object, nullable
    - `partial` boolean
    - `sentimentPending` boolean
    - `createdAt` string, nullable
    - `finishedAt` string, nullable
  - `createdAt` string, nullable
  - `webhookSecret` 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)
