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 creates a new Git™ repository 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.
- For a list of configuration changes, repository restrictions, and troubleshooting steps, read our Guide to Git - For System Administrators documentation.
Important:
The system logs errors for this function in the ~/.cpanel/logs/vc_TIMESTAMP_git_create.log file, where TIMESTAMP represents the time of the error in Unix epoch time.
The absolute path to the directory in which to store the repository, relative to the user's home directory.
Note:
- If the directory does not exist, the system will create it.
- If the specified directory already contains a repository, the system will automatically add it to the list of cPanel-managed repositories.
- This feature enforces several restrictions on repository paths. For more information, read our Guide to Git - For System Administrators documentation.
A JSON-formatted object containing information about the source repository that the system will clone.
Note:
If you do not include source repository data, the function creates an empty repository.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/VersionControl/create
- A server running cPanel.
https://cpanel-server.tld:2083/execute/VersionControl/create
- 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/create?name=example&repository_root=%2Fhome%2Fuser%2Fpublic_html%2Fexample&type=git&source_repository={%22remote_name%22%3A%22origin%22%2C%22url%22%3A%22ssh%3A%2F%2Fclone.domain.com%2Fcloneme%22}'{ "apiversion": 3, "func": "create", "module": "VersionControl", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
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 } }