Cloady Docs
API ReferenceEndpointsApplications

Create an alert rule

p95 and errors exist only for the service the app's address routes to. A rule that fires emails members who keep incident emails on (when `email`), posts to its channels, and with `statusPage` puts the app on the workspace's status page. Answers 400 `bad_rule` when the rule does not fit the metric.

POST
/api/workspaces/{workspaceSlug}/apps/{appSlug}/alerts
AuthorizationBearer <token>

Personal API token (cldy_…)

In: header

Path Parameters

workspaceSlug*string
appSlug*string

Query Parameters

env?string

Value in

  • "production"
  • "preview"
  • "development"
region?string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/workspaces/string/apps/string/alerts" \  -H "Content-Type: application/json" \  -d '{    "metric": "p95"  }'
{  "alert": {    "id": "string",    "service": "string",    "metric": "p95",    "comparison": ">",    "threshold": 0,    "window": "2m",    "for": "1m",    "email": true,    "channels": [      "string"    ],    "statusPage": true,    "enabled": true,    "state": "ok",    "open": [      {        "service": "string",        "state": "pending",        "since": "string",        "value": 0      }    ],    "lastFiredAt": "string",    "evaluatedAt": "string",    "sentence": "string",    "query": "string",    "createdAt": "string"  }}