API Reference
Base URL: https://api.metakit.cloud
Equity Monitors
A monitor watches one account and fires an alert when a threshold is crossed. Metrics: equity (absolute, in account currency), equity_percent (change from the equity captured when armed), drawdown (fall from the highest equity since arming), and margin_level. Limits are 1 monitor per read-only account and 3 per full account — paused monitors still count. channel_config is write-only: it can be set and replaced but is never returned, so a leaked API key cannot become a leaked Slack webhook.
/v1/monitors
List monitors
Every monitor you own, newest first.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| account_id | integer | No | Only monitors watching this account. |
| status | string | No | Filter by armed, triggered, paused, or error. |
| page | integer | No | Page number (default 1). |
| limit | integer | No | Page size (default 25, max 100). |
Example request
curl https://api.metakit.cloud/v1/monitors \
-H "Authorization: Bearer stk_live_..."Example response
{
"data": [
{
"id": 4,
"account_id": 2,
"name": "Drawdown guard",
"metric": "drawdown",
"comparator": "above",
"threshold": 10,
"rearm_mode": "recovery",
"cooldown_minutes": 30,
"channel": "slack",
"status": "armed",
"last_value": 3.2,
"last_checked_at": "2026-07-29T10:14:40.000Z",
"last_triggered_at": null,
"trigger_count": 0,
"created_at": "2026-07-20T09:00:00.000Z",
"updated_at": "2026-07-29T10:14:40.000Z"
}
],
"page": 1,
"limit": 25,
"total": 1,
"total_pages": 1
}/v1/monitors/{id}
Get monitor
One monitor by id.
Example request
curl https://api.metakit.cloud/v1/monitors/123 \
-H "Authorization: Bearer stk_live_..."Example response
{ "id": 4, "account_id": 2, "name": "Drawdown guard", "status": "armed", "...": "..." }/v1/monitors/{id}/events
Alert history
Every alert this monitor has fired, newest first — including failed deliveries. Lets you reconcile what fired without holding a webhook endpoint open.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | integer | No | Page number (default 1). |
| limit | integer | No | Page size (default 25, max 100). |
Example request
curl https://api.metakit.cloud/v1/monitors/123/events \
-H "Authorization: Bearer stk_live_..."Example response
{
"data": [
{
"id": "6712a1f9c3e4b5a7d8e9f012",
"monitor_id": 4,
"value": 12.4,
"threshold": 10,
"metric": "drawdown",
"channel": "slack",
"delivered": true,
"latency_ms": 195,
"created_at": "2026-07-29T10:14:55.301Z"
}
],
"page": 1,
"limit": 25,
"total": 1,
"total_pages": 1
}/v1/monitors
Create monitor
Create a monitor on an account you own. Returns 409 monitor_limit_reached if the account has used its allowance. comparator is ignored for drawdown, which always compares upward. Channel URLs are validated: Slack must start with https://hooks.slack.com/ and Discord with https://discord.com/api/webhooks/.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| account_id | integer | Yes | Account to watch. |
| name | string | Yes | Label, e.g. "Drawdown guard". |
| metric | string | Yes | equity, equity_percent, drawdown, or margin_level. |
| comparator | string | No | above or below (default below). Ignored for drawdown. |
| threshold | number | Yes | Currency amount for equity; percentage for the other metrics. |
| rearm_mode | string | No | once (default — alert then wait for a manual re-arm), recovery (re-arm automatically once the value recovers), or cooldown (repeat while breached). |
| cooldown_minutes | integer | No | Minimum gap between repeats when rearm_mode is cooldown. Default 30. |
| channel | string | Yes | webhook, slack, discord, or telegram. |
| channel_config | object | Yes | { url } for webhook/slack/discord, or { bot_token, chat_id } for telegram. Write-only — never returned. |
Request body
{
"account_id": 2,
"name": "Drawdown guard",
"metric": "drawdown",
"threshold": 10,
"rearm_mode": "recovery",
"channel": "slack",
"channel_config": { "url": "https://hooks.slack.com/services/T00/B00/xxx" }
}Example request
curl https://api.metakit.cloud/v1/monitors \
-H "Authorization: Bearer stk_live_..." \
-H "Content-Type: application/json" \
-X POST \
-d '{...'Example response
{ "id": 4, "account_id": 2, "status": "armed", "trigger_count": 0, "...": "..." }/v1/monitors/{id}
Update, pause, or re-arm
Change any setting. Set status to paused to stop evaluation, or to armed to re-arm a triggered monitor — re-arming clears the stored peak and baseline so the next alert measures from now rather than from a stale incident.
Request body
{ "status": "armed" }
// or change the rule:
{ "threshold": 15, "rearm_mode": "cooldown", "cooldown_minutes": 60 }Example request
curl https://api.metakit.cloud/v1/monitors/123 \
-H "Authorization: Bearer stk_live_..." \
-H "Content-Type: application/json" \
-X PATCH \
-d '{ "status": "armed" }...'Example response
{ "id": 4, "status": "armed", "threshold": 15, "...": "..." }/v1/monitors/{id}
Delete monitor
Delete the monitor and its alert history, freeing its slot on the account. Returns 204.
Example request
curl https://api.metakit.cloud/v1/monitors/123 \
-H "Authorization: Bearer stk_live_..." \
-X DELETEExample response
204 No Content