Skip to main content
PUT
Upsert

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

UpsertRequest states the complete alert held under fqn. Nothing is merged with the stored alert: every field is written as sent, so an omitted template clears it and the targets replace the stored ones. The only exception is is_disabled, described on the field.

The alert kind, the owner inside it, and config_id are fixed when an alert is created. When an alert already holds fqn and any of them differs from the stored value, the request fails with FAILED_PRECONDITION and nothing is written; to change one, delete the alert and upsert it again.

The trigger is stored as sent, as with Create. A query read back from the API carries parts it cannot express as unsupported, so to write a stored selection back unchanged send the rendered_resolver_ql you read as resolver_ql.

Incident-owner alerts cannot be upserted — manage them with ToggleIncidentOwnerAlert.

incidentLifecycle
incident_lifecycle · object
required

An incident lifecycle alert.

name
string

Human-readable name for the alert configuration.

Required string length: 1 - 255
fqn
string

Fully qualified name identifying the alert. An alert holding it is replaced; otherwise a new alert is created with it.

Required string length: 1 - 500
template
template · object

Custom template for the rendered alert message. Omit to use the default rendering, clearing any stored template. Currently applied only to issue alerts; accepted and ignored for other kinds.

configId
string | null

Config ID that owns this alert when deployed from configuration as code (see Alert.config_id); omit it for an alert authored directly. Cannot be combined with owner.ownership_id. For an existing alert it must equal the stored value, where omitted and the empty string are different values.

isDisabled
boolean | null

Whether the alert is paused. When omitted, a new alert is created enabled and an existing alert keeps its current state, so a deploy that does not manage pausing never re-enables an alert someone paused in the app. Set it to make the deploy own the paused state.

etag
string | null

Optional optimistic-concurrency guard: the write fails with ABORTED if the alert holding fqn was modified since this etag was read, or no longer exists.

Response

200 - application/json

Success

UpsertResponse returns the stored alert after the write.

alert
Alert · object
required

The alert configuration as stored.

created
boolean

True when no alert held fqn and this call created one.