openapi: 3.2.0 info: contact: email: cs@cpanel.net name: WebPros International, LLC url: https://cpanel.net/support/ description: UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings. license: name: cPanel License url: https://cpanel.net/legal-notices/ termsOfService: https://cpanel.net/legal-notices/ title: cPanel U Log Manager API version: 11.137.9999.106 x-api-evangelist-provenance: 'Harvested verbatim from cPanel''s developer portal on 2026-09-05 via the MCP tool get-full-api-description at https://api.docs.cpanel.net/mcp. ONE mechanical change was made before storage: example values containing PEM private-key or certificate blocks, and AWS-access-key-shaped example strings, were replaced with REDACTED_* placeholders so the file can be stored in a public git repository without tripping secret scanning. No path, operation, parameter, schema or description was altered, added or removed.' servers: - description: A server running cPanel. url: https://{host}:{port}/execute variables: host: default: cpanel-server.tld description: The hostname of a server running cPanel. port: default: '2083' description: The cPanel port. security: - BasicAuth: [] tags: - description: The LogManager module for UAPI. name: LogManager paths: /LogManager/delete_archive: get: x-readonly: false x-rollback: clean description: Delete a specific log archive file from the authenticated user's `~/logs` directory. operationId: LogManager-delete_archive parameters: - description: 'The log archive filename to delete. Requirements: * Must reside in the user''s `~/logs` directory. * Must end with `.gz`. * Must not contain path traversal characters. ' in: query name: file required: true schema: example: example.com-Aug-2024.gz type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: delete_archive type: string module: description: The name of the module called. example: LogManager type: string result: properties: data: {} errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details. ' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Delete a log archive file tags: - LogManager x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n LogManager \\\n delete_archive \\\n file=example.com-Aug-2024.gz\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/LogManager/delete_archive?file=example.com-Aug-2024.gz - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LogManager_delete_archive.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend/\n# to .../frontend//api_examples/LogManager_delete_archive.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/LogManager/,\n q/delete_archive/,\n {\n 'file' => 'example.com-Aug-2024.gz',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n print to_json($data);\n}\nelse {\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LogManager_delete_archive.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend/\n// to .../frontend//api_examples/LogManager_delete_archive.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'LogManager',\n 'delete_archive',\n array (\n 'file' => 'example.com-Aug-2024.gz',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n print to_json($data);\n}\nelse {\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 136 /LogManager/get_settings: get: x-readonly: true description: This function retrieves the account's log archival settings. operationId: LogManager-get_settings parameters: [] responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: get_settings type: string module: description: The name of the module called. example: LogManager type: string result: properties: data: properties: archive_logs: description: 'Whether the system archives log files to your home directory. * `1` — Archives the logs. * `0` — Does **not** archive the logs.' enum: - 1 - 0 example: 1 type: integer prune_archive: description: 'Whether the system removes the previous month''s archived log files from your home directory. * `1` — Removes the logs. * `0` — Does **not** remove the logs.' enum: - 1 - 0 example: 1 type: integer retention_days: description: 'The number of days the system retains archived log files before automatic removal. A value of `0` means the system retains logs indefinitely. When the user has not set a custom value, this returns the server-wide default.' example: 30 type: integer using_default: description: 'Whether the user uses the server-wide default retention period. * `1` — Uses the server default. * `0` — Uses a custom retention value.' enum: - 1 - 0 example: 1 type: integer type: object errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: transformed: description: Post-processing may have transformed the data. enum: - 1 example: 1 type: integer status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Retrieve cPanel account's log archival settings tags: - LogManager x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n LogManager \\\n get_settings\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/LogManager/get_settings - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LogManager_get_settings.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend/\n# to .../frontend//api_examples/LogManager_get_settings.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/LogManager/,\n q/get_settings/\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LogManager_get_settings.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend/\n// to .../frontend//api_examples/LogManager_get_settings.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'LogManager',\n 'get_settings'\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /LogManager/list_archives: get: x-readonly: true description: This function returns a list of the user's archive files. operationId: LogManager-list_archives parameters: [] responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: list_archives type: string module: description: The name of the module called. example: LogManager type: string result: properties: data: description: An array of objects that contain information about the archive files. These files reside in the cPanel user's `~/logs` directory. items: properties: file: description: The archive file's name. example: domain.com-May-2019.gz type: string mtime: description: The archive file's last modified date. example: 1557835866 format: unix_timestamp type: integer path: description: The archive file's path. example: /home/user/logs/domain.com-May-2019.gz type: string type: object type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: transformed: description: Post-processing may have transformed the data. enum: - 1 example: 1 type: integer status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return cPanel account's archive files list tags: - LogManager x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n LogManager \\\n list_archives\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/LogManager/list_archives - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LogManager_list_archives.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend/\n# to .../frontend//api_examples/LogManager_list_archives.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/LogManager/,\n q/list_archives/\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LogManager_list_archives.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend/\n// to .../frontend//api_examples/LogManager_list_archives.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'LogManager',\n 'list_archives'\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /LogManager/list_error_logs: get: x-readonly: true description: 'This function lists the website''s PHP error log files with size and last-modified metadata. It does not return file contents.' operationId: LogManager-list_error_logs parameters: - description: A domain owned by the cPanel account. example: example.com in: query name: domain required: true schema: type: string responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: list_error_logs type: string module: description: The name of the module called. example: LogManager type: string result: properties: data: description: An array of objects describing the requested error logs. items: properties: error: description: 'An error message that describes why the system could not return metadata for this log file.' example: null type: - string - 'null' file_id: description: "The `file_id` value for each log file.\n\n* `php_fpm_error_log` — The PHP FPM error log\n file located in the user's home directory\n under the `logs/` subdirectory.\n* `docroot_error_log` — The PHP error log\n file located in the website's document\n root directory.\n* `homedir_error_log` — The home directory\n error log file located in the user's home\n directory." enum: - php_fpm_error_log - docroot_error_log - homedir_error_log example: php_fpm_error_log type: string modified_today: description: 'Whether the log file was last modified today (server local time). * `1` — The file was modified today. * `0` — The file was not modified today.' enum: - 1 - 0 example: 1 type: integer mtime: description: 'The log file''s last-modified time as a unix timestamp.' example: 1778112083 type: - integer - 'null' path: description: The absolute path to the log file. example: /home/cpuser/logs/example_com.php.error.log type: string size: description: The log file's size, in bytes. example: 4096 type: - integer - 'null' type: object type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: transformed: description: Post-processing may have transformed the data. enum: - 1 example: 1 type: integer status: description: '* `1` — Success. * `0` — Failed. Check the `errors` field for more details.' enum: - 1 - 0 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return domain's PHP error logs tags: - LogManager x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n LogManager \\\n list_error_logs \\\n domain=example.com\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/LogManager/list_error_logs?domain=example.com - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to the cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LogManager_list_error_logs.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/LogManager_list_error_logs.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/LogManager/,\n q/list_error_logs/,\n {\n 'domain' => 'example.com',\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to the cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LogManager_list_error_logs.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/LogManager_list_error_logs.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'LogManager',\n 'list_error_logs',\n array(\n 'domain' => 'example.com',\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}\n" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 138 /LogManager/set_settings: get: x-readonly: false x-rollback: clean description: 'This function saves the account''s log archive settings. **Note:** You **must** pass at least one of the `archive_logs`, `prune_archive`, or `retention_days` parameters.' operationId: LogManager-set_settings parameters: - description: 'Whether to archive log files to your home directory after the system processes statistics. * `1` — Archive the logs. * `0` — Do **not** archive the logs. **Note:** * This parameter defaults to the `archive-logs` setting''s value in the user''s `~/.cpanel-logs` file. * If this file does **not** exist, this parameter defaults to the `default_archive-logs` key''s value in the [`cpanel.config`](https://go.cpanel.net/cpanelconfiginvalid) file.' in: query name: archive_logs required: false schema: enum: - 0 - 1 example: 1 type: integer - description: 'Whether to remove the previous month''s archived logs from the `~/logs directory` at the end of each month. * `1` — Remove the logs. * `0` — Do **not** remove the logs. **Note:** * This parameter defaults to the `remove-old-archived-logs` setting''s value in the user''s `~/.cpanel-logs` file. * If this file doesn''t exist, this parameter defaults to the `default_remove-old-archive-logs` key''s value in the [`cpanel.config`](https://go.cpanel.net/cpanelconfiginvalid) file.' in: query name: prune_archive required: false schema: enum: - 0 - 1 example: 1 type: integer - description: 'The number of days to retain archived log files before automatic removal. * `0` — Retain logs indefinitely. * `-1` — Clear the per-user override and revert to the server default. * Any positive integer — Retain logs for that many days. When not provided, the existing value is preserved.' in: query name: retention_days required: false schema: example: 30 minimum: -1 type: integer responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: set_settings type: string module: description: The name of the module called. example: LogManager type: string result: properties: data: {} errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: {} status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 0 - 1 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Save cPanel account's log archive settings tags: - LogManager x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n LogManager \\\n set_settings \\\n archive_logs=1 \\\n prune_archive=1 \\\n retention_days=30\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/LogManager/set_settings - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LogManager_set_settings.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend/\n# to .../frontend//api_examples/LogManager_set_settings.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/LogManager/,\n q/set_settings/\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LogManager_set_settings.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend/\n// to .../frontend//api_examples/LogManager_set_settings.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'LogManager',\n 'set_settings'\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 82 /LogManager/view_error_log: get: x-readonly: true description: 'This function reads the trailing lines of a single PHP error log file for a domain owned by the current cPanel user and returns them in chronological order (oldest first).' operationId: LogManager-view_error_log parameters: - description: A domain owned by the current cPanel user. example: example.com in: query name: domain required: true schema: type: string - description: 'Which of the three well-known log locations to read. * `php_fpm_error_log` — The PHP FPM error log. This file is located in the `logs/` directory within the cPanel account''s home directory. * `docroot_error_log` — The PHP error log. This file is located in the domain''s document root directory. * `homedir_error_log` — The cPanel account PHP error log. This file is located in the cPanel account''s home directory.' example: php_fpm_error_log in: query name: file_id required: true schema: enum: - php_fpm_error_log - docroot_error_log - homedir_error_log type: string - description: 'The number of lines to retrieve from the end of the log file. **Note:** Values above `5000` are silently capped at `5000`.' example: 100 in: query name: limit required: false schema: default: 100 minimum: 1 type: integer responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: view_error_log type: string module: description: The name of the module called. example: LogManager type: string result: properties: data: description: 'An object describing the requested log file and its content.' properties: file_id: description: 'The identifier of the log file that was read. Same value as the `file_id` input parameter. * `php_fpm_error_log` — The PHP FPM error log. This file is located in the `logs/` directory within the cPanel account''s home directory. * `docroot_error_log` — The PHP error log. This file is located in the domain''s document root directory. * `homedir_error_log` — The cPanel account PHP error log. This file is located in the cPanel account''s home directory.' enum: - php_fpm_error_log - docroot_error_log - homedir_error_log example: php_fpm_error_log type: string log_content: description: 'The end of the error log file in chronological order. **Note:** This array will return an empty value if the log file is empty.' example: - '[07-May-2026 00:01:23 UTC] PHP Warning: Use of undefined constant FOO' - '[07-May-2026 00:02:47 UTC] PHP Fatal error: Allowed memory size exhausted' items: type: string type: array lines_read: description: The number of lines returned in the `log_content` return's value. example: 2 type: integer modified_today: description: 'Whether the log file was modified today. The function determines the time and date with the cPanel & WHM server''s time. * `1` — The file was modified today. * `0` — The file was not modified today.' enum: - 1 - 0 example: 1 type: integer mtime: description: 'The log file''s last-modified time, in Unix time format. **Note:** This return value is determined via a `fstat` system call on the log file.' example: 1778112083 type: integer partial: description: 'Whether the log file contains more lines than the `limit` parameter''s value. * `1` — The file exceeds the `limit` parameter''s value. * `0` — The file did not exceed the `limit` parameter''s value.' enum: - 1 - 0 example: 0 type: integer path: description: The absolute path to the log file on disk. example: /home/cpuser/logs/example_com.php.error.log type: string size: description: 'The log file''s size, in bytes. **Note:** This return value is determined via a `fstat` system call on the log file.' example: 4096 type: integer type: object errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: transformed: description: Post-processing may have transformed the data. enum: - 1 example: 1 type: integer status: description: '* `1` — Success. * `0` — Failed. Check the `errors` field for more details.' enum: - 1 - 0 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Return PHP error log for a domain tags: - LogManager x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n LogManager \\\n view_error_log \\\n domain=example.com \\\n file_id=php_fpm_error_log \\\n limit=100\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/LogManager/view_error_log?domain=example.com&file_id=php_fpm_error_log&limit=100 - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to the cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file LogManager_view_error_log.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/LogManager_view_error_log.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/LogManager/,\n q/view_error_log/,\n {\n 'domain' => 'example.com',\n 'file_id' => 'php_fpm_error_log',\n 'limit' => 100,\n }\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n # Do something with the $data\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to the cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file LogManager_view_error_log.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/LogManager_view_error_log.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'LogManager',\n 'view_error_log',\n array(\n 'domain' => 'example.com',\n 'file_id' => 'php_fpm_error_log',\n 'limit' => 100,\n )\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n // Do something with the $data\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}\n" x-cpanel-api-version: UAPI x-cpanel-available-version: cPanel 138 components: securitySchemes: BasicAuth: scheme: basic type: http externalDocs: url: https://cpanel.net/developers/ x-tagGroups: - name: API Development Tools tags: - API Token Management - Batch - SSE Task Management - URL Parsing - name: Authentication tags: - External Authentication - Two-Factor Settings - name: Backup Information tags: - BackupInfo - BackupInfo Status - name: Block Ip Addresses tags: - Block IP - name: Commerce Integration tags: - Market Integration - SSL Certificates - name: Contact Information tags: - Contact Information - name: cPanel Account tags: - Account Enhancements - Account Information - Account Management - AuditLog - Contact Information - cPanel Features - Disk Quotas - DomainRecommendations - Personalization - Resource Usage and Statistics - Subaccount Management - Team Roles - Team Users - name: cPanel Account Backups tags: - Backup - File Restoration - name: cPanel Plugin Framework tags: - Formbricks - Plugins - name: cPanel Theme Management tags: - Application Information - Brand Management - Branding Files - Browser Cache Management - Language - Theme Settings - name: Directory Management tags: - Directory Indexes - Directory Privacy - Directory Protection - name: DNS tags: - DNS - DNS Information - DNS Security - Dynamic DNS - Email DNS Settings - ZoneEdit - name: Domain tags: - Domain - name: Domain Management tags: - AddonDomain - Direct Link Protection (Hotlink) - Domain - Domain Information - Domain Redirection - DomainLookup - Park - SubDomain - Virtual Host Information - name: Domains tags: - Subdomains - name: Email tags: - Email Accounts - Email Filtering - Email Forwarding - Email Server Information - Email Suspensions - Mail Server Information - Mailbox Management - Mailing Lists - Signing and Encryption (GnuPG Keys) - Spam Filtering (Greylisting) - Spam Management - Spam Prevention (BoxTrapper) - Webmail Applications - Webmail Sessions - name: Extract Information tags: - ExtractInfo - ExtractInfo Status - name: File Manager tags: - Trash - name: Files tags: - FTP Accounts - FTP Server Settings - Image Tools - Jodit - Manage Files - Manage Files - WebDisk Settings - name: GIT Management tags: - Deployment Settings - Repository Management - name: InProductSurvey tags: - InProductSurvey - name: MySQL and MariaDB tags: - Database Information - Database Management - Remote Databases - User Management - name: Notifications tags: - Pushbullet - name: Optional Applications tags: - Antivirus Protection (ClamAV) - Calendar and Contacts (DAV) - Calendar and Contacts Server - WordPress Manager Backups - name: PostgreSQL tags: - PostgreSQL Database Management - PostgreSQL User Management - name: Retrieve bandwidth information tags: - Bandwidth - name: Security tags: - Known SSH Hosts Management - Login Information - name: Server Information tags: - cPanel Server Information - Notifications - Password Strength - SSH - WebPros MCP - WebProsMCP - name: ServiceProxy tags: - ServiceProxy - name: Site Quality Monitoring tags: - SiteQuality - name: SSL Certificates tags: - Auto-generated SSL Certificates - cPanel Account SSL Management - SNI Email Settings - SSL Certificate Management - Verify Domain Ownership - name: Statistics tags: - Domain Statistics - Weblog Settings - name: UserData tags: - UserData - name: Web Server Configuration tags: - EA4 - EasyApache Settings - PHP - name: Web Server Management tags: - Application Manager - ModSecurity - NginxCaching - PHP Settings - Web Apps - name: Website Configuration tags: - Handler Management - Logs - Mime Type Management - Nova - Site Information - Site Installation - Sitejet - WPX