Preview undoing an automatic sync
preview_replacement_restoreShow EXACTLY what undoing one automatic sync would do, counted at this moment, and get the approval restore_replacement needs. destroy_count is how many records undoing it would DESTROY — everything currently held for that period, whoever or whatever put it there, including data a colleague uploaded since. restore_count is how many records would be put back. READ BOTH NUMBERS TO YOUR USER IN THEIR OWN TERMS AND GET THEIR EXPLICIT GO-AHEAD BEFORE CALLING restore_replacement. Undoing a sync is itself a destructive act. If blocked_reason comes back non-null, the period is locked by a finalised statement or a sealed run: read that reason out, do not call restore_replacement, and no approval is issued. The approval is single-use, expires in 15 minutes, and is tied to this entity, this sync, this connection, the member you name AND the exact destroy_count returned here. Send that same number back as expected_destroy_count — never a number you adjusted. If the period’s data changes in between, the approval is spent and you start again from here.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_id | Yes | The replacement’s id — the `id` field of a list_replacements row. | |
| client_id | Yes | The entity (client) id — from list_clients. | |
| on_behalf_of | No | The email address your user signs in to Datavrn with. This records who authorised the change alongside the connection that made it. REQUIRED on an API-key connection — ask your user for it, do not guess. On an OAuth connection leave it out: the change is recorded as authorised by the member who connected; if you do supply it, it must be that member. | |
| connection_id | Yes | The connected data source’s id — from list_replacements or get_pending_work. |