Skip to content
betterstack-alchemyUnofficial

Incidents.StatusPageResource

Kind ResourceType id BetterStack.Incidents.StatusPageResourceSource src/Incidents/StatusPageResource.tsLive test available A live lifecycle test exists: it runs against the offline mock by default and against the real API under bun run test:live. This records that the test exists, not a dated live run (see Compatibility). Test file: test/Incidents/StatusPageResource.test.ts.

An item shown on a Better Stack StatusPage: a Monitor, Heartbeat, MonitorGroup or HeartbeatGroup (by resourceType + resourceId), an integration, a logs chart, a catalog reference, or a manually tracked item, under its publicName. It sits in a StatusPageSection (statusPageSectionId), or in the page’s first section when that is left out.

Every prop updates in place (moving between sections included) except statusPageId (the parent) and teamId, which replace it. position counts from 0 within the section; fixedPosition is never returned by the API. Deleting it never affects the monitor or heartbeat it shows; a manually tracked item or catalog reference nothing else uses is deleted with it.

The public API’s response times

const api = yield* BetterStack.Incidents.Monitor("api", {
url: "https://api.acme.example.com/health",
monitorType: "status",
});
const page = yield* BetterStack.Incidents.StatusPage("status", {
companyName: "Acme Cloud",
timezone: "UTC",
});
const section = yield* BetterStack.Incidents.StatusPageSection("api-section", {
statusPageId: page.id,
name: "API",
});
yield* BetterStack.Incidents.StatusPageResource("api-item", {
statusPageId: page.id,
statusPageSectionId: section.id,
resourceType: "Monitor",
resourceId: api.id,
publicName: "Public API",
explanation: "Requests to api.acme.example.com",
widgetType: "response_times",
});

A nightly job on the same page

const backup = yield* BetterStack.Incidents.Heartbeat("backup", {
name: "Nightly backup",
period: 86400,
grace: 3600,
});
yield* BetterStack.Incidents.StatusPageResource("backup-item", {
statusPageId: page.id,
resourceType: "Heartbeat",
resourceId: backup.id,
publicName: "Backups",
});

publicName string required

The name shown publicly on the status page.

resourceType "Monitor" | "MonitorGroup" | "Heartbeat" | "HeartbeatGroup" | "WebhookIntegration" | "EmailIntegration" | "IncomingWebhook" | "AmazonSnsIntegration" | "Manuall… required

Type of the resource to show. Responses return a group as a monitor group or a heartbeat group, depending on what it groups.

statusPageId string required

catalogReference CreateStatusPageResourceRequestCatalogReference | null

For a CatalogReference resource, the catalog value it shows. Send it in place of resource_id, and the value is found, or created if it doesn't exist yet. A user's item_id is u123 or their e-mail, and a team's is t123. Responses return them in the same form. Get a user's ID via List team members, and a team's ID via List teams. null for every other type.

chartId string | null

For a LogsChart resource, the ID of the dashboard chart it shows. Send it in place of resource_id. Responses then return a resource_id of the resource's own, not the chart's ID. The chart must be on one of your organization's dashboards. The chart can't be a table, live tail, text or funnel chart. null for every other type.

explanation string | null

Tooltip explanation shown to visitors.

fixedPosition boolean

If true, the resource is saved at exactly position and the other resources keep their positions. Defaults to false.

history boolean

Whether widget_type is history. Sending true sets widget_type to history, and false sets it to plain, unless widget_type is also sent.

markAsDegradedFor "no_incident" | "any_incident" | "incident_matching_metadata" | string

Which incidents mark this resource degraded. A ManuallyTrackedItem has no incidents, so the rule has no effect on one.

markAsDegradedMetadataRule CreateStatusPageResourceRequestMarkAsDegradedMetadataRule

The incident metadata rule used when mark_as_degraded_for is incident_matching_metadata, in the same shape as mark_as_down_metadata_rule. Returned only when mark_as_degraded_for is incident_matching_metadata. A ManuallyTrackedItem has no incidents, so the rule has no effect on one.

markAsDownFor "no_incident" | "any_incident" | "incident_matching_metadata" | string

Which incidents mark this resource down. A ManuallyTrackedItem has no incidents, so the rule has no effect on one.

markAsDownMetadataRule CreateStatusPageResourceRequestMarkAsDownMetadataRule

The incident metadata rule used when mark_as_down_for is incident_matching_metadata. Send a user's item_id as u123 or their e-mail. Responses return it as u123, or as null once the user has left the organization. A team's item_id is t123, and other items' IDs are numbers. Get a user's ID via List team members, and a team's ID via List teams. Returned only when mark_as_down_for is incident_matching_metadata. A ManuallyTrackedItem has no incidents, so the rule has no effect on one.

position number

Where the resource sits in its section, counted from zero. Sending a position moves the resources at or after it down by one, and a position past the end puts it last. Leave it out to add a new resource at the end. With fixed_position the position is saved as given and nothing moves.

resourceId string

ID of the monitor, heartbeat or group to show. Send resource_type with it. Required for every type except ManuallyTrackedItem, a LogsChart sent with chart_id and a CatalogReference sent with catalog_reference. Leave it out for a manually tracked item to create a new one.

statusPageSectionId string

The ID of the section that holds this resource. Leave it out on create to put the resource in the page's first section, or in a new default section if the page has none.

teamId string

Team that owns the resource, such as t123. Defaults to the credentials' team (BETTERSTACK_TEAM_ID, or the profile's team). Changing it replaces the resource.

widgetType "history" | "plain" | "intraday_history" | "response_times" | "intraday_response_times" | "chart_only" | string

How the resource is shown. Defaults to showing the history of its status, or a response times chart for a logs chart.

id string always set

The status_page_resource's id.

statusPageId string always set

The status page the resource is on.

availability number

Availability over the page's history window, from 0.0 to 1.0.

catalogReference CreateStatusPageResourceRequestCatalogReference | null

For a CatalogReference resource, the catalog value it shows. Send it in place of resource_id, and the value is found, or created if it doesn't exist yet. A user's item_id is u123 or their e-mail, and a team's is t123. Responses return them in the same form. Get a user's ID via List team members, and a team's ID via List teams. null for every other type.

chartId string | null

For a LogsChart resource, the ID of the dashboard chart it shows. Send it in place of resource_id. Responses then return a resource_id of the resource's own, not the chart's ID. The chart must be on one of your organization's dashboards. The chart can't be a table, live tail, text or funnel chart. null for every other type.

explanation string | null

Tooltip explanation shown to visitors.

history boolean

Whether widget_type is history.

markAsDegradedFor "no_incident" | "any_incident" | "incident_matching_metadata"

Which incidents mark this resource degraded. A ManuallyTrackedItem has no incidents, so the rule has no effect on one.

markAsDegradedMetadataRule StatusPageResourceMarkAsDegradedMetadataRule

The incident metadata rule used when mark_as_degraded_for is incident_matching_metadata, in the same shape as mark_as_down_metadata_rule. Returned only when mark_as_degraded_for is incident_matching_metadata. A ManuallyTrackedItem has no incidents, so the rule has no effect on one.

markAsDownFor "no_incident" | "any_incident" | "incident_matching_metadata"

Which incidents mark this resource down. A ManuallyTrackedItem has no incidents, so the rule has no effect on one.

markAsDownMetadataRule StatusPageResourceMarkAsDownMetadataRule

The incident metadata rule used when mark_as_down_for is incident_matching_metadata. Send a user's item_id as u123 or their e-mail. Responses return it as u123, or as null once the user has left the organization. A team's item_id is t123, and other items' IDs are numbers. Get a user's ID via List team members, and a team's ID via List teams. Returned only when mark_as_down_for is incident_matching_metadata. A ManuallyTrackedItem has no incidents, so the rule has no effect on one.

ongoingIncidentIds number[]

IDs of the ongoing incidents of the monitor, heartbeat or group the resource shows, including incidents that don't change its status. An incident is listed once it has lasted the status page's min_incident_length. Get one with Get an incident.

position number

Where the resource sits in its section, counted from zero.

publicName string

The name shown publicly on the status page.

resourceId string

ID of the monitor, heartbeat or group to show.

resourceType "Monitor" | "MonitorGroup" | "Heartbeat" | "HeartbeatGroup" | "WebhookIntegration" | "EmailIntegration" | "IncomingWebhook" | "AmazonSnsIntegration" | "Manuall…

Type of the resource to show. Responses return a group as a monitor group or a heartbeat group, depending on what it groups.

status "maintenance" | "operational" | "degraded" | "downtime" | "not_monitored"

The resource's current status.

statusHistory StatusPageResourceStatusHistoryItem[]

The status over the page's history window, oldest first, with one entry per bar on the status page. When the page shows more days than it has bars, each bar covers several days.

statusPageSectionId string

The ID of the section that holds this resource.

widgetType "history" | "plain" | "intraday_history" | "response_times" | "intraday_response_times" | "chart_only"

How the resource is shown. Defaults to showing the history of its status, or a response times chart for a logs chart.

StatusPageResource.lookup(props) reads an object this stack does not manage. It is never created, updated or deleted.

id string required

The status page resource's id.

statusPageId string required

The status page's id.

teamId string

Team whose token selects the page, such as t123. Defaults to the credentials' team.