post

POST /v2/migration/jobs/{id}/actions/rollback — Soft-delete imported records

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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
  • dryRun must be false

Required role

affiliate_super_admin

Response 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

StatusDescription
400Job is not in COMPLETED status
400Dry-run jobs have no records to roll back
404Job not found
Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here!