GamebeastDocs
Dashboard
Project APIAlerts

Preview an alert

POST
/application/{applicationId}/analytics/v1/alerts/preview

The value the alert would judge now, whether it breaches, and the cost check. Runs the query once on the alert lane (a recent result is reused). Writes nothing.

Authorization

personalAccessTokenAuth
AuthorizationBearer <token>

Personal access token (prefixed gb_pat_). Acts on behalf of its owner and can never exceed the owner's own permissions. Send it as Authorization: Bearer <token>.

In: header

Path Parameters

applicationId*number

Gamebeast project ID

Header Parameters

environment_id*number

Gamebeast environment ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/application/0/analytics/v1/alerts/preview" \  -H "environment_id: 0" \  -H "Content-Type: application/json" \  -d '{    "queryId": 1,    "condition": {      "metricId": "string",      "reducer": "last",      "comparator": "gt",      "threshold": 0    },    "intervalSec": 60,    "lookbackSec": 60  }'
{  "status": "ready",  "value": 0,  "breach": true,  "points": [    {      "start": "2019-08-24T14:15:22Z",      "value": 0    }  ],  "refreshedAt": "2019-08-24T14:15:22Z",  "costCheck": {    "passed": true,    "measuredMs": 0,    "multiplier": 1,    "requestedIntervalSec": -9007199254740991,    "suggestedIntervalSec": -9007199254740991  }}