Deployments.ai Docs
Alerts

Create a monitor

POST /v1/monitors · SDK createMonitor · CLI deployments monitor create

POST
/v1/monitors

Requires monitors:write.

Authorization

platformBearer
headerAuthorizationBearer <token>

Platform bearer credential accepted as an opaque API key or JWT.

Header Parameters

x-deployments-organization*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
idempotency-key*string
Length1 <= length <= 512

Request Body

application/json
  1. body
condition*||||||||
environmentId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
name*string
Match^\S[\s\S]*\S$|^\S$|^$
Length1 <= length <= 120
notify*
projectId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
renotifyMinutes?integer
Range15 <= value <= 10080

Response Body

MonitorResponse

application/json
  1. response
archivedAt?string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
condition*||||||||
createdAt*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
environmentId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
id*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
mutedUntil?string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
name*string
Match^\S[\s\S]*\S$|^\S$|^$
Length1 <= length <= 120
notify*
organizationId*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
projectId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
renotifyMinutes?integer
Range15 <= value <= 10080
state*string
Value in"firing""ok"
status*string
Value in"active""archived""muted"
updatedAt*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
version*number|||
curl -X POST "https://example.com/v1/monitors" \  -H "x-deployments-organization: string" \  -H "idempotency-key: string" \  -H "Content-Type: application/json" \  -d '{    "condition": {      "kind": "run-failures",      "threshold": 1,      "windowMinutes": 5    },    "name": "string",    "notify": {      "emailPrincipalIds": [        "string"      ],      "emailRoles": [        "owner"      ],      "webhooks": true    }  }'
{  "archivedAt": "2019-08-24T14:15:22Z",  "condition": {    "agentDeploymentId": "string",    "kind": "run-failures",    "threshold": 1,    "windowMinutes": 5  },  "createdAt": "2019-08-24T14:15:22Z",  "environmentId": "string",  "id": "string",  "mutedUntil": "2019-08-24T14:15:22Z",  "name": "string",  "notify": {    "emailPrincipalIds": [      "string"    ],    "emailRoles": [      "owner"    ],    "webhooks": true  },  "organizationId": "string",  "projectId": "string",  "renotifyMinutes": 15,  "state": "firing",  "status": "active",  "updatedAt": "2019-08-24T14:15:22Z",  "version": 0}