Skip to content

API reference

Alert policies

Alert policies endpoints of the StatusTick REST API: list alert policies, create an alert policy, get an alert policy, delete an alert policy.

List alert policies

GET/v1/alert-policies

The Default policy first.

Authorization

apiKey
AuthorizationBearer <token>

Your organization's API key.

In: header

Response Body

application/json

curl -X GET "https://example.com/v1/alert-policies"
[  {    "id": "string",    "name": "string",    "isDefault": true,    "steps": [      {        "delayMinutes": 0,        "destinationIds": [          "string"        ],        "scheduleIds": [          "string"        ],        "owners": true,        "allDestinations": true      }    ],    "repeatEveryMinutes": 0,    "notifyOnResolve": true,    "workingHours": {      "timeZone": "string",      "start": "string",      "end": "string",      "days": [        "MONDAY"      ]    },    "alertOnDegraded": true,    "coolDownMinutes": 0,    "groupRelated": true,    "usedBy": 0,    "failingDestinationIds": [      "string"    ],    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "updatedBy": "string"  }]

Create an alert policy

POST/v1/alert-policies

Needs a READ_WRITE key from an owner or admin. Step 1 notifies its destinations at once; each later step pages on-call schedules or the owners after delayMinutes without an acknowledge. Destinations must be verified (destination.not_verified.unprocessable otherwise); failing ones are accepted and listed in failingDestinationIds.

Authorization

apiKey
AuthorizationBearer <token>

Your organization's API key.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/alert-policies" \  -H "Content-Type: application/json" \  -d '{    "name": "Payments",    "steps": [      {        "destinationIds": [          "itg_6TqLx2Vb9NcR1mWz4KsPaH"        ]      },      {        "delayMinutes": 10,        "scheduleIds": [          "ocs_2Wd8Nf5XqLm1Rz7TyBc3Kv"        ]      }    ],    "notifyOnResolve": true  }'
{  "id": "string",  "name": "string",  "isDefault": true,  "steps": [    {      "delayMinutes": 0,      "destinationIds": [        "string"      ],      "scheduleIds": [        "string"      ],      "owners": true,      "allDestinations": true    }  ],  "repeatEveryMinutes": 0,  "notifyOnResolve": true,  "workingHours": {    "timeZone": "string",    "start": "string",    "end": "string",    "days": [      "MONDAY"    ]  },  "alertOnDegraded": true,  "coolDownMinutes": 0,  "groupRelated": true,  "usedBy": 0,  "failingDestinationIds": [    "string"  ],  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "updatedBy": "string"}

Get an alert policy

GET/v1/alert-policies/{policyId}

Authorization

apiKey
AuthorizationBearer <token>

Your organization's API key.

In: header

Path Parameters

policyId*string

Response Body

application/json

application/json

curl -X GET "https://example.com/v1/alert-policies/alp_1M2fXr8ZqT4bNw6cYk0LdA"
{  "id": "string",  "name": "string",  "isDefault": true,  "steps": [    {      "delayMinutes": 0,      "destinationIds": [        "string"      ],      "scheduleIds": [        "string"      ],      "owners": true,      "allDestinations": true    }  ],  "repeatEveryMinutes": 0,  "notifyOnResolve": true,  "workingHours": {    "timeZone": "string",    "start": "string",    "end": "string",    "days": [      "MONDAY"    ]  },  "alertOnDegraded": true,  "coolDownMinutes": 0,  "groupRelated": true,  "usedBy": 0,  "failingDestinationIds": [    "string"  ],  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "updatedBy": "string"}

Delete an alert policy

DELETE/v1/alert-policies/{policyId}

Needs a READ_WRITE key from an owner or admin. Its monitors go back to the Default policy, which cannot be deleted.

Authorization

apiKey
AuthorizationBearer <token>

Your organization's API key.

In: header

Path Parameters

policyId*string

Response Body

application/json

application/json

curl -X DELETE "https://example.com/v1/alert-policies/alp_1M2fXr8ZqT4bNw6cYk0LdA"
Empty

Replace an alert policy

PUT/v1/alert-policies/{policyId}

Needs a READ_WRITE key from an owner or admin. Send the whole policy, as for create; coolDownMinutes and groupRelated left out keep their values.

Authorization

apiKey
AuthorizationBearer <token>

Your organization's API key.

In: header

Path Parameters

policyId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/v1/alert-policies/alp_1M2fXr8ZqT4bNw6cYk0LdA" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "steps": [      {}    ]  }'
{  "id": "string",  "name": "string",  "isDefault": true,  "steps": [    {      "delayMinutes": 0,      "destinationIds": [        "string"      ],      "scheduleIds": [        "string"      ],      "owners": true,      "allDestinations": true    }  ],  "repeatEveryMinutes": 0,  "notifyOnResolve": true,  "workingHours": {    "timeZone": "string",    "start": "string",    "end": "string",    "days": [      "MONDAY"    ]  },  "alertOnDegraded": true,  "coolDownMinutes": 0,  "groupRelated": true,  "usedBy": 0,  "failingDestinationIds": [    "string"  ],  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "updatedBy": "string"}
GET/v1/alert-policies/monitors

Authorization

apiKey
AuthorizationBearer <token>

Your organization's API key.

In: header

Query Parameters

monitorIds*array<string>
Itemsitems <= 500

Response Body

application/json

curl -X GET "https://example.com/v1/alert-policies/monitors?monitorIds=string"
{  "mnt_4KrVK3M1DqhDTFouCffKie": "alp_1M2fXr8ZqT4bNw6cYk0LdA"}
PUT/v1/alert-policies/{policyId}/monitors

Needs a READ_WRITE key. Choosing the Default policy clears the monitors' choice.

Authorization

apiKey
AuthorizationBearer <token>

Your organization's API key.

In: header

Path Parameters

policyId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PUT "https://example.com/v1/alert-policies/string/monitors" \  -H "Content-Type: application/json" \  -d '{    "monitorIds": [      "string"    ]  }'
Empty
All docs