b2_update_file_legal_hold
Set or clear a legal hold on a specific file version in B2 to block deletion. Legal hold overrides retention settings, ensuring protected files cannot be removed.
Instructions
Set or clear a legal hold on a specific file version in B2. When a legal hold is active, the file cannot be deleted regardless of retention settings. Requires the writeFileLegalHolds capability on the application key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileId | Yes | The B2 file ID of the file to update. | |
| confirm | No | Confirm this irreversible/protection-removing operation. Required when the server destructive policy is 'confirm' (the default). | |
| fileName | Yes | The name of the file (required by the B2 API alongside fileId). | |
| legalHold | Yes | 'on' to apply a legal hold; 'off' to remove it. B2's write API expects this bare string — not the isClientAuthorizedToRead/value object that b2_get_file_info returns. |