This article outlines the expected session statuses and behaviors for bulk-delete and bulk-upsert operations, particularly when dealing with existing or non-existing external IDs.
Refer to Identity Sources.
- Identity Sources API to manage an Anything-as-a-Source integration with Okta bulk-load requests
- /bulk-upsert: Insert or update user profiles in the bulk-load request
- /bulk-delete: Deactivate the user profiles in the bulk-load request
Bulk-Delete with Existing External IDs
- Initial Session Creation:
- Upon creating a session for a bulk-delete operation, the session's status will initially be CREATED.
- Bulk-Delete API Call:
- When the bulk-delete API call is made, each provided external ID is validated against the existing user external IDs in Okta.
- Only userIds corresponding to the existing externalIds will be selected for deletion.
- These selected userIds are then pushed for processing.
- The session status is updated to IN_PROGRESS.
- Trigger Session Call:
- Once the "trigger session" API is called, a new import job is scheduled to process the deletions.
- The session status transitions to TRIGGERED.
Bulk-Delete with Non-Existing External IDs
- Initial Session Creation:
- Similar to the above, the session status starts as CREATED.
- Bulk-Delete API Call (No Matches):
- If, during the bulk-delete API call, none of the provided external IDs are found to exist in Okta, then no user IDs will be picked for deletion.
- Crucially, the session status will remain in the CREATED state (it will not transition to IN_PROGRESS as no work is initiated).
- Trigger Session Call and Expected Error:
- When the "trigger session" API is subsequently called, and the session is still in the CREATED state (because no external IDs were found to initiate progress), the following exception will be thrown:
- "Session={sessionId} should be in IN_PROGRESS status in order to be processed".
- This behavior is as expected, indicating that a trigger cannot proceed if the session was never moved to IN_PROGRESS due to a lack of valid data for the bulk operation.
- When the "trigger session" API is subsequently called, and the session is still in the CREATED state (because no external IDs were found to initiate progress), the following exception will be thrown:
Bulk-Upsert with No Data
- The same error behavior observed in "Bulk-Delete with Non-Existing External IDs" applies to the bulk-upsert API call.
- If a bulk-upsert API call is made but no data is to be upserted (e.g., an empty file or payload), the session will also remain in the CREATED state.
- Consequently, if the "trigger session" API is called thereafter, the identical exception will be thrown:
- "Session={sessionId} should be in IN_PROGRESS status in order to be processed"
- This consistency ensures that trigger sessions are only processed when actual data processing has begun and the session is in an 'IN_PROGRESS' state.
Refer to the following for additional details:
