# POST /v2/monitor

> Create a monitor: targets to read on a schedule, and a report of what changed.

POST `/v2/monitor`

**Authentication:** your key as a [bearer token](https://darkcrawl.dev/docs/api-reference/authentication/).

## Body

| Field                     | Type                                                                 | Required | Default |
| ------------------------- | -------------------------------------------------------------------- | -------- | ------- |
| `name`                    | `string`                                                             | Required |         |
| `schedule`                | `object`                                                             | Required |         |
| `targets`                 | `object[]`                                                           | Required |         |
| `targets[].type`          | `string` Values: `scrape`, `crawl`, `search`                         | Required |         |
| `targets[].id`            | `string \| null`                                                     | Optional |         |
| `targets[].scrapeOptions` | `object \| null`                                                     | Optional |         |
| `targets[].urls`          | `string[]`                                                           | Optional |         |
| `targets[].crawlOptions`  | `object \| null`                                                     | Optional |         |
| `targets[].url`           | `string`                                                             | Optional |         |
| `targets[].maxResults`    | `integer`                                                            | Optional | `10`    |
| `targets[].queries`       | `string[]`                                                           | Optional |         |
| `targets[].sources`       | `string[] \| null` Values: `ahmia`, `captures`                       | Optional |         |
| `channelIds`              | `string[]`                                                           | Optional | `[]`    |
| `goal`                    | `string \| null`                                                     | Optional |         |
| `judgeEnabled`            | `boolean \| null`                                                    | Optional |         |
| `notification`            | `object \| null`                                                     | Optional |         |
| `notification.email`      | `object \| null`                                                     | Optional |         |
| `notification.slack`      | `object \| null`                                                     | Optional |         |
| `retentionDays`           | `integer`                                                            | Optional | `30`    |
| `webhook`                 | `string \| object \| null`                                           | Optional |         |
| `webhook.url`             | `string`                                                             | Required |         |
| `webhook.events`          | `string[] \| null` Values: `monitor.page`, `monitor.check.completed` | Optional |         |
| `webhook.headers`         | `object \| null`                                                     | Optional |         |
| `webhook.metadata`        | `object \| null`                                                     | Optional |         |

Firecrawl compatibility fields

Firecrawl fields DarkCrawl does not offer. It takes them so the Firecrawl SDKs keep working, then ignores or refuses each one as the table says.

| Field                      | What DarkCrawl does                   |
| -------------------------- | ------------------------------------- |
| `targets[].excludeDomains` | Answers 400 NOT_IMPLEMENTED when set. |
| `targets[].includeDomains` | Answers 400 NOT_IMPLEMENTED when set. |
| `targets[].searchWindow`   | Accepted and ignored.                 |
| `origin`                   | Accepted and ignored.                 |

## Request

**curl**

```bash
curl -X POST https://api.darkcrawl.dev/v2/monitor \
  -H "Authorization: Bearer $DARKCRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Notice board","schedule":{"cron":"0 */6 * * *","timezone":"Europe/Berlin"},"targets":[{"type":"scrape","urls":["http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice"]}]}'
```

**Python**

```python
import os
import requests

resp = requests.post(
    "https://api.darkcrawl.dev/v2/monitor",
    headers={"Authorization": "Bearer " + os.environ["DARKCRAWL_API_KEY"]},
    json={
        "name": "Notice board",
        "schedule": {
            "cron": "0 */6 * * *",
            "timezone": "Europe/Berlin",
        },
        "targets": [
            {
                "type": "scrape",
                "urls": ["http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice"],
            },
        ],
    },
    timeout=330,
)
print(resp.json())
```

**Node**

```javascript
const resp = await fetch("https://api.darkcrawl.dev/v2/monitor", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.DARKCRAWL_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Notice board",
    "schedule": {
      "cron": "0 */6 * * *",
      "timezone": "Europe/Berlin"
    },
    "targets": [
      {
        "type": "scrape",
        "urls": [
          "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice"
        ]
      }
    ]
  }),
  signal: AbortSignal.timeout(330000),
});
console.log(await resp.json());
```

## Response

Status `200`.

```json
{
  "success": true,
  "data": {
    "id": "01K0EXAMPLEMONITOR0000000A",
    "name": "Notice board",
    "status": "active",
    "schedule": {
      "cron": "0 */6 * * *",
      "timezone": "Europe/Berlin"
    },
    "nextRunAt": "2026-11-26T12:00:00.000000+00:00",
    "lastRunAt": null,
    "currentCheckId": null,
    "targets": [
      {
        "id": "01K0EXAMPLETARGET00000000A",
        "type": "scrape",
        "urls": [
          "http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice"
        ],
        "scrapeOptions": {}
      }
    ],
    "webhook": null,
    "notification": {},
    "emailRecipientSubscriptions": [],
    "retentionDays": 30,
    "estimatedCreditsPerMonth": 0,
    "lastCheckSummary": null,
    "goal": null,
    "judgeEnabled": false,
    "channelIds": [],
    "createdAt": "2026-11-26T10:00:00.000000+00:00",
    "updatedAt": "2026-11-26T10:00:00.000000+00:00"
  }
}
```

## Errors

| Code                    | Status |
| ----------------------- | ------ |
| `BAD_REQUEST`           | 400    |
| `NOT_IMPLEMENTED`       | 400    |
| `INVALID_ONION`         | 400    |
| `POLICY_FORBIDDEN`      | 400    |
| `BLOCKLISTED`           | 403    |
| `BLOCKLIST_UNAVAILABLE` | 503    |
| `SECRETS_UNAVAILABLE`   | 503    |
| `QUOTA_EXCEEDED`        | 402    |

What each code means, and what to do about it: [Errors](https://darkcrawl.dev/docs/api-reference/errors/).

## Notes

- A `scrape` target takes `urls`, a `crawl` target one `url` with `crawlOptions`, and a `search` target `queries`. The [Monitor guide](https://darkcrawl.dev/docs/endpoints/monitor/) has the options of each.
- `schedule` is `{"cron": ...}` or `{"text": ...}`, with an optional `timezone`. It comes back as the cron it becomes.
- A company can keep as many monitors as its plan allows. At the limit the call is `402 QUOTA_EXCEEDED`, with `details` of `{"limit": "monitors", "max": ...}`. [Rate limits](https://darkcrawl.dev/docs/api-reference/rate-limits/) has the limit.
- Each check reserves one page for each scrape address and a crawl target's `limit` for each crawl. Search targets cost nothing. A crawl `limit` above the plan's crawl maximum is lowered, and `warning` says so.
- `webhook` is `https` only, and is shown back as a hint of its address and `***` for each header value. See [Webhooks](https://darkcrawl.dev/docs/api-reference/webhooks/). Name alert channels in `channelIds` to be told when a page changes.
- Turning on `notification.email` or `notification.slack` is `400 NOT_IMPLEMENTED`: use `channelIds`.
