This thread has information on where to find API information for yet undocumented functions (like creating databases, db users, and adding privileges).
Basically, you open the x3 theme and dig through the files. Most of the functions in there are implemented via the XML API 1 scheme.
To save you some time, here are the few XML requests you need:
add database user
Code:
<cpanelaction>
<module>Mysql</module>
<func>adduser</func>
<apiversion>1</apiversion>
<args>{database_user}</args>
<args>{password}</args>
</cpanelaction>
add database
Code:
<cpanelaction>
<module>Mysql</module>
<func>adddb</func>
<apiversion>1</apiversion>
<args>{database}</args>
</cpanelaction>
grant privileges to user for database
Code:
<cpanelaction>
<module>Mysql</module>
<func>adduserdb</func>
<apiversion>1</apiversion>
<args>{cpanel_user}_{database}</args>
<args>{cpanel_user}_{database_user}</args>
<args>ALL</args>
</cpanelaction>
Note: The above code presents granting "ALL" privileges on a database. To grant specific privileges, use several <args></args> each containing the specific privilege to add. Privilege options (for MySQL 5) are: ALTER, CREATEROUTINE, CREATETEMPORARYTABLES, CREATE, DELETE, DROP, SELECT, INSERT, UPDATE, REFERENCES, INDEX, LOCKTABLES, ALL
Hope that helps.