Skip to content

Create an alert rule

POST
/v1/metric-alerts
curl --request POST \
--url https://shareout.site/v1/metric-alerts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "artifact_id": "art_abc123", "metric_id": "revenue", "name": "Revenue dropped below target", "condition": { "op": "lt", "value": 100000 }, "schedule": "0 * * * *", "destination": { "kind": "slack", "config": { "connection": "team", "targetType": "channel", "channelId": "C0123456789", "mode": "message" } }, "message": "Revenue is below target.", "cooldown_seconds": 86400 }'
Media type application/json
object
artifact_id
required
string
metric_id
required
string
name
required
string
condition
required
object
op
required
string
Allowed values: gt gte lt lte eq neq
value
required
number
schedule
required

5-field cron expression.

string
destination
required
object
kind
required
string
Allowed values: slack email discord webhook http_get telegram
config
required

Destination config matching the kind (see Jobs config interfaces).

object
message
string
cooldown_seconds
integer
Examples
Example revenueDrop

Slack alert when revenue drops

{
"artifact_id": "art_abc123",
"metric_id": "revenue",
"name": "Revenue dropped below target",
"condition": {
"op": "lt",
"value": 100000
},
"schedule": "0 * * * *",
"destination": {
"kind": "slack",
"config": {
"connection": "team",
"targetType": "channel",
"channelId": "C0123456789",
"mode": "message"
}
},
"message": "Revenue is below target.",
"cooldown_seconds": 86400
}

Created

Invalid request

Media type application/json
object
success
required
boolean
error
required

Human-readable message.

string
code
required

Machine-readable error code.

string
Example
{
"success": false
}