Delete Version history

Hello,

We have over 1000 version histories for some objects.

Is there a way to delete version history from M-Files? Or is it possible to set that only X version histories should be saved?

Or do we have to solve this by code?

Best regards