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 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 } }
Request
This function lists the redirects in an account's .htaccess files.
Important:
When you disable the Web Server role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Mime/list_redirects
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Mime/list_redirects
- 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/list_redirects?destination=http%3A%2F%2Fexample.tld®ex=%22%5E%5Ba-z0-9_-%5D{6%2C18}%24%22'{ "apiversion": 3, "func": "list_redirects", "module": "Mime", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }