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 adds a redirect to a domain.
Important:
When you disable the Web Server role, the system disables this function.
Whether to redirect all files within a directory to the same filename within the destination directory.
1- Redirect all files within the directory.0- Do not redirect all files within the directory.
Whether to redirect domains with or without www.
2- Redirect withwww.1- Redirect withoutwww.0- Redirect with and withoutwww.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Mime/add_redirect
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Mime/add_redirect
- 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/Mime/add_redirect?domain=example.com&redirect=http%3A%2F%2Fexample.com%2F&redirect_wildcard=1&redirect_www=0&src=%2Fspecific-page&type=permanent'{ "apiversion": 3, "func": "add_redirect", "module": "Mime", "result": { "data": null, "errors": null, "messages": [ … ], "metadata": {}, "status": 1, "warnings": null } }
Request
This function removes a redirect from a domain.
Important:
When you disable the Web Server role, the system disables this function.
An argument string that contains the arguments of a Redirect or RedirectMatch directives.
The absolute file path to the document root containing the .htaccess file to change.
If you don't pass this parameter, the system looks up the document root from the domain parameter's value.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Mime/delete_redirect
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Mime/delete_redirect
- 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/Mime/delete_redirect?domain=example.com&args=redirectme%C2%A0http%3A%2F%2Fredirectme.com%2F&docroot=%2Fhome%2Fexample%2Fpublic_html%2F&src=redirectpage.html'{ "apiversion": 3, "func": "delete_redirect", "module": "Mime", "result": { "data": null, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Mime/get_redirect
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Mime/get_redirect
- 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/Mime/get_redirect?domain=example.com'{ "apiversion": 3, "func": "get_redirect", "module": "Mime", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }