On-Call API › Import
Preview an import from PagerDuty
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
bearerAuth(oncall:settings:write)apiKeyHeader(oncall:settings:write)
Request body required
Preview reads only api_key, region and team_map. Apply also takes the source ids to import.
api_keystring requiredThe source account's API key; read access is enough. Not stored.regionstring requiredschedulesarray of stringpoliciesarray of stringintegrationsarray of stringteam_mapobjectSource team id → EvoHub team id.
Responses
200
What the account holds and what importing it would do.
dataImportPreview requiredShow ImportPreview properties
sourcestringusersarray of objectsource_idstringopsgenie_idstringemailstringnamestringevohub_user_idstring | nullThe matching EvoHub member, or null.
teamsarray of objectsource_idstringnamestring
schedulesarray of objectsource_idstringopsgenie_idstringnamestringtimezonestringteamstringteam_source_idstringlayersarray of objectnamestringsummarystringparticipantsarray of string
already_importedbooleannew_membersintegerFor a schedule imported before: people who would be added now.warningsarray of string
policiesarray of objectsource_idstringopsgenie_idstringnamestringteamstringteam_source_idstringstepsarray of objectafter_minutesintegertargetsarray of string
already_importedbooleanwarningsarray of string
integrationsarray of objectsource_idstringopsgenie_idstringnamestringsource_typestringopsgenie_typestringevohub_typestringpolicystringteam_source_idstringalready_importedbooleanwarningsarray of string
not_importedarray of stringwarningsarray of string
successboolean required
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).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
401
No API key was sent, or it is unknown, revoked or expired (UNAUTHORIZED).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
403
The caller lacks the permission (FORBIDDEN), or team_map names a team the caller is not in (NOT_IN_TEAM).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
409
Another import is running for the organization (IMPORT_IN_PROGRESS).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
429
Too many requests (RATE_LIMITED). Wait Retry-After seconds.
Retry-AfterintegerSeconds to wait.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
500
Something went wrong on EvoHub's side (INTERNAL_ERROR). Retry later.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
502
PagerDuty could not be read (PAGERDUTY_UNAVAILABLE).
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-readable explanation.
503
PagerDuty is rate limiting the key (PAGERDUTY_RATE_LIMITED), or EvoHub members could not be checked (MEMBER_CHECK_UNAVAILABLE). Retry shortly.
errorobject requiredcodestring requiredMachine-readable code. Branch on this.messagestring requiredHuman-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"
}'