Skip to content

rollback auth0

Deletes from the tenant the users of a CMF file, each one by the user_id import auth0 gave it: the one in --report’s target_ids, else the one its CMF record leads to (auth0| followed by its target_ids.auth0, else its source_id). Each user is checked to exist first; one that doesn’t is listed as not found. Nothing else is deleted, never a whole connection.

Use it to clear out a rehearsal or a failed migration. With --report, only the users that import created are deleted, not the ones it found already there.

Terminal window
# list what would be deleted
iamigrate rollback auth0 --in users.cmf.jsonl.gz --report import-report.json --dry-run --domain your-tenant.us.auth0.com --token $AUTH0_TOKEN
# delete
iamigrate rollback auth0 --in users.cmf.jsonl.gz --report import-report.json --domain your-tenant.us.auth0.com --token $AUTH0_TOKEN

A real delete asks for confirmation. When not run interactively (in CI, or with stdin redirected), pass --yes.

The token needs the read:users and delete:users scopes. Calls run on the same worker pool as the import’s organizations and roles phase, which backs off on Auth0’s rate limits.

The rollback report, rollback-report.json alongside --in unless --out says otherwise, lists the users deleted (with their target ID), not_found, and failed (with the error). On a dry run, deleted lists the users that would be.

FlagDescription
--inCMF users.cmf.jsonl.gz or uncompressed users.cmf.jsonl path; gzip is detected automatically (required)
--reportimport-report.json of the import to undo: only its succeeded users are deleted, by its target_ids (optional)
--outrollback-report.json output path (default: alongside --in)
--dry-runList the users that would be deleted, without deleting them
--yes, -yDelete without asking for confirmation (required when not run interactively)
--domainAuth0 tenant domain (or $AUTH0_DOMAIN)
--tokenAuth0 Management API token (or $AUTH0_TOKEN)
--client-idMachine-to-Machine application client ID (or $AUTH0_CLIENT_ID). Can’t be combined with --token.
--client-secretMachine-to-Machine application client secret (or $AUTH0_CLIENT_SECRET)