---
title: "Import from Opsgenie"
description: "Preview and run an import of teams, members, schedules with rotations, future overrides, escalations, services, alert sources and heartbeats from Opsgenie."
---

`POST /api/im/import/opsgenie/preview` · `POST /api/im/import/opsgenie/apply`

Moves the structure of an Opsgenie account into Incident Management. Uptimeify reads Opsgenie through its official REST API with **GET requests only** and changes nothing there. The Opsgenie API key travels in the request body, is used for that request only and is **never stored**. Alerts and incidents are not imported.

Both endpoints take the same body and read Opsgenie afresh. `preview` writes nothing and answers what an import would create. `apply` creates it through the same endpoints the dashboard and the Terraform provider use ([teams](/api/incident-management/teams), [team members](/api/incident-management/team-members), [tiers](/api/incident-management/team-tiers), [schedules](/api/incident-management/schedules), [schedule overrides](/api/incident-management/schedule-overrides), [services](/api/incident-management/services), [alert sources](/api/incident-management/alert-sources), heartbeat monitors), so every limit and permission of those endpoints applies, and every created object is in the audit log.

**Running it again is safe.** Uptimeify remembers which Opsgenie ID became which object. A second run creates only what is new or was deleted since; what is still there is reported as `exists` and left as is.

The same page is in the dashboard under **Incidents > Teams > Import**.

## Authentication

Session or organization API token of an organization `admin`. Other roles get `403` `forbidden`. CLI tokens cannot call these endpoints (they would hand a third-party key to the CLI). Both endpoints together allow 20 calls per hour and organization (`429` `rateLimited`).

## Request body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `apiKey` | string | yes | Opsgenie API key with read access (Settings > API key management), 8 to 200 characters. |
| `region` | string | no | `us` (default, `api.opsgenie.com`) or `eu` (`api.eu.opsgenie.com`). No other host is ever called. |
| `inviteMissing` | boolean | no | Default `false`: Opsgenie users without an account in your organization are listed in `missingUsers` and left out. `true`: they are invited like [team invite](/api/incident-management/team-members) (role `responder`, invitation mail). |
| `heartbeatCustomerId` | integer \| null | no | Customer the heartbeat monitors are created under. Without it heartbeats are skipped. |

Unknown fields are rejected with `400` `invalidRequestBody`.

## How Opsgenie maps

| Opsgenie | Uptimeify |
|----------|-----------|
| Team | Team. The team time zone is the time zone of its first schedule. |
| Team member | Team member, matched by email (case-insensitive) to existing users of your organization. Role `admin` stays `admin`, everything else becomes `member`. Inactive accounts and accounts without an IM role (`notEligible`) are left out. |
| Escalation of the team | The tier ladder of the team. Rules with the same delay share one tier; the time between two tiers is the difference of their delays. `if-not-closed` becomes stop mode `resolved`. A repeat (`count`, `waitInterval`) becomes team `escalationRepeats`, the last tier then escalates after `waitInterval` minutes. Only the first escalation of a team is imported; a team has one ladder in Uptimeify. |
| Rule recipient: schedule | Each rotation of that schedule becomes a schedule of the tier. |
| Rule recipient: user | The tier pages that person around the clock. |
| Rule recipient: team, `notifyType` users/admins | Not imported (`recipientTeam`). |
| Rotation (`daily`, `weekly`, `hourly`, `length`) | Schedule with `rotationMode: auto`, one person per period in Opsgenie order, starting at the rotation `startDate` (`effectiveFrom`). `weekly` 1 = `weekly`, 2 = `biweekly`, otherwise `custom`. A rotation with one person becomes `none`. Time restrictions become `weeklySchedules`; a window over midnight is split in two. |
| Schedule override (future only) | `online` override on each imported schedule of the named rotations. |
| Team without escalation | Its schedules become one tier. |
| Routing rule | Needs no own object when it points at the team escalation or an imported schedule (listed in `covered`). Rules that notify nobody or point elsewhere are listed in `skipped`. |
| Service | [Service](/api/incident-management/services), owner team if imported. Opsgenie offers services on Standard and Enterprise only; on other plans the list stays empty. |
| Integration | [Alert source](/api/incident-management/alert-sources) of the integration team: Datadog `datadog`, Grafana `grafana`, Prometheus `alertmanager`, Sentry `sentry`, Zabbix `zabbix`, Email `email`, API and Webhook `custom`. Other types and disabled integrations are skipped. Point the tool to the new webhook address afterwards. |
| Heartbeat | Heartbeat monitor of `heartbeatCustomerId` with the same interval (at most 30 days). Disabled heartbeats are skipped. Counts against the monitor quota. |

## Preview

`POST /api/im/import/opsgenie/preview`

```bash
curl -X POST "$BASE_URL/api/im/import/opsgenie/preview" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"apiKey":"<opsgenie key>","region":"eu","heartbeatCustomerId":12}'
```

`200 OK` (shortened):

```json
{
  "provider": "opsgenie",
  "teams": [
    {
      "sourceId": "og-t-ops",
      "status": "create",
      "existingId": null,
      "name": "Ops",
      "timezone": "Europe/Berlin",
      "escalationRepeats": 2,
      "escalationRepeatsAfterMinutes": 0,
      "escalationRepeatsStopMode": "acknowledged",
      "members": [
        { "email": "anna@example.com", "name": "Anna", "userId": "u_1", "imRole": "admin", "status": "add" },
        { "email": "dora@example.com", "name": "Dora", "userId": null, "imRole": "member", "status": "missing" }
      ],
      "tiers": [
        {
          "sourceKey": "og-e-ops:0",
          "status": "create",
          "existingId": null,
          "delayMinutes": 0,
          "autoEscalationEnabled": true,
          "autoEscalationAfterMinutes": 10,
          "autoEscalationStopMode": "acknowledged",
          "userEmails": [],
          "schedules": [
            {
              "sourceKey": "og-s-ops:og-r-week",
              "status": "create",
              "existingId": null,
              "name": "Ops_schedule / Week",
              "timezone": "Europe/Berlin",
              "effectiveFrom": "2026-11-30T08:00:00.000Z",
              "effectiveUntil": null,
              "weeklySchedules": [],
              "rotationMode": "auto",
              "rotationRepeats": "weekly",
              "customRepeatUnit": null,
              "customRepeatValue": null,
              "autoRotationSize": 1,
              "startsOnDayOfWeek": 1,
              "startsOnTime": "09:00",
              "memberEmails": ["anna@example.com", "ben@example.com"]
            }
          ]
        }
      ],
      "overrides": []
    }
  ],
  "services": [{ "sourceId": "og-svc-1", "status": "create", "existingId": null, "name": "Checkout", "description": null, "teamSourceId": "og-t-ops" }],
  "sources": [{ "sourceId": "og-i-dd", "status": "create", "existingId": null, "name": "Datadog Prod", "opsgenieType": "Datadog", "type": "datadog", "teamSourceId": "og-t-ops" }],
  "heartbeats": [{ "sourceId": "nightly-backup", "status": "create", "existingId": null, "name": "nightly-backup", "intervalMinutes": 1440 }],
  "missingUsers": [{ "email": "dora@example.com", "fullName": "Dora" }],
  "skipped": [{ "kind": "escalationRule", "name": "Ops_escalation: Database (+60 min)", "reason": "recipientTeam", "team": "Ops" }],
  "covered": [{ "kind": "routingRule", "name": "Default", "reason": "routingCoveredByTeam", "team": "Ops" }]
}
```

`status` is `create` (will be created) or `exists` (created by an earlier run and still there; `existingId` is its id). `skipped[].reason` names why something is not imported, for example `rotationNoMembers`, `rotationEnded`, `participantNotUser`, `recipientTeam`, `escalationNotPrimary`, `scheduleNotInEscalation`, `routingNotifyNone`, `integrationTypeUnsupported`, `heartbeatIntervalUnsupported`, `heartbeatNeedsCustomer`.

## Apply

`POST /api/im/import/opsgenie/apply`, same body. Reads Opsgenie again and creates what the preview shows as `create`.

`200 OK`:

```json
{
  "provider": "opsgenie",
  "created": { "teams": 2, "members": 4, "invited": 0, "tiers": 3, "schedules": 3, "overrides": 1, "services": 2, "sources": 3, "heartbeats": 1 },
  "existing": { "teams": 0, "members": 0, "tiers": 0, "schedules": 0, "overrides": 0, "services": 0, "sources": 0, "heartbeats": 0 },
  "failed": [],
  "sources": [{ "name": "Datadog Prod", "type": "datadog", "team": "Ops", "ingestToken": "<shown once>", "inboundEmailAddress": null }],
  "heartbeats": [{ "name": "nightly-backup", "heartbeatToken": "<shown once>" }],
  "missingUsers": [{ "email": "dora@example.com", "fullName": "Dora" }],
  "skipped": []
}
```

- `failed` lists objects one of the create endpoints rejected, with its `code` and message, for example `monitorQuotaReached` for a heartbeat over the monitor quota. Everything else is still created; fix the cause and run the import again.
- `sources[].ingestToken` is shown here once, as with [create alert source](/api/incident-management/alert-sources). The webhook address is `$BASE_URL/api/im/ingest/<ingestToken>`.

## Common errors

| Status | `data.code` | When |
|--------|-------------|------|
| `400` | `invalidRequestBody` | Missing or wrong field, unknown field. |
| `400` | `importSourceUnauthorized` | Opsgenie rejected the key (wrong key, wrong region, no read access). |
| `400` | `importTooLarge` | More than 100 teams, 200 schedules or 400 changes in one run. |
| `403` | `forbidden` | Not an organization admin. |
| `429` | `rateLimited` | More than 20 calls per hour and organization. |
| `502` | `importSourceUnavailable` / `importSourceRateLimited` | Opsgenie not reachable, answered with an error or its rate limit. |
