MetaKit
beta
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.

GET

/v1/monitors

List monitors

Every monitor you own, newest first.

Parameters
NameTypeRequiredDescription
account_idintegerNoOnly monitors watching this account.
statusstringNoFilter by armed, triggered, paused, or error.
pageintegerNoPage number (default 1).
limitintegerNoPage 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
}
GET

/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", "...": "..." }
GET

/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
NameTypeRequiredDescription
pageintegerNoPage number (default 1).
limitintegerNoPage 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
}
POST

/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
NameTypeRequiredDescription
account_idintegerYesAccount to watch.
namestringYesLabel, e.g. "Drawdown guard".
metricstringYesequity, equity_percent, drawdown, or margin_level.
comparatorstringNoabove or below (default below). Ignored for drawdown.
thresholdnumberYesCurrency amount for equity; percentage for the other metrics.
rearm_modestringNoonce (default — alert then wait for a manual re-arm), recovery (re-arm automatically once the value recovers), or cooldown (repeat while breached).
cooldown_minutesintegerNoMinimum gap between repeats when rearm_mode is cooldown. Default 30.
channelstringYeswebhook, slack, discord, or telegram.
channel_configobjectYes{ 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, "...": "..." }
PATCH

/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, "...": "..." }
DELETE

/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 DELETE
Example response
204 No Content