EvoHub Docs Sign in

On-Call API › Import

Import from Opsgenie

Use with AI
View as MarkdownThis page as plain text, for pasting into an AI tool Open in ClaudeAsk Claude questions about this page Open in ChatGPTAsk ChatGPT questions about this page
Connect to Cursor / VS Code / ClaudeSearch and read these docs from your AI tool (MCP server)

MCP server URL

https://docs-dev.evohub.io/mcp

Claude Code

claude mcp add --transport http evohub-docs-docs https://docs-dev.evohub.io/mcp

Claude (claude.ai and Claude Desktop): Settings → Connectors → Add custom connector, and paste the URL above.

Claude Desktop — claude_desktop_config.json

{
  "mcpServers": {
    "evohub-docs-docs": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://docs-dev.evohub.io/mcp"
      ]
    }
  }
}

Cursor — ~/.cursor/mcp.json

{
  "mcpServers": {
    "evohub-docs-docs": {
      "url": "https://docs-dev.evohub.io/mcp"
    }
  }
}

VS Code — .vscode/mcp.json

{
  "servers": {
    "evohub-docs-docs": {
      "type": "http",
      "url": "https://docs-dev.evohub.io/mcp"
    }
  }
}
POST/api/v1/import/opsgenie/apply

Reads the Opsgenie account with api_key (a read-only key is enough; it is used for this request only and not stored) in region (us or eu), matches its users to EvoHub members by email, and works out what would be created. team_map maps Opsgenie team ids to EvoHub teams the caller is in; unmapped items go to the caller's first team. One import runs per organization at a time, within 25 seconds.

Creates the schedules, escalation policies and integrations whose source ids are listed in schedules, policies and integrations, in that order. Importing an item again does not duplicate it; a schedule imported before only gains the members who have joined EvoHub since. The answer lists what was created, updated and skipped, with each new integration's webhook URL.

Permission (API-key scope): oncall:settings:write.

Authorization

Any one of:

Request body required

Content type: application/json

Type: ImportRequest

Preview reads only api_key, region and team_map. Apply also takes the source ids to import.

  • api_key string required
    The source account's API key; read access is enough. Not stored.
    Max length: 200
  • region string required
    One of: us eu
  • schedules array of string
  • policies array of string
  • integrations array of string
  • team_map object
    Source team id → EvoHub team id.
    Other keys: string

Responses

200

What was done.

Content type: application/json

Type: object

  • data ImportResult required
    Show ImportResult properties
    • created object
      • schedules array of ImportedItem
        Show ImportedItem properties
        • id string
          The new EvoHub id.
        • name string
        • source_id string
        • opsgenie_id string
      • policies array of ImportedItem
        Show ImportedItem properties
        • id string
          The new EvoHub id.
        • name string
        • source_id string
        • opsgenie_id string
      • integrations array of object
        • id string
        • name string
        • source_id string
        • opsgenie_id string
        • evohub_type string
        • webhook_url string
          Where to point the source tool.
    • updated object
      • schedules array of object
        • id string
        • name string
        • source_id string
        • opsgenie_id string
        • added_members array of string
    • skipped array of object
      • kind string
      • name string
      • reason string
    • warnings array of string
  • success boolean required
    Value: true

400

The body is not JSON (INVALID_BODY); api_key, region or team_map is invalid (VALIDATION_FAILED); or Opsgenie refused the key (OPSGENIE_UNAUTHORIZED).

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.

401

No API key was sent, or it is unknown, revoked or expired (UNAUTHORIZED).

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.

403

The caller lacks the permission (FORBIDDEN), or team_map names a team the caller is not in (NOT_IN_TEAM).

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.

409

Another import is running for the organization (IMPORT_IN_PROGRESS).

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.

429

Too many requests (RATE_LIMITED). Wait Retry-After seconds.

Headers

  • Retry-After integer
    Seconds to wait.

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.

500

Something went wrong on EvoHub's side (INTERNAL_ERROR). Retry later.

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.

502

Opsgenie could not be read (OPSGENIE_UNAVAILABLE).

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.

503

Opsgenie is rate limiting the key (OPSGENIE_RATE_LIMITED), or EvoHub members could not be checked (MEMBER_CHECK_UNAVAILABLE). Retry shortly.

Content type: application/json

Type: Error

  • error object required
    • code string required
      Machine-readable code. Branch on this.
    • message string required
      Human-readable explanation.

Example request

curl -X POST 'https://evohub.io/api/v1/import/opsgenie/apply' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <TOKEN>' \
  -d '{
  "region": "eu",
  "api_key": "YOUR_OPSGENIE_API_KEY",
  "policies": [
    "P4D5E6F"
  ],
  "team_map": {
    "PTEAM01": "a3f9c2e1-7b4d-4c8a-9e6f-2d1b0c9a8f7e"
  },
  "schedules": [
    "P1A2B3C"
  ],
  "integrations": [
    "P7G8H9I"
  ]
}'

Last updated