What cpanel tool can I call via php or perl to create/remove FTP account, user, password, directory path.

This will only be on one domain. (It's my server, so I'm root)

I need this because I've developed an image asset management system that needs to create FTP logins when the users login into the system is created.

Any thoughts or suggestions? Is there a WHM script I can interface with directly?