Docs
Live demo

Start a bulk operation

POST/api/v2/bulk-operations

Start one action on many rows a person picked in a list. Each row runs through the same use case as the single request and is checked against the caller's organization first. A row whose single request starts a job finishes when that job ends. Deleting users, creating people from emails, deleting rules, removing a group from applications and fixing drift findings need a preview first (POST /bulk-operations/preview) and are refused here with details.error_code bulk_operation_preview_required. Live progress is published on the event topic bulk-operation:{id}.

Request body application/json · BulkOperationRequest

The action, the IDs of the picked rows and the action parameters

Required2 of 3 fields
actionstringrequired

The action to run on every picked row. accept_findings is refused until it is available.

add_to_groupremove_from_groupdelete_identitiesdiscover_targetscheck_drifttest_connectionset_discovery_schedulestart_managingtest_tunnelssync_connectorsapply_rulesdelete_rulesupdate_template_versionfix_findingsaccept_findingscreate_identitiesadd_group_to_applicationsremove_group_from_applications
idsarray of stringrequired

IDs of the picked rows, at most 500: a longer list is refused with a reason a person can act on. Duplicates and empty values are dropped. add_to_group and remove_from_group also take a person by email: a row whose email no user of the organization has fails with failure code NOT_FOUND. create_identities takes emails only, compared without case. add_group_to_applications and remove_group_from_applications take application IDs.

Optional1 field
paramsobject

Parameters of the action. group_id for add_to_group, remove_from_group, add_group_to_applications and remove_group_from_applications. Optional group_id for create_identities adds the new and the existing people to that group. Display_names (email to the name of the new person) for create_identities, where a missing name is made from the email. Schedule for set_discovery_schedule, template_name and template_version for update_template_version, run_findings (finding ID to run finding ID) for fix_findings, rule_versions (rule ID to the rule version the person reviewed) for apply_rules: a rule changed since then fails its row instead of applying unreviewed access.

7 fields
group_idstring · uuid
schedulestring
template_namestring
template_versioninteger
min 1
run_findingsmap of string → string
display_namesmap of string → string

Email to the name of the person create_identities creates, at most 255 characters.

rule_versionsmap of string → integer

Rule ID to the rule version the person reviewed, for apply_rules. When given, it names every picked rule: a request that leaves out any picked rule is refused with 400. Without rule_versions the rules apply without the version check.

Responses

202

Accepted

BulkOperationResponse · 18 fields
idstring · uuidrequired
job_idstring · uuidrequired

The job that runs the operation. Null for a preview waiting for its confirmation

can be null
actionstringrequired
paramsmap of string → anyrequired

Parameters of the action as the run recorded them. A delete_identities run also records item_kinds: the row ID to user, group or service, so the run is named by what it deleted after those objects are gone. A run on people or groups also records item_labels: the row ID to the name the person or group had when the run was planned, so its rows keep their names after a page reload and after the objects are gone. A run on a group (add_to_group, remove_from_group, create_identities into a group, add_group_to_applications, remove_group_from_applications) records group_label: the name the group had when the run was planned, so the run keeps naming it after the group is gone.

statusstring (entity.OperationLifecycle)required

Where a background operation is in the shared lifecycle (decision S1). outcome says how a finished operation ended and substate qualifies the state.

queuedrunningfinished
terminalbooleanrequired

Whether this operation has finished.

outcomestring (entity.OperationOutcome)required

Final operation result, or null while the operation is active.

successfailurecancelledpartial
can be null
substatestring (entity.OperationSubstate)required

Qualifies the status and outcome of an operation where they alone would hide what the operator must know. Null when none applies.

rollback_in_progressrolled_backneeds_repairoutcome_unknowninterruptedrequires_approvalholds_lockawaiting_confirmationexpiredtimed_outrescheduled
can be null

Safe operation failure. Explanation and recommended_action come from the static failure-code registry. The only text not written by Principal is cluster_answer.

8 fields
codestring (JobFailureCode)required

Closed registry of asynchronous operation failure causes, independent of HTTP problem codes.

ACCESS_PROFILE_STALEAMBIGUOUS_TARGET_OUTCOMEAPPLY_INTERRUPTEDAUTHENTICATION_FAILEDCLICKHOUSE_REPLICAS_OUT_OF_SYNCCLICKHOUSE_USER_NAME_RESERVEDCONNECTION_FAILEDCONNECTION_REFUSEDCONNECTION_TIMEOUTCONNECTOR_CREDENTIALS_MISSINGCONNECTOR_PAUSEDCONNECTOR_SOURCE_CHANGEDCONNECTOR_TYPE_UNAVAILABLECONSTRAINT_VIOLATIONCREDENTIAL_EXPIREDCREDENTIAL_NOT_FOUNDDATABASE_NOT_FOUNDDRIFT_BINDING_NOT_FOUNDDRIFT_DEFAULT_INHERITED_SKIPPEDDRIFT_NO_EXECUTABLE_DIFFDRIFT_PARTIAL_APPLYDRIFT_PLAN_GENERATION_FAILEDDRIFT_RESOURCE_MISMATCHDRIFT_RULE_DELETINGDRIFT_RUN_OUTDATEDDRIFT_SCOPE_MISMATCHGROUP_EXPANSION_LIMIT_EXCEEDEDHANDLER_NOT_FOUNDK8S_CHANGE_REJECTEDK8S_CLUSTER_UNREACHABLEK8S_NAMESPACE_FORBIDDENK8S_NAMESPACE_NOT_FOUNDK8S_RBAC_FORBIDDENKUBERNETES_MEMBER_CREDENTIALS_PENDINGKUBERNETES_SERVICE_ACCOUNT_KUBECONFIG_NOT_ISSUEDMARIADB_TRUNCATE_UNSUPPORTEDMARIADB_USAGE_UNSUPPORTEDMARIADB_GRANTS_AMBIGUOUSMUTATION_LOCKEDMYSQL_MANAGEMENT_PRIVILEGES_MISSING
34 more values
NOT_FOUNDOPERATION_BACKOFFOPERATION_CANCELLEDOPERATION_TIMEOUTOWNED_OBJECTS_DECISION_REQUIREDPERMISSION_DENIEDPLAN_APPLY_ARTIFACT_INVALIDPLAN_APPLY_ORPHANED_LOCKPLAN_APPLY_ROLLBACK_BASELINE_INVALIDPLAN_APPLY_RULE_CHANGEDPLAN_APPLY_TARGET_STATE_CHANGEDPLAN_APPLY_ACCESS_IMPACT_CHANGEDPOSTGRES_FUTURE_OBJECT_CREATORS_MISSINGPOSTGRES_GRANT_AUTHORITY_MISSINGPOSTGRES_MANAGEMENT_PRIVILEGES_MISSINGPOSTGRES_ROLE_ATTRIBUTE_UNSUPPORTEDPOSTGRES_ROLE_NAME_RESERVEDPOSTGRES_TLS_FILE_NOT_ALLOWEDPROVIDER_REQUEST_FAILEDRATE_LIMITEDROLE_EXISTSROLE_NOT_FOUNDROTATION_CHECK_REQUIREDSECRET_STORE_UNAVAILABLESERIALIZATION_ERRORTARGET_ACCOUNT_IDENTITY_MISMATCHTARGET_ACCOUNT_IDENTITY_UNVERIFIEDTARGET_ACCOUNT_IMPORT_PENDINGTARGET_ACCOUNT_PRINCIPAL_LOGINTARGET_ACCOUNT_TAKENTARGET_CONNECTION_MISSINGTARGET_REPAIR_REQUIREDUNKNOWN_ERRORVALIDATION_FAILED
titlestring

Short name of the failure from the same registry, for lists and queues where the explanation is too long. Absent on failures saved before the field existed.

max length 32
explanationstringrequired
recommended_actionstringrequired
retryablebooleanrequired

Whether the failed attempt was eligible for an automatic retry under the actual queue policy.

phasestring

Known operation phase at failure, when available.

resolution_codestring

Stable code of the action that can resolve this failure, the same vocabulary as a problem's resolution.code, for example upstream.check_connection. Absent when no single action does. A screen that offers the action shows it next to the failure, otherwise it shows recommended_action.

max length 128 · pattern ^[a-z][a-z0-9_-]*(\.[a-z0-9_-]+)*$
cluster_answerstring

The Kubernetes cluster's own answer to a change its admission policy or webhook refused: the policy or webhook name and its message. Only a step failure with code K8S_CHANGE_REJECTED carries it, as plain text without control characters, cut to 500 characters. The cluster administrator writes it, not Principal. Given only to callers with access:read in the rule's organization. Absent for runs saved before the field existed.

max length 500
attemptintegerrequired
totalintegerrequired
4 fields
doneintegerrequired
failedintegerrequired
skippedintegerrequired
pendingintegerrequired

Rows waiting to run or still running

request_hashstring

Present on a preview. Confirm the preview with it

expires_atstring · date-time

Present on a preview. It can be confirmed until then

created_atstring · date-timerequired
updated_atstring · date-timerequired
finished_atstring · date-timerequired
can be null
itemsarray of BulkOperationItemResponserequired
7 fields
idstringrequired

The ID of the picked row as the request named it

statusstringrequired
pendingrunningdonefailedskipped
messagestringrequired

Why the row failed or was skipped, in words a person can act on. A pending row of a preview may name what it will do when that differs from the action itself, and a done row may name what else happened.

can be null
attemptintegerrequired

The attempt of the operation this row last ran in

job_idstring · uuid

The job the single request of this row started

Safe operation failure. Explanation and recommended_action come from the static failure-code registry. The only text not written by Principal is cluster_answer.

8 fields
codestring (JobFailureCode)required

Closed registry of asynchronous operation failure causes, independent of HTTP problem codes.

ACCESS_PROFILE_STALEAMBIGUOUS_TARGET_OUTCOMEAPPLY_INTERRUPTEDAUTHENTICATION_FAILEDCLICKHOUSE_REPLICAS_OUT_OF_SYNCCLICKHOUSE_USER_NAME_RESERVEDCONNECTION_FAILEDCONNECTION_REFUSEDCONNECTION_TIMEOUTCONNECTOR_CREDENTIALS_MISSINGCONNECTOR_PAUSEDCONNECTOR_SOURCE_CHANGEDCONNECTOR_TYPE_UNAVAILABLECONSTRAINT_VIOLATIONCREDENTIAL_EXPIREDCREDENTIAL_NOT_FOUNDDATABASE_NOT_FOUNDDRIFT_BINDING_NOT_FOUNDDRIFT_DEFAULT_INHERITED_SKIPPEDDRIFT_NO_EXECUTABLE_DIFFDRIFT_PARTIAL_APPLYDRIFT_PLAN_GENERATION_FAILEDDRIFT_RESOURCE_MISMATCHDRIFT_RULE_DELETINGDRIFT_RUN_OUTDATEDDRIFT_SCOPE_MISMATCHGROUP_EXPANSION_LIMIT_EXCEEDEDHANDLER_NOT_FOUNDK8S_CHANGE_REJECTEDK8S_CLUSTER_UNREACHABLEK8S_NAMESPACE_FORBIDDENK8S_NAMESPACE_NOT_FOUNDK8S_RBAC_FORBIDDENKUBERNETES_MEMBER_CREDENTIALS_PENDINGKUBERNETES_SERVICE_ACCOUNT_KUBECONFIG_NOT_ISSUEDMARIADB_TRUNCATE_UNSUPPORTEDMARIADB_USAGE_UNSUPPORTEDMARIADB_GRANTS_AMBIGUOUSMUTATION_LOCKEDMYSQL_MANAGEMENT_PRIVILEGES_MISSING
34 more values
NOT_FOUNDOPERATION_BACKOFFOPERATION_CANCELLEDOPERATION_TIMEOUTOWNED_OBJECTS_DECISION_REQUIREDPERMISSION_DENIEDPLAN_APPLY_ARTIFACT_INVALIDPLAN_APPLY_ORPHANED_LOCKPLAN_APPLY_ROLLBACK_BASELINE_INVALIDPLAN_APPLY_RULE_CHANGEDPLAN_APPLY_TARGET_STATE_CHANGEDPLAN_APPLY_ACCESS_IMPACT_CHANGEDPOSTGRES_FUTURE_OBJECT_CREATORS_MISSINGPOSTGRES_GRANT_AUTHORITY_MISSINGPOSTGRES_MANAGEMENT_PRIVILEGES_MISSINGPOSTGRES_ROLE_ATTRIBUTE_UNSUPPORTEDPOSTGRES_ROLE_NAME_RESERVEDPOSTGRES_TLS_FILE_NOT_ALLOWEDPROVIDER_REQUEST_FAILEDRATE_LIMITEDROLE_EXISTSROLE_NOT_FOUNDROTATION_CHECK_REQUIREDSECRET_STORE_UNAVAILABLESERIALIZATION_ERRORTARGET_ACCOUNT_IDENTITY_MISMATCHTARGET_ACCOUNT_IDENTITY_UNVERIFIEDTARGET_ACCOUNT_IMPORT_PENDINGTARGET_ACCOUNT_PRINCIPAL_LOGINTARGET_ACCOUNT_TAKENTARGET_CONNECTION_MISSINGTARGET_REPAIR_REQUIREDUNKNOWN_ERRORVALIDATION_FAILED
titlestring

Short name of the failure from the same registry, for lists and queues where the explanation is too long. Absent on failures saved before the field existed.

max length 32
explanationstringrequired
recommended_actionstringrequired
retryablebooleanrequired

Whether the failed attempt was eligible for an automatic retry under the actual queue policy.

phasestring

Known operation phase at failure, when available.

resolution_codestring

Stable code of the action that can resolve this failure, the same vocabulary as a problem's resolution.code, for example upstream.check_connection. Absent when no single action does. A screen that offers the action shows it next to the failure, otherwise it shows recommended_action.

max length 128 · pattern ^[a-z][a-z0-9_-]*(\.[a-z0-9_-]+)*$
cluster_answerstring

The Kubernetes cluster's own answer to a change its admission policy or webhook refused: the policy or webhook name and its message. Only a step failure with code K8S_CHANGE_REJECTED carries it, as plain text without control characters, cut to 500 characters. The cluster administrator writes it, not Principal. Given only to callers with access:read in the rule's organization. Absent for runs saved before the field existed.

max length 500
interruptionstring

Present when the end of the run, not the row itself, decided how the row ended. not_started: a skipped row the cancel kept from starting. job_still_running: a failed row whose job was still running when the run ended. A retry follows that job again instead of starting a second one. Read this field, not the message, which is text for a person and may change.

not_startedjob_still_running
409

Conflict

Common errors: 400 401 403 413 429 503 504. They mean the same for every operation, see Errors.

↑ ↓ to moveEnter to openEsc to close