UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/
https://{host}:{port}/execute/
Request
This function deletes a cPanel account's Git™ repository. For more information about support for version control in cPanel & WHM, read our Git Version Control and Guide to Git documentation.
Warning:
- When you call this function, the system permanently deletes the entire contents of the specified directory. You cannot recover this data after deletion.
- You cannot use this function to delete any repositories that do not appear in the cache of repositories (for example, repositories that contain invalid characters or exist within cPanel-controlled directories).
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/VersionControl/delete
- A server running cPanel.
https://cpanel-server.tld:2083/execute/VersionControl/delete
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/VersionControl/delete?repository_root=%2Fhome%2Fuser%2Fexample'{ "apiversion": 3, "func": "delete", "module": "VersionControl", "result": { "data": null, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
Request
This function lists Git™ repositories on a cPanel account. For more information about support for version control in cPanel & WHM, read our Git Version Control and Guide to Git documentation.
Important:
This feature does not allow the following characters in repository paths:
\ * | " ' < > & @ ` $ { } [ ] ( ) ; ? : = % #This function does not allow repositories that exist in the following cPanel-controlled directories:
.cpanel.htpasswds.ssh.trashaccess-logscgi-binetclogsperl5mailspamassassinssltmpvar
Users can create repositories in some of these directories on the command line. They may appear in the list of repositories in Gitweb, but users may see an error message if they try to access them.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/VersionControl/retrieve
- A server running cPanel.
https://cpanel-server.tld:2083/execute/VersionControl/retrieve
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/VersionControl/retrieve?fields=name%2Ctype%2Cbranch%2Clast_update'{ "apiversion": 3, "func": "retrieve", "module": "VersionControl", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
This function modifies a Git™ repository's basic settings. For more information about support for version control in cPanel & WHM, read our Git Version Control and Guide to Git documentation.
Note:
- This function only pulls changes from the remote repository if you specify a
branchvalue. - You cannot modify the
type,repository_root, orurlvalues for existing repositories. - You must include the
repository_rootparameter in order to identify the repository to update. - All other input parameters are optional. Use them to assign the new values to the account. If you do not include a parameter or specify its existing value, no change will occur.
The absolute directory path that contains the repository to update.
The new branch to use.
If you do not specify a value, the function does not update this parameter.
Remember:
This function only pulls changes from the remote repository if you specify this value.
The repository's new display name.
If you do not specify a value, the function does not update this parameter.
A JSON-encoded object containing information about the source repository.
If you do not specify a value, the function does not update this parameter.
Important:
- You cannot modify the source repository's URL.
- You must JSON-encode the contents of this object.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/VersionControl/update
- A server running cPanel.
https://cpanel-server.tld:2083/execute/VersionControl/update
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/VersionControl/update?repository_root=%2Fhome%2Fuser%2Fpublic_html%2Fexample&branch=master&name=example&source_repository={%22remote_name%22%3A%22origin%22}'{ "apiversion": 3, "func": "update", "module": "VersionControl", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }