Sorry, there isn't a simple way to do this right now. You could still use Javascript to trigger a click event -- you just need to use the right selector.
This will find the first box with a collapse button and trigger it.
$('.box').find('[data-widget="collapse"]').click()
This still isn't ideal, because the box itself doesn't have an ID, so if you have multiple boxes with collapse buttons, you'll have to do a little more work to pick out the right one, by numeric position, or perhaps by finding one with a particular title associated with it. This is still all doable with jQuery, but will require a little more work.
-Winston