Skip to content
Dashboard
Theme
Theme

Session cutover helper during an active import

POST /v1/sessions/migrate: Session cutover helper during an active import.

View Markdown

POST /v1/sessions/migrate

The app’s server-side SDK reads the user from the old provider (its userinfo endpoint; the token never reaches us) and sends the legacy profile ID. It resolves only through the import’s legacy IDs (profiles.legacy_ids under the import’s source) in organizations the import imported and has not rolled back, while the import is running or completed; each legacy ID resolves once (import_state_conflict afterwards). The email must still be in a verified domain of the organization. Audited (session.migrated).

Scope
imports:write
Auth
Secret key (sk_…)
Since
1.0
  • OhAuthCat-Version string

    Minor version; defaults to the environment’s pin.

  • Idempotency-Key string

    Honoured for 24 h; a replay returns the original response.

    min length 1 · max length 255

  • import string Required

  • legacy_profile_id string Required

    min length 1

Errors share one shape; see the error code catalogue.

curl -X POST \
"https://api.ohauthcat.com/v1/sessions/migrate" \
-H "Authorization: Bearer $OHAUTHCAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"import": "imp_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"legacy_profile_id": "01J9Z3K5V7W8X9Y0Z1A2B3C4D5"
}'
Response 200
{
"profile": {
"claims": {},
"risk": {
"score": 0,
"reasons": [
"impossible_travel"
],
"degraded": true
},
"custom_attributes": {},
"policy_hints": {
"force_sso": true,
"force_sso_excluded": true,
"max_age_seconds": 1,
"idp_initiated_allowed": true,
"guest": true
},
"access_policy": "guest",
"email_verified": true,
"idp_groups_verified": true,
"id": "prof_01J9ZQ4M7K2X8V3N5B6C1D0E9F",
"object": "profile",
"organization_id": "org_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"connection_id": "conn_01J9Z3K5V7W8X9Y0Z1A2B3C4D5",
"connection_type": "saml",
"idp_id": "0oa1b2c3d4E5F6g7h8i9",
"email": "jane@acme.com",
"email_domain_verified": true,
"first_name": "Jane",
"last_name": "Doe",
"groups": [
"Engineering"
],
"role": "admin",
"attributes": {},
"raw_attributes": {},
"legacy_ids": {
"workos": "org_01H8ZQ4M7K2X8V3N5B6C1D0E9F"
}
}
}