Project APIAlerts
Create an alert
Runs the preview's cost check first: a query too slow for the interval is refused with the shortest interval that passes.
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/" \ -H "environment_id: 0" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "condition": { "metricId": "string", "reducer": "last", "comparator": "gt", "threshold": 0 }, "intervalSec": 60, "lookbackSec": 60, "queryId": 1 }'{ "name": "string", "description": "string", "condition": { "metricId": "string", "reducer": "last", "comparator": "gt", "threshold": 0, "recoveryThreshold": 0 }, "intervalSec": 60, "lookbackSec": 60, "forCount": 1, "noDataPolicy": "no_data", "errorPolicy": "error", "repeatSec": 300, "annotate": true, "contactPointIds": [ "6a98df78-fa1b-4672-bc69-bd59c79644fc" ], "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "queryId": -9007199254740991, "state": "ok", "lastValue": 0, "lastEvaluatedAt": "2019-08-24T14:15:22Z", "lastTransitionAt": "2019-08-24T14:15:22Z", "nextEvaluationAt": "2019-08-24T14:15:22Z", "lastError": "string", "mutedUntil": "2019-08-24T14:15:22Z", "backoff": { "reason": "timeouts", "fromIntervalSec": -9007199254740991, "toIntervalSec": -9007199254740991, "at": "2019-08-24T14:15:22Z" }, "createdBy": { "userId": "string", "name": "string" }, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z"}