Skip to main content
Manage your Vibe OnCall setup as code. The Vibe OnCall Terraform provider lets you define teams, schedules, escalation policies, services, alert sources, and alert routing in Terraform files, review changes in a pull request, and apply them to your organization. It works with both Terraform and OpenTofu.
Write your on-call setup in code → review it like any other change → apply it to Vibe OnCall.
This page gets you started. The full reference for every setting lives on the Terraform Registry.

What You Can Manage

You can also look up things that already exist without managing them: members by email, teams, schedules, labels, and chat channels. Each has a data source page on the Registry.

Before You Start

  • Terraform 1.9 or later, or OpenTofu.
  • Everyone you reference already has a Vibe OnCall account. Terraform looks people up by email; it doesn’t invite them. Make sure they exist before you apply, either by inviting them in the app or by provisioning them through SCIM.
  • An API key for Terraform to use, created below.

Create an API Key for Terraform

  1. Navigate to Administration → API Keys and click Create API Key.
  2. Name it after where it runs, such as Terraform or Terraform CI, so its changes are easy to recognize later.
  3. Choose an Access level. Full access is the simplest. To limit the key to what Terraform manages, choose Custom and select the matching actions:
    • Manage every team for teams and their members.
    • Manage services in Global and every team for services.
    • Manage on-call schedules for schedules, plus Manage schedule teams if you change which teams own an existing schedule.
    • Manage escalation policies, Manage maintenance windows, Manage alert sources, and Manage alert routing for those settings.
    Read-only keys can’t make changes, so they don’t work for Terraform.
  4. Click Create API Key and copy the key. Store it in your secret manager or CI secrets, not in your Terraform files.
See API Key Management for expiration, rotation, and the request log.

Quick Start

Add the provider to your configuration:
The provider reads the key from the VIBEONCALL_API_KEY environment variable:
For a full working setup, start from the complete example. It creates a team with admins and members, a weekly rotation, a two-tier escalation policy, a service, and an alert source with routing. Fill in your team name and member emails, then apply.

Bring an Existing Setup Under Terraform

If you already configured Vibe OnCall in the app, import those settings instead of recreating them. Recreating a team creates a second team with the same name, because team names don’t have to be unique.
  1. Find the numeric ID of each thing you want to import. The Public API list endpoints return them, for example GET /teams, GET /schedules?teamId=…, or GET /alert-sources?teamId=…. For a single team, schedule, escalation policy, or service, the ID is also the number at the end of its page address in the app.
  2. Add an import block for each one:
  1. Run terraform plan -generate-config-out=generated.tf. Terraform reads the current settings and writes matching configuration for you.
  2. Review the generated file, then run terraform plan again. It should show only imports and 0 to change. Apply, then delete the import blocks.
Each resource’s Registry page has an Import section with the ID it expects.

Other Details Worth Knowing

  • Terraform owns what it manages. If someone edits a Terraform-managed schedule or policy in the app, the next terraform apply changes it back. Make the change in code instead.
  • Changes are attributed to the key. The History tab on teams, schedules, escalation policies, services, maintenance windows, and alert routing shows the API key’s name as the actor for changes Terraform made.
  • Removing a member safely. In schedules and escalation policies, reference members through vibeoncall_team_membership, and set create_before_destroy = true on the membership. Terraform then takes someone off rotations and policies before it removes them from the team. The complete example does this.
  • OpenTofu works the same way. The provider is published to the OpenTofu registry under the same vibraniumlabs/vibeoncall address.
  • Pin the version. ~> 0.1.0 takes bug fixes without surprises. The changelog lists what each release changes.