Skip to content

Delete a record or restore it

Delete a record into its key domain’s recycle bin, and restore it from there. A deleted record stays restorable until someone shreds it.

Who can do this: a domain owner of the record’s key domain.

The samples use the allowed helper from Access decisions.

1. Delete the record

Without a version, objects.delete retires every version of the record.

await allowed(await client.objects.delete({ locator }));
Deny reasonWhenWhat to do
heldA legal hold covers the record.Wait for the hold to lift.
retentionThe dataset’s retention floor still applies.Wait until the floor passes.

2. List the recycle bin

const bin = await client.domains.recycleBin(root);

3. Restore the item

const item = bin.find((i) => i.locator === locator)!;
await allowed(await client.domains.restore(item));

The record is live again in its folder.

Next