Ir al contenido

Statuspage Cheat Sheet

Overview

Atlassian Statuspage is a hosted status page service that enables organizations to communicate real-time system status, planned maintenance, and incident updates to their users and stakeholders. It provides a professional, branded status page that displays the health of individual components and overall system availability, reducing support ticket volume during outages by proactively communicating issues.

Statuspage supports multiple page types including public pages for external customers, private pages for internal teams, and audience-specific pages for segmented communication. It integrates with monitoring tools like Datadog, PagerDuty, and OpsGenie to automatically update component statuses when incidents are detected, and provides subscriber notifications via email, SMS, and webhooks to keep stakeholders informed throughout the incident lifecycle.

Installation

API Setup

# Set API credentials
export STATUSPAGE_API_KEY="your-api-key"
export STATUSPAGE_PAGE_ID="your-page-id"
export STATUSPAGE_API="https://api.statuspage.io/v1"

# Verify API access
curl -s "$STATUSPAGE_API/pages" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" | jq '.[].id'

# Get your page ID
curl -s "$STATUSPAGE_API/pages" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" | jq '.[0] | {id, name, url}'

Terraform Provider

terraform {
  required_providers {
    statuspage = {
      source  = "sbecker/statuspage"
      version = "~> 0.5"
    }
  }
}

provider "statuspage" {
  api_key = var.statuspage_api_key
}

CLI Wrapper Script

#!/bin/bash
# statuspage-cli.sh — simple wrapper for common operations
SP_API="https://api.statuspage.io/v1"
SP_KEY="${STATUSPAGE_API_KEY}"
SP_PAGE="${STATUSPAGE_PAGE_ID}"

sp_get()  { curl -s -H "Authorization: OAuth $SP_KEY" "$SP_API/pages/$SP_PAGE/$1"; }
sp_post() { curl -s -X POST -H "Authorization: OAuth $SP_KEY" -H "Content-Type: application/json" -d "$2" "$SP_API/pages/$SP_PAGE/$1"; }
sp_patch(){ curl -s -X PATCH -H "Authorization: OAuth $SP_KEY" -H "Content-Type: application/json" -d "$2" "$SP_API/pages/$SP_PAGE/$1"; }

Core Commands — Component Management

Managing Components

# List all components
curl -s "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/components" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" | jq '.[] | {id, name, status}'

# Create a component
curl -X POST "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/components" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "component": {
      "name": "Payment Processing",
      "description": "Handles all payment transactions",
      "status": "operational",
      "only_show_if_degraded": false,
      "showcase": true
    }
  }'

# Update component status
curl -X PATCH "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/components/COMPONENT_ID" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"component": {"status": "degraded_performance"}}'

# Valid component statuses:
# operational, degraded_performance, partial_outage, major_outage, under_maintenance

# Create a component group
curl -X POST "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/component-groups" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "component_group": {
      "name": "Core Infrastructure",
      "components": ["component-id-1", "component-id-2"]
    }
  }'

# Delete a component
curl -X DELETE "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/components/COMPONENT_ID" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY"

Core Commands — Incident Management

Creating and Updating Incidents

# Create a new incident
curl -X POST "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/incidents" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "incident": {
      "name": "Elevated error rates on API",
      "status": "investigating",
      "impact_override": "minor",
      "body": "We are investigating elevated error rates on our API endpoints.",
      "component_ids": ["api-component-id"],
      "components": {
        "api-component-id": "degraded_performance"
      },
      "deliver_notifications": true
    }
  }'

# Update an incident with new status
curl -X PATCH "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/incidents/INCIDENT_ID" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "incident": {
      "status": "identified",
      "body": "Root cause identified — a misconfigured load balancer rule. Working on a fix.",
      "components": {
        "api-component-id": "partial_outage"
      }
    }
  }'

# Resolve an incident
curl -X PATCH "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/incidents/INCIDENT_ID" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "incident": {
      "status": "resolved",
      "body": "The load balancer configuration has been corrected. All systems operational.",
      "components": {
        "api-component-id": "operational"
      }
    }
  }'

# Valid incident statuses:
# investigating, identified, monitoring, resolved, postmortem

# List open incidents
curl -s "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/incidents/unresolved" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" | jq '.[] | {id, name, status, impact}'

Scheduled Maintenance

# Create scheduled maintenance
curl -X POST "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/incidents" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "incident": {
      "name": "Database maintenance window",
      "status": "scheduled",
      "scheduled_for": "2026-05-25T02:00:00Z",
      "scheduled_until": "2026-05-25T06:00:00Z",
      "body": "Planned database maintenance for schema migration and index optimization.",
      "component_ids": ["db-component-id"],
      "components": {
        "db-component-id": "under_maintenance"
      },
      "deliver_notifications": true,
      "auto_transition_to_maintenance_state": true,
      "auto_transition_to_operational_state": true
    }
  }'

# Update scheduled maintenance to in-progress
curl -X PATCH "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/incidents/INCIDENT_ID" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"incident": {"status": "in_progress", "body": "Maintenance has begun."}}'

Core Commands — Subscriber Management

# List subscribers
curl -s "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/subscribers" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" | jq '.[] | {id, email, mode}'

# Add an email subscriber
curl -X POST "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/subscribers" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subscriber": {
      "email": "ops-team@company.com",
      "skip_confirmation_notification": true,
      "component_ids": ["api-component-id", "db-component-id"]
    }
  }'

# Add a webhook subscriber
curl -X POST "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/subscribers" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subscriber": {
      "endpoint": "https://hooks.slack.com/services/T00/B00/xxx",
      "email": "webhook@company.com"
    }
  }'

# Remove a subscriber
curl -X DELETE "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/subscribers/SUBSCRIBER_ID" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY"

Configuration

Terraform Configuration

# Define components
resource "statuspage_component" "api" {
  page_id     = var.statuspage_page_id
  name        = "REST API"
  description = "Core REST API endpoints"
  status      = "operational"
  showcase    = true
}

resource "statuspage_component" "web_app" {
  page_id     = var.statuspage_page_id
  name        = "Web Application"
  description = "Customer-facing web application"
  status      = "operational"
  showcase    = true
}

resource "statuspage_component_group" "core" {
  page_id     = var.statuspage_page_id
  name        = "Core Services"
  description = "Primary customer-facing services"
  components  = [
    statuspage_component.api.id,
    statuspage_component.web_app.id,
  ]
}

# Define metrics
resource "statuspage_metrics_provider" "datadog" {
  page_id       = var.statuspage_page_id
  type          = "Datadog"
  api_key       = var.datadog_api_key
  application_key = var.datadog_app_key
}

Automation Integration (Datadog Example)

# Datadog monitor with Statuspage webhook
monitors:
  - name: "API Error Rate > 5%"
    type: metric alert
    query: "avg(last_5m):sum:http.errors{service:api} / sum:http.requests{service:api} > 0.05"
    message: |
      API error rate has exceeded 5%.
      @webhook-statuspage-api-degraded
    tags:
      - service:api
      - team:platform

# Webhook payload for Statuspage
webhooks:
  - name: statuspage-api-degraded
    url: "https://api.statuspage.io/v1/pages/PAGE_ID/incidents"
    custom_headers:
      Authorization: "OAuth API_KEY"
    payload: |
      {
        "incident": {
          "name": "API Performance Degradation",
          "status": "investigating",
          "component_ids": ["api-component-id"],
          "components": {"api-component-id": "degraded_performance"}
        }
      }

Advanced Usage

Metrics and System Metrics

# Create a system metric
curl -X POST "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/metrics" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "metric": {
      "name": "API Response Time",
      "metric_identifier": "api_response_time_ms",
      "suffix": "ms",
      "tooltip_description": "Average API response time in milliseconds",
      "y_axis_min": 0,
      "y_axis_max": 1000,
      "decimal_places": 0,
      "display": true
    }
  }'

# Submit metric data points
curl -X POST "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/metrics/METRIC_ID/data" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "timestamp": 1716000000,
      "value": 145.3
    }
  }'

# Batch submit metric data
curl -X POST "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/metrics/data" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "METRIC_ID_1": [{"timestamp": 1716000000, "value": 145.3}],
      "METRIC_ID_2": [{"timestamp": 1716000000, "value": 99.98}]
    }
  }'

Automation Script

#!/bin/bash
# auto-statuspage.sh — automated incident creation from monitoring
set -euo pipefail

SP_API="https://api.statuspage.io/v1"
SP_KEY="$STATUSPAGE_API_KEY"
SP_PAGE="$STATUSPAGE_PAGE_ID"

create_incident() {
  local name="$1" component_id="$2" component_status="$3" body="$4"
  
  curl -s -X POST "$SP_API/pages/$SP_PAGE/incidents" \
    -H "Authorization: OAuth $SP_KEY" \
    -H "Content-Type: application/json" \
    -d "$(jq -n \
      --arg name "$name" \
      --arg cid "$component_id" \
      --arg cs "$component_status" \
      --arg body "$body" \
      '{incident: {name: $name, status: "investigating", body: $body, component_ids: [$cid], components: {($cid): $cs}, deliver_notifications: true}}'
    )"
}

update_component() {
  local component_id="$1" status="$2"
  
  curl -s -X PATCH "$SP_API/pages/$SP_PAGE/components/$component_id" \
    -H "Authorization: OAuth $SP_KEY" \
    -H "Content-Type: application/json" \
    -d "{\"component\": {\"status\": \"$status\"}}"
}

# Usage
# create_incident "API outage" "comp-id" "major_outage" "Investigating API failures"
# update_component "comp-id" "operational"

Troubleshooting

IssueCauseSolution
Notifications not sendingSubscriber list empty or notifications disabledCheck deliver_notifications: true in incident creation
Component status stuckIncident not resolvedResolve all incidents affecting the component
Metrics not displayingData points too old or wrong formatSubmit data within last 24h using Unix timestamps
Webhook subscribers failingEndpoint unreachable or timing outCheck webhook endpoint returns 2xx within 10s
Scheduled maintenance not auto-startingauto_transition not setSet auto_transition_to_maintenance_state: true
API returning 422Invalid component status valueUse only: operational, degraded_performance, partial_outage, major_outage
Page not loading custom domainDNS not configuredAdd CNAME record pointing to hosted.statuspage.io
Rate limited (420)Too many API requestsMax 60 requests per minute; implement backoff
# Debug: verify page configuration
curl -s "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" | jq '{name, url, updated_at}'

# Debug: check notification delivery
curl -s "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/incidents/INCIDENT_ID" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" | jq '.incident_updates[] | {status, deliver_notifications, created_at}'

# List all unresolved incidents
curl -s "$STATUSPAGE_API/pages/$STATUSPAGE_PAGE_ID/incidents/unresolved" \
  -H "Authorization: OAuth $STATUSPAGE_API_KEY" | jq '.[] | {id, name, status}'