Change the analytics alert settings
PATCH /v1/analytics/alert-settings
| Property | Value |
|---|---|
| Operation | update_alert_settings |
| Group | Call trace and analytics |
| Scope | analytics:write |
| Route class | control |
| Idempotency | No Idempotency-Key |
| Audit | Audited alert_settings.update (mutation) |
| Released in | 1.57.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Writes the next revision of the alert settings at the revision If-Match names (1.57.0), audited with the values before and after. Session only: the api refuses the route to every API key, and to a Member who is not an owner or admin, with 403 forbidden and the detail owner_or_admin_required.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the analytics:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl -X PATCH "$VOCAL_API/v1/analytics/alert-settings" \
-H "Authorization: Bearer $VOCAL_API_KEY" \
-H 'If-Match: "1"' \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch(`${process.env.VOCAL_API}/v1/analytics/alert-settings`, {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
'If-Match': '"1"',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
console.log(response.status, await response.text());import os
import requests
response = requests.patch(
f"{os.environ['VOCAL_API']}/v1/analytics/alert-settings",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
"If-Match": '"1"',
},
json={},
)
print(response.status_code, response.text)Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
if-match | header | string | yes | The revision the change was made against, quoted as the ETag returns it, or * to overwrite. |
Request body
Content type application/json, required: AlertSettingsUpdateRequest.
| Field | Type | Required | Description |
|---|---|---|---|
latency_regression | LatencyRegressionSettingsInput | no | |
spend | SpendAlertSettingsInput | no |
Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | AlertSettings | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden, org_suspended |
412 | application/json | ErrorEnvelope | revision_mismatch |
422 | application/json | ErrorEnvelope | validation_failed |
428 | application/json | ErrorEnvelope | precondition_required |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is AlertSettings.
| Field | Type | Required | Description |
|---|---|---|---|
latency_regression | LatencyRegressionSettings | yes | |
object | "alert_settings" | yes | |
revision | integer | yes | Counts the changes; 0 for the defaults. Returned as the ETag and required in If-Match. |
spend | SpendAlertSettings | yes | |
updated_at | Timestamp or null | yes | |
updated_by | ActorRef or null | yes |