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
- Navigate to Administration → API Keys and click Create API Key.
- Name it after where it runs, such as Terraform or Terraform CI, so its changes are easy to recognize later.
-
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.
- Click Create API Key and copy the key. Store it in your secret manager or CI secrets, not in your Terraform files.
Quick Start
Add the provider to your configuration:VIBEONCALL_API_KEY environment variable:
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.- 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=…, orGET /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. - Add an
importblock for each one:
- Run
terraform plan -generate-config-out=generated.tf. Terraform reads the current settings and writes matching configuration for you. - Review the generated file, then run
terraform planagain. It should show only imports and 0 to change. Apply, then delete theimportblocks.
Other Details Worth Knowing
- Terraform owns what it manages. If someone edits a Terraform-managed schedule or policy in the app, the next
terraform applychanges 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 setcreate_before_destroy = trueon 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/vibeoncalladdress. - Pin the version.
~> 0.1.0takes bug fixes without surprises. The changelog lists what each release changes.