There might be a better way through the UI, but it’s possible with the API.
Here’s some example code from the Ruby client: