POST /v2/migration/jobs/{id}/actions/rollback — Soft-delete imported records
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Soft-deletes all records that were created during a live import. Records are marked as deleted in MongoDB but remain restorable by Telegra support if needed.
The job status changes to ROLLED_BACK and the response includes counts of how many records were soft-deleted per entity type.
Pre-conditions
- Job status must be
COMPLETED dryRunmust befalse
Required role
affiliate_super_admin
Response 200
200{
"success": true,
"result": {
"rolledBack": {
"patients": 498,
"orders": 498,
"subscriptions": 120,
"addresses": 498,
"ecommerceSystemMappings": 498
}
}
}rolledBack can include up to 8 keys — patients, products, productVariations, orders, subscriptions, coupons, addresses, ecommerceSystemMappings — not just patients/addresses. A key is present only if the job actually created records of that type; entity types the job didn't touch are omitted entirely (not 0).
This response does not include the job's updated status or other job fields. Fetch GET /v2/migration/jobs/{id} afterward to confirm the job is now ROLLED_BACK.
Errors
| Status | Description |
|---|---|
400 | Job is not in COMPLETED status |
400 | Dry-run jobs have no records to roll back |
404 | Job not found |
