Creating PHP API

Hello everyone.

I don’t know that’s correct area to post it, but I want know how I can can to create a PHP statement to create, suspend, and remove clients using class as curl but only in PHP?

I’m not very successful with Linux, but I was able to mount a NextCloud server. Now I want to integrate it via module in WHMCS.