EvoHub Docs Sign in

On-Call API › Import

Preview an import from PagerDuty

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/pagerduty/preview

Reads the PagerDuty 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 PagerDuty 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.

Nothing is created. Items imported before are marked already_imported.

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 the account holds and what importing it would do.

Content type: application/json

Type: object

  • data ImportPreview required
    Show ImportPreview properties
    • source string
      One of: opsgenie pagerduty
    • users array of object
      • source_id string
      • opsgenie_id string
      • email string
      • name string
      • evohub_user_id string | null
        The matching EvoHub member, or null.
    • teams array of object
      • source_id string
      • name string
    • schedules array of object
      • source_id string
      • opsgenie_id string
      • name string
      • timezone string
      • team string
      • team_source_id string
      • layers array of object
        • name string
        • summary string
        • participants array of string
      • already_imported boolean
      • new_members integer
        For a schedule imported before: people who would be added now.
      • warnings array of string
    • policies array of object
      • source_id string
      • opsgenie_id string
      • name string
      • team string
      • team_source_id string
      • steps array of object
        • after_minutes integer
        • targets array of string
      • already_imported boolean
      • warnings array of string
    • integrations array of object
      • source_id string
      • opsgenie_id string
      • name string
      • source_type string
      • opsgenie_type string
      • evohub_type string
      • policy string
      • team_source_id string
      • already_imported boolean
      • warnings array of string
    • not_imported array of 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 PagerDuty refused the key (PAGERDUTY_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

PagerDuty could not be read (PAGERDUTY_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

PagerDuty is rate limiting the key (PAGERDUTY_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/pagerduty/preview' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <TOKEN>' \
  -d '{
  "region": "eu",
  "api_key": "YOUR_PAGERDUTY_API_KEY"
}'

Last updated