Config-as-code

Drop happyuptime.yml in your repo, version-control it like Terraform / Pulumi, and use happy config push in CI to apply changes. Diffs against remote state — only updates what changed.

Schema (high level)

yaml
version: 1monitors: - name: Web App url: https://app.acme.com type: http interval: 60 regions: [us-east, us-west, eu-west] expected_status_codes: [200] alerts: - slack-ops - email-pagerdutystatus_pages: - name: Acme Status slug: acme template: minimal components: - name: Web App monitor: Web App - name: API monitor: APIalert_channels: - id: slack-ops type: slack_app channel: alerts notify_oncall: trueoncall_schedules: - name: Engineering On-Call layers: - name: Primary rotation_type: weekly handoff_day: 1 # Monday handoff_hour: 9 timezone: America/New_York members: [alice@acme.com, bob@acme.com, carol@acme.com]

Workflow

1

Scaffold from current state

bash
happy config init > happyuptime.yml

Captures everything currently in your account. Edit from there.

2

Validate before pushing

bash
happy config validate happyuptime.yml
3

Preview the diff

bash
happy config push happyuptime.yml --dry-run

Color-coded diff. Make sure deletes are intentional.

4

Apply

bash
happy config push happyuptime.yml

Env vars

yaml
monitors: - name: ${SERVICE_NAME} API url: ${SERVICE_URL}/health

Env vars resolve from the shell. CI tip: store URLs and slugs in env vars so the same YAML file works in staging and prod.

In CI/CD

See the CI/CD guide for full GitHub Actions / GitLab CI examples.

yaml
# .github/workflows/uptime.yml (excerpt)- name: Apply uptime config env: HAPPYUPTIME_API_KEY: ${{ secrets.HAPPYUPTIME_API_KEY }} run: | npx happyuptime-cli config validate happyuptime.yml npx happyuptime-cli config push happyuptime.yml
Ask a question... ⌘I