You can manage the CloudMail service via REST API. It offers the same functionality as the web interface. The API communicates via JSON encoded in UTF-8.
In order to use the Cloudmail API, you need to have the service active, as well as a user with sufficient privileges. Logging in with the user into CloudMail API will provide you with a set of access tokens.
You can find the API documentation HERE.